I have been struggling to get reliable performance with SPI flashing functions . I am using the partition API for both OTA for esp32 and for storing a binary file for another processor. I am transferring the file over wifi TCP socket. The esp32 being the AP and the socket server.
If I just download the file without writing it to flash there are no issues - however as soon as I enable the file to be written - which means I erase the partition and then write and then read back to verify , the program becomes unstable.
While doing OTA - the socket receiving thread seems to sometimes just hang after OTA_Init() - no error messages - sometimes half way through receiving the file it seems to hang - other times it crashes as follows:
Code: Select all
erasing partition<\r><\n>
<27>[0;32mI (27748) flashops: 1<27>[0m<\r><\n>
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.<\r><\n>
Register dump:<\r><\n>
PC : 0x4011b49e PS : 0x00060f33 A0 : 0x80046686 A1 : 0x3ffc0500 <\r><\n>
A2 : 0x00000000 A3 : 0x4011b49c A4 : 0x00000000 A5 : 0x0000000c <\r><\n>
A6 : 0x3ffb93cc A7 : 0x3ffb8360 A8 : 0x80019fb8 A9 : 0x000044c4 <\r><\n>
A10 : 0x00000000 A11 : 0x00000000 A12 : 0x00060d21 A13 : 0x00000022 <\r><\n>
A14 : 0x000023ec A15 : 0x3ffc0640 SAR : 0x00000017 EXCCAUSE: 0x00000000 <\r><\n>
EXCVADDR: 0x00000000 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffc <\r><\n>
<\r><\n>
Backtrace: 0x4011b49e:0x3ffc0500 0x40046686:0x3ffc0530 0x40047518:0x3ffc0550 0x40048536:0x3ffc0570 0x40048675:0x3ffc0590 0x40054ed9:0x3ffc05b0 0x40082482:0x3ffc05d0 0x400810e8:0x3ffc0600<\r><\n>
<\r><\n>
Entering gdb stub now.<\r><\n>
Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled.<\r><\n>
Register dump:<\r><\n>
PC : 0x400d416a PS : 0x00060033 A0 : 0x80085060 A1 : 0x3ffc03a0 <\r><\n>
A2 : 0x3ffc0440 A3 : 0x3ff5f000 A4 : 0x383fc000 A5 : 0x3ff60000 <\r><\n>
A6 : 0x00000000 A7 : 0x383fc000 A8 : 0x80084e8f A9 : 0x3ffc0380 <\r><\n>
A10 : 0x3ffc0600 A11 : 0x3ffc0600 A12 : 0x00000009 A13 : 0x3ffc0400 <\r><\n>
A14 : 0x3ffc1953 A15 : 0x3ffc195c SAR : 0x00000017 EXCCAUSE: 0x00000000 <\r><\n>
EXCVADDR: 0x00000000 LBEG : 0x4000c2e0 LEND : 0x4000c2f6 LCOUNT : 0x00000000 <\r><\n>
<\r><\n>
Backtrace: 0x400d416a:0x3ffc03a0 0x40085060:0x3ffc0420 0x40080e8d:0x3ffc0440 0x4011b49e:0x3ffc0500 0x4011b49e:0x3ffc0530 0x40047518:0x3ffc0550 0x40048536:0x3ffc0570 0x40048675:0x3ffc0590 0x40054ed9:0x3ffc05b0 0x40082482:0x3ffc05d0 0x400810e8:0x3ffc0600<\r><\n>
Also - I believe there is an issue with partition erase if you call it with "NULL" size which is supposed to erase the whole partition.
Thank you
Imtiaz