Error while trying to update the firmware via OTA
Posted: Fri Jun 21, 2019 2:10 pm
Hi, I am trying to create a bluetooth SPP system with a ESP32 (I am following the "ble_spp_server" example). I need to find a simple way to update the firmware and I am also following the "simple_ota_example" example.
What I have done so far has been to take the original "ble_spp_server" example and add a command listener: if the user sends a specific command via Bluetooth, it activates the WiFi and connects to a HTTP (without SSL) server which contains the new firmware which will be downloaded (I have enabled from the make menuconfig the debug HTTP OTA flag).
The core logic seems to work, but I am receiving the following error while updating some firmwares:
I (3800) esp_https_ota: Starting OTA...
I (3800) esp_https_ota: Writing to partition subtype 17 at offset 0x290000
E (40010) esp_https_ota: Error: esp_ota_write failed! err=0x260
I (40010) esp_image: segment 0: paddr=0x00290020 vaddr=0x3f400020 size=0x374d0 (226512) map
I (40200) esp_image: segment 1: paddr=0x002c74f8 vaddr=0x3ffbdb60 size=0x03768 ( 14184)
I (40220) esp_image: segment 2: paddr=0x002cac68 vaddr=0x40080000 size=0x00400 ( 1024)
0x40080000: _WindowOverflow4 at C:/msys32/home/Riccardo/esp/esp-idf/components/freertos/xtensa_vectors.S:1779
I (40220) esp_image: segment 3: paddr=0x002cb070 vaddr=0x40080400 size=0x04fa0 ( 20384)
I (40240) esp_image: segment 4: paddr=0x002d0018 vaddr=0x400d0018 size=0xdeaf0 (912112) map
0x400d0018: _flash_cache_start at ??:?
E (40980) esp_image: invalid segment length 0xffffffff
CORRUPT HEAP: multi_heap.c:477 detected at 0x3ffc5900
abort() was called at PC 0x4008b52d on core 1
0x4008b52d: r_rwbt_isr at ??:?
ELF file SHA256: ea1a3cc5829e91c03c2535b612168638f17cc0d21668e06348c778959a0fdf69
Backtrace: 0x40087c78:0x3ffc7bb0 0x40087ec5:0x3ffc7bd0 0x4008b52d:0x3ffc7bf0 0x400823ce:0x3ffc7c10 0x400879a9:0x3ffc7c30 0x400ea5ed:0x3
ffc7c50 0x400d2b8d:0x3ffc7c80 0x4008d35d:0x3ffc7cf0
0x40087c78: r_ld_sco_audio_isr at ??:?
0x40087ec5: ld_sco_end at ld_acl.c:?
0x4008b52d: r_rwbt_isr at ??:?
0x400823ce: wdev_push_promis_misc_buf at ??:?
0x400879a9: r_huart_finish_transfers at ??:?
0x400ea5ed: cnx_csa_fn at ??:?
0x400d2b8d: wifi_softap_deauth at ??:?
0x4008d35d: ieee80211_output_process at ??:?
Rebooting...
Why I am receiving this error only for some custom firmware .bin files (size 1,247,696 bytes)? I have tried also with the original "simple_ota_example" .bin file and the update completes successfully. Could it be caused by the .bin file dimension?
Thank you.
What I have done so far has been to take the original "ble_spp_server" example and add a command listener: if the user sends a specific command via Bluetooth, it activates the WiFi and connects to a HTTP (without SSL) server which contains the new firmware which will be downloaded (I have enabled from the make menuconfig the debug HTTP OTA flag).
The core logic seems to work, but I am receiving the following error while updating some firmwares:
I (3800) esp_https_ota: Starting OTA...
I (3800) esp_https_ota: Writing to partition subtype 17 at offset 0x290000
E (40010) esp_https_ota: Error: esp_ota_write failed! err=0x260
I (40010) esp_image: segment 0: paddr=0x00290020 vaddr=0x3f400020 size=0x374d0 (226512) map
I (40200) esp_image: segment 1: paddr=0x002c74f8 vaddr=0x3ffbdb60 size=0x03768 ( 14184)
I (40220) esp_image: segment 2: paddr=0x002cac68 vaddr=0x40080000 size=0x00400 ( 1024)
0x40080000: _WindowOverflow4 at C:/msys32/home/Riccardo/esp/esp-idf/components/freertos/xtensa_vectors.S:1779
I (40220) esp_image: segment 3: paddr=0x002cb070 vaddr=0x40080400 size=0x04fa0 ( 20384)
I (40240) esp_image: segment 4: paddr=0x002d0018 vaddr=0x400d0018 size=0xdeaf0 (912112) map
0x400d0018: _flash_cache_start at ??:?
E (40980) esp_image: invalid segment length 0xffffffff
CORRUPT HEAP: multi_heap.c:477 detected at 0x3ffc5900
abort() was called at PC 0x4008b52d on core 1
0x4008b52d: r_rwbt_isr at ??:?
ELF file SHA256: ea1a3cc5829e91c03c2535b612168638f17cc0d21668e06348c778959a0fdf69
Backtrace: 0x40087c78:0x3ffc7bb0 0x40087ec5:0x3ffc7bd0 0x4008b52d:0x3ffc7bf0 0x400823ce:0x3ffc7c10 0x400879a9:0x3ffc7c30 0x400ea5ed:0x3
ffc7c50 0x400d2b8d:0x3ffc7c80 0x4008d35d:0x3ffc7cf0
0x40087c78: r_ld_sco_audio_isr at ??:?
0x40087ec5: ld_sco_end at ld_acl.c:?
0x4008b52d: r_rwbt_isr at ??:?
0x400823ce: wdev_push_promis_misc_buf at ??:?
0x400879a9: r_huart_finish_transfers at ??:?
0x400ea5ed: cnx_csa_fn at ??:?
0x400d2b8d: wifi_softap_deauth at ??:?
0x4008d35d: ieee80211_output_process at ??:?
Rebooting...
Why I am receiving this error only for some custom firmware .bin files (size 1,247,696 bytes)? I have tried also with the original "simple_ota_example" .bin file and the update completes successfully. Could it be caused by the .bin file dimension?
Thank you.