I am using esp-idf-v4.4 with some esp-iot-solution components (LVGL and display drivers) on an ESP32 WROOM with 8MB PSRAM enabled. My application is mostly written in C, with some C++. I am using mesh wifi with MQTT (notably, I do not get the double exception when I disable the networking components, though I have not been able to narrow this down more specifically).
I am aware that a Double Exception is the result of an exception occurring within the exception handler, and might be expected to be the result of insufficient stack, or stack corruption.
Accordingly, I have substantially oversized my task stacks. vTaskGetRunTimeStats() indicates I have a >1kB free stack on every task (while operating normally), and >2kB in most cases. My ISR stack is set to 7kB (up from 1.5kB). Further, I am careful in my application not to allocate large chunks of data from the stack. So I am doubtful that the exception is the result of running out of stack (though corruption via overrun is of course still a possibility). I have configured to abort when memory allocation fails (so my exception should not be the result of an unhandled malloc failure), and have heap checking/poisoning set to comprehensive.
Memory is admittedly tight in my application, as I am running mesh wifi, MQTT, LVGL and display drivers, and am storing buffers of data from sensors for processing, however I have >10kB of internal/8bit memory remaining while running normally.
Any suggestions on how to approach locating the source of this fault would be appreciated.
The backtrace of the Double Exception follows:
Code: Select all
Guru Meditation Error: Core 0 panic'ed (Double exception).
Core 0 register dump:
PC : 0x4008d253 PS : 0x00040436 A0 : 0x801f06f2 A1 : 0x3ffd06d0
0x4008d253: _xt_context_save at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/xtensa_context.S:195
A2 : 0x3f403518 A3 : 0x00000804 A4 : 0x0000faf6 A5 : 0x00002af4
A6 : 0x20202020 A7 : 0x09420920 A8 : 0x800d7f80 A9 : 0x3ffd0680
A10 : 0x00000003 A11 : 0x3f403518 A12 : 0x3f403664 A13 : 0x0000faf6
A14 : 0x3f403518 A15 : 0x00002af4 SAR : 0x00000004 EXCCAUSE: 0x00000002
EXCVADDR: 0x0000fae6 LBEG : 0x400014fd LEND : 0x4000150d LCOUNT : 0xfffffffd
Backtrace:0x4008d250:0x3ffd06d00x401f06ef:0x3ffd0960 0x401f06ef:0x09343430 |<-CORRUPTED
0x4008d250: _xt_context_save at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/xtensa/xtensa_context.S:194
0x401f06ef: main_task at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/port_common.c:129 (discriminator 2)
0x401f06ef: main_task at C:/Espressif/frameworks/esp-idf-v4.4/components/freertos/port/port_common.c:129 (discriminator 2)