Description
Hardware:
Board: ESP32-wroom-32D (custom board)
Core Installation/update date: 1.0.0?
IDE name: Arduino IDE
Flash Frequency: 80Mhz
PSRAM enabled: no
Upload Speed: 115200
Computer OS: Windows 10
Description:
Hi
I have build a simple test program to check the OTA functionality on ESP32. There are 2 versions of a bin fil I download with on integer value different in the two. Both programs start OTA and download the other bin file. If the same bin fil starts after a reset the OTA must have failed somehow. I also have a timer that restarts the MCU after 5 minutes.
After running the program over the weekend I have 6722 successful OTA and 162 fails. 2.4% fail rate. There is a few instances (<5) where the MCU simply freeze and do the restart failsafe kicks in. But the most of the failures there is a LoadStoreError. The full exception you can find bellow.
Do anyone else have this problem? Any solutions?
Sketch:
Update.onProgress(OnProgress);
ESPhttpUpdate.rebootOnUpdate(false);
t_httpUpdate_return ret = ESPhttpUpdate.update(bin);
switch (ret) {
case HTTP_UPDATE_FAILED:
Serial.printf("HTTP_UPDATE_FAILD Error (%d): %s", ESPhttpUpdate.getLastError(), ESPhttpUpdate.getLastErrorString().c_str());
vTaskDelay(1000);
ESP.restart();
break;
case HTTP_UPDATE_NO_UPDATES:
Serial.println("HTTP_UPDATE_NO_UPDATES");
vTaskDelay(1000);
ESP.restart();
break;
case HTTP_UPDATE_OK:
Serial.println("HTTP_UPDATE_OK");
vTaskDelay(1000);
ESP.restart();
break;
}
Debug Messages:
Guru Meditation Error: Core 1 panic'ed (LoadStoreError). Exception was unhandled.
Core 1 register dump:
PC : 0x400d8f3c PS : 0x00060930 A0 : 0x800d8fdc A1 : 0x3ffb1d00
A2 : 0x3ffbc01c A3 : 0x3ffb1d4f A4 : 0x00000001 A5 : 0x40000000
A6 : 0x00043814 A7 : 0x04d8e925 A8 : 0x00000000 A9 : 0xffffffff
A10 : 0x00000000 A11 : 0x3ffbc7ec A12 : 0x00000050 A13 : 0x3ffb1c10
A14 : 0x00000000 A15 : 0x00000000 SAR : 0x0000000a EXCCAUSE: 0x00000003
EXCVADDR: 0x40000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0xffffffff
Decoding 12 results
0x400d8f3c: WiFiClientRxBuffer::read(unsigned char*, unsigned int) at C:\Users\test\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi\src/WiFiClient.cpp line 507
0x400d8fd9: WiFiClientRxBuffer::read(unsigned char*, unsigned int) at C:\Users\test\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi\src/WiFiClient.cpp line 507
0x40161442: WiFiClient::operator bool() at C:\Users\test\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\WiFi\src/WiFiClient.cpp line 507
0x400db219: Print::println(int, int) at C:\Users\test\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.0\cores\esp32/Print.cpp line 227
0x400db245: Stream::timedRead() at C:\Users\test\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.0\cores\esp32/Stream.cpp line 279
0x400d8bb2: UpdateClass::writeStream(Stream&) at C:\Users\test\AppData\Local\arduino15\packages\esp32\hardware\esp32\1.0.0\libraries\Update\src/Updater.cpp line 308 (discriminator 2)
0x400da391: ESP32HTTPUpdate::runUpdate(Stream&, unsigned int, String, int) at C:\Program Files (x86)\Arduino\libraries\esp32-http-update\src/ESP32httpUpdate.cpp line 33
0x400da713: ESP32HTTPUpdate::handleUpdate(HTTPClient&, String const&, bool) at C:\Program Files (x86)\Arduino\libraries\esp32-http-update\src/ESP32httpUpdate.cpp line 33
0x400da896: ESP32HTTPUpdate::update(String const&, String const&) at C:\Program Files (x86)\Arduino\libraries\esp32-http-update\src/ESP32httpUpdate.cpp line 33
0x400d202e: SimpleOta(char const*, char const*) at C:\atechcomp\OneDrive - atechcomp.no\SW\Arduino\ota_test/ButtonHandling.ino line 47
0x400d234d: setup() at C:\atechcomp\OneDrive - atechcomp.no\SW\Arduino\ota_test/ButtonHandling.ino line 47
0x40145f7f: _GLOBAL__sub_I__ZNSt12ctype_bynameIwEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj at /builds/idf/crosstool-NG/.build/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/libstdc++-v3/include/bits/locale_facets_nonio.h line 754
: (inlined by) _GLOBAL__sub_I__ZNSt12ctype_bynameIwEC2ERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEj at /builds/idf/crosstool-NG/.build/src/gcc-5.2.0/libstdc++-v3/src/c++11/locale-inst.cc line 380
Activity
me-no-dev commentedon Dec 18, 2018
which version of the core are you running?
poengAlex commentedon Dec 19, 2018
How can I check that? It looks like I have 1.0.0
joseitor commentedon Dec 19, 2018
I got a similar error
But it happens to me all the time, and I code is just the example code introduccing my SSID, PASSWORD and URL where the .bin file is.
Thanks!
nikuz commentedon Dec 31, 2018
https://github.com/espressif/arduino-esp32/tree/master/libraries/Update/examples/AWS_S3_OTA_Update
https://github.com/espressif/arduino-esp32/blob/master/libraries/HTTPUpdate/examples/httpUpdate/httpUpdate.ino
Looks like it always related to the WiFiClientRxBuffer::read.
stickbreaker commentedon Dec 31, 2018
LoadStoreFailure is a Buffer location error, the referenced data location is not within the Cpu's RAM. Set Core Debug Level to ERROR or WARNING and rerun your test. See if the RAM allocation error is listed in the console log.
Chuck.
nikuz commentedon Dec 31, 2018
@stickbreaker I have tried it already. There were nothing in terminal output. I have tried those both debug levels.
stickbreaker commentedon Dec 31, 2018
@nikuz Reading through HttpClient. it looks like it is a heap fragmentation error.
Strings
are used extensively.Try adding a heapfree call before and after the update()
Chuck.
atanisoft commentedon Dec 31, 2018
String and Stream both had a few bugs in them when exactly 64 bytes was printed, these were fixed on master a week or so ago. There may be other heap leaks in there still though.
nikuz commentedon Dec 31, 2018
@stickbreaker same behaviour even with the heapfree call. I have added the additional log for progress monitoring. Looks like LoadStoreError always happens on the 237568 bytes of stream download. I have tried to update to two different *.bin sketches, which has a not the same size..
nikuz commentedon Dec 31, 2018
One time I got this error with debug log ERROR enabled, right before LoadStoreError:
nikuz commentedon Dec 31, 2018
Sometimes updates happens. I'll check, maybe something wrong in my environment. Maybe I'll move the update file somewhere closer to the esp itself.
lbernstone commentedon Dec 31, 2018
I am able to reproduce with a minimal sketch. I'll dig in and take a look.
Monitor:
lbernstone commentedon Dec 31, 2018
Looks like @Jeroen88 has been working on HTTPUpdate. Looping him in.
nikuz commentedon Jan 1, 2019
HTTPUpdate works just fine if I'm doing update from my local network.
22 remaining items