ayushsharma82 / ElegantOTA

OTA updates made slick and simple for everyone!
https://elegantota.pro
GNU Affero General Public License v3.0
643 stars 119 forks source link

ElegantOTO fails to update large firmware.bin #151

Closed Bromptonaut closed 11 months ago

Bromptonaut commented 11 months ago

ElegantOTO fails to update a firmware.bin with size 1.4 MB on my ESP32-WROVER-E (Lilygo T-SIM7600E). Updating the LittleFS filesystem or updating a smaller firmware.bin works fine. With the bigger file, I get the following message on the terminal:

abort() was called at PC 0x400821e6 on core 1

Backtrace: 0x40083935:0x3ffd35a0 0x4008f6e9:0x3ffd35c0 0x40095051:0x3ffd35e0 0x400821e6:0x3ffd3660 0x4011a8af:0x3ffd36b0 0x4010d421:0x3ffd36d0 0x4019e392:0x3ffd36f0 0x4019e591:0x3ffd3710 0x40109da2:0x3ffd3740 0x400e22fd:0x3ffd37c0 0x401b508e:0x3ffd3820 0x400ddfc2:0x3ffd3850 0x400dfbaa:0x3ffd38d0 0x400dfd4d:0x3ffd3920 0x4019b13a:0x3ffd3940 0x4019b1c9:0x3ffd3970 0x4019ba26:0x3ffd3990

ELF file SHA256: 332567a732f35123

Rebooting...

I guess that the file size is the issue. I could upload a sanitized firmware.bin and littlefs.bin, but they won't run on a board without SD-Card and GSM module, so I am skipping this for now.

Bromptonaut commented 11 months ago

Changing topic to "ElegantOTA fails in combination with platformio / huge_app.csv" after I found out that it seems to be the partition scheme which makes ElegantOTA fail to update the firmware.

This has already been reported here: https://github.com/ayushsharma82/ElegantOTA/issues/100

This is not a bug in ElegantOTA as such, but maybe a lack of documentations as already mentioned in https://github.com/ayushsharma82/ElegantOTA/issues/75. The partition table needs to contain two app partitions for ElegantOTA to work. Instead of huge_app.csv this partition table worked for my 1.4 MB app (on a device with 4 MB flash):

# Name      Type    SubType     Offset      Size    Flags
nvs,        data,   nvs,        0x9000,     0x5000, 
otadata,    data,   ota,            0xe000,     0x2000, 
app0,       app,    ota_0,      0x10000,    0x160000,   
app1,       app,    ota_1,      0x180000,   0x170000,   
spiffs,     data,   spiffs,         0x2F0000,   0x100000,   
coredump,   data,   coredump,   0x3F0000,   0x10000,