Error while trying to update the firmware via OTA

riccardo.brue
Posts: 10
Joined: Fri Jun 21, 2019 1:49 pm

Error while trying to update the firmware via OTA

Postby riccardo.brue » 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.

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Error while trying to update the firmware via OTA

Postby Ritesh » Sat Jun 22, 2019 10:57 am

riccardo.brue wrote:
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.
Hello,

Which ESP32 IDF you are using into your case?

What is partition mechanism into your case? because i have seen that you are writing data at 0x290000 location which seems to be wrong if you have created 1 MB partiton table or have you created your custom partition table for that?

Did you try with 512 KBytes file size and facing same issue? Also did you try same example using WiFi?

Please confirm partition table and OTA mechanism from your end which will be helpful to resolve this issye.
Regards,
Ritesh Prajapati

riccardo.brue
Posts: 10
Joined: Fri Jun 21, 2019 1:49 pm

Re: Error while trying to update the firmware via OTA

Postby riccardo.brue » Mon Jun 24, 2019 6:46 am

I think I have the latest ESP32 IDF (3.0.8).
The partition table is the default "Factory app, two OTA definitions" (0x8000 offset of partition table), and I've changed the serial flasher configuration of the flash size to 8MB.

I've managed to update the firmware with a .bin file of 759 KB (the original "simple_ota_example" example).

Ritesh
Posts: 1383
Joined: Tue Sep 06, 2016 9:37 am
Location: India
Contact:

Re: Error while trying to update the firmware via OTA

Postby Ritesh » Tue Jun 25, 2019 2:01 pm

riccardo.brue wrote:
Mon Jun 24, 2019 6:46 am
I think I have the latest ESP32 IDF (3.0.8).
The partition table is the default "Factory app, two OTA definitions" (0x8000 offset of partition table), and I've changed the serial flasher configuration of the flash size to 8MB.

I've managed to update the firmware with a .bin file of 759 KB (the original "simple_ota_example" example).
Hi,

So, You are facing still issue or it has been resolved?
Regards,
Ritesh Prajapati

Who is online

Users browsing this forum: Bing [Bot] and 182 guests