I’m adding OTA firmware update functionality over Bluetooth (BLE) and am having issues where calling esp_ota_end() constantly causes a panic. I have had this working previously during development. There seems to be no issues with starting the update and writing the chunks of firmware to flash. I have tried erasing the flash (using idf.py erase-flash), thinking that maybe something corrupted it somehow, but that didn’t help. I have also tried reading the firmware file from an SD card instead of over Bluetooth and get the same result.
I'm using the ESP32-S3 Mini with 8MB of flash and have set the partition table to factory app with two OTA partitions. At the moment I have no security features enabled. I'm using esp_ota_get_next_update_partition() to get the partition to use for the update and am using OTA_WITH_SEQUENTIAL_WRITES when beginning the update.
I get this log output when the end function is called (unsure if it's useful):
Code: Select all
I (67349) esp_image: segment 0: paddr=00110020 vaddr=3c070020 size=220ach (139436) map
Today I had a colleague flash my board with what was accidentally an unfinished version of this feature, and the firmware update ran and completed fine. He then flashed it with the latest version of our code and it didn’t work. I then flashed the same board with the same unfinished version on my computer and it didn’t work. I then had my colleague again flash the board with the unfinished version, which had worked before, and it no longer worked. I repeated this after cleaning the build as well as after erasing the flash, both times with the same result.
Here is what my stack looks like after the panic. Seems to be something to do with verifying the firmware image?
- Screenshot 2023-07-11 165445.png (22.75 KiB) Viewed 3905 times
Does anyone have any ideas on what could be causing this?
Thanks.