Page 1 of 1

ESP_HTTPS_OTA failing on large bin files

Posted: Wed Jun 19, 2019 6:06 pm
by QuentinB
Okay, so I have an interesting issue here.

I'm running on Mac OSX 10.14.5 with the ESP32_DevKitC.

I'm just using the ota_example at this point. I've tried and succeeded in flashing the hello_world.bin from the idf examples, but when I try a .bin of the project I'm working on (~1.2MB) the process will start flashing and I'll see successful HTTP transfers, but eventually fail with the following output:

Code: Select all

E (101207) esp_image: invalid segment length 0x456d3133
E (101207) esp_https_ota: Error: esp_ota_write failed! err=0x0
E (101207) simple_ota_example: Firmware upgrade failed
I piped all debug output into a .log file, which I've attached, as its quite long.

Attempts to fix/workaround:
  • Re-built app, after manually checking it flashes normally
  • Imaged .bin file onto device using otatool.py successfully
  • switched from openssl-based dummy server to python-based server

Re: ESP_HTTPS_OTA failing on large bin files

Posted: Sat Jun 22, 2019 11:15 am
by Ritesh
QuentinB wrote:
Wed Jun 19, 2019 6:06 pm
Okay, so I have an interesting issue here.

I'm running on Mac OSX 10.14.5 with the ESP32_DevKitC.

I'm just using the ota_example at this point. I've tried and succeeded in flashing the hello_world.bin from the idf examples, but when I try a .bin of the project I'm working on (~1.2MB) the process will start flashing and I'll see successful HTTP transfers, but eventually fail with the following output:

Code: Select all

E (101207) esp_image: invalid segment length 0x456d3133
E (101207) esp_https_ota: Error: esp_ota_write failed! err=0x0
E (101207) simple_ota_example: Firmware upgrade failed
I piped all debug output into a .log file, which I've attached, as its quite long.

Attempts to fix/workaround:
  • Re-built app, after manually checking it flashes normally
  • Imaged .bin file onto device using otatool.py successfully
  • switched from openssl-based dummy server to python-based server
Hello,

Would you please let me know that are you using custom partition table or default partition table for OTA?

because you image size is higher then 1 MB and at that time you need to use custom partition to keep OTA partition for 1.5 or 2 MB as per your OTA size.

Re: ESP_HTTPS_OTA failing on large bin files

Posted: Mon Jun 24, 2019 5:26 am
by ESP_Mahavir
As Ritesh pointed out, your partition table (from log you shared) is allocating 1M for `ota_x` partitions, you will need to customize partition table and allocate little larger space (per your upgrade binary requirement), that should help to fix the problem.

Thanks.

Re: ESP_HTTPS_OTA failing on large bin files

Posted: Mon Jun 24, 2019 8:24 am
by Ritesh
ESP-MJ wrote:
Mon Jun 24, 2019 5:26 am
As Ritesh pointed out, your partition table (from log you shared) is allocating 1M for `ota_x` partitions, you will need to customize partition table and allocate little larger space (per your upgrade binary requirement), that should help to fix the problem.

Thanks.
Thanks for Reply.

Exactly like that.