Problem with building fw from source
-
I'm setting up the toolchain to build the firmware from source, however this is running in a container in a cloud environment and we plan to use the OTA mechanism to push out to our devices with our application code built into MPY's from the frozen directory.
However I am hitting a problem.
I’ve got a built toolchain now in a container, I’m not using Jenkins so had to figure out the build steps from the Jenkins jobs
I can build a lopy image now from the latest release zip on github. I am building with
make BOARD=LOPY CLEAN
make BOARD=LOPY TARGET=boot
make BOARD=LOPY LORA_BAND=USE_BAND_868 TARGET=appI note at this point lora.bin is bigger than expected compared to the firmware versions I've unpacked before (1.2M)
I tried adding our python to the frozen directory, then lora.bin ended up at circa 1.6M
I manually built these into a tgz file, along with the generated partitions.bin bootloader.bin and script
If I flash this with the pyupdate utility (the one used for the manual upgrade/downgrade process) the flash process completes with no errors but on booting a board I get this
rst:0x10 (RTCWDT_RTC_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
flash read err, 1000
Falling back to built-in command interpreter.
OKets Jun 8 2016 00:22:57
Output from upgrade tool is below
Connecting........_
Uploading stub...
Running stub...
Stub running...
Changing baud rate to 921600
Changed.
Erasing 262144 bytes at address 1000
Erasing 262144 bytes at address 41000
Erasing 262144 bytes at address 81000
Erasing 262144 bytes at address c1000
Erasing 262144 bytes at address 101000
Erasing 262144 bytes at address 141000
Erasing 262144 bytes at address 181000
Erasing 262144 bytes at address 1c1000
Auto-detected Flash size: 4MB
Compressed 844056 bytes to 844320...
Wrote 844056 bytes (844320 compressed) at 0x00001000 in 12.0 seconds (effective 565.1 kbit/s)...
Hash of data verified.Leaving...
Auto-detected Flash size: 4MB
Compressed 3072 bytes to 139...
Wrote 3072 bytes (139 compressed) at 0x00008000 in 0.0 seconds (effective 1581.4 kbit/s)...
Hash of data verified.Leaving...
Auto-detected Flash size: 4MB
Compressed 1292720 bytes to 842112...
Wrote 1292720 bytes (842112 compressed) at 0x00010000 in 12.7 seconds (effective 817.2 kbit/s)...
Hash of data verified.Leaving...
-
@wstallwood
It sounds like in your application OTA updates would be the easiest. With firmwares older than1.7.2.b1
you can use the generated appimg.bin to do a OTA update, after that you just need to use the regular firmware bin file for OTA. Please checkout this example: https://docs.pycom.io/chapter/tutorials/all/ota.html
-
Thanks Robert,
I can't do make flash because my container with the toolchain is part of a cloud environment. So my idea was to build up to the flash image in the same way Pycom do when they distribute firmware in the tgz files and test from that.
Eventually the build will go into a OTA update mechanism (hence why it's cloud hosted).
-
@wstallwood In order to flash that to the device, just use the command:
make flash
in the ESP32 directory, where you have build the binaries. You have to connect P2 to GND, if you did taht before too. If you want to clean out your build, use:
make clean