You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Name, Type, SubType, Offset, Size, Flags
# Note: if you change the phy_init or app partition offset, make sure to change the offset in Kconfig.projbuild
nvs, data, nvs, , 0x4000,
otadata, data, ota, , 0x2000,
phy_init, data, phy, , 0x1000,
coredump, data, coredump,, 2M
factory, app, factory, , 4M,
ota_0, app, ota_0, , 3M,
ota_1, app, ota_1, , 3M,
When I build the code after this I get the following error
/home/dozee/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: dozee_next.elf section `.iram0.text' will not fit in region `iram0_0_seg'
/home/dozee/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: IRAM0 segment data does not fit.
/home/dozee/.espressif/tools/xtensa-esp32-elf/esp-2020r3-8.4.0/xtensa-esp32-elf/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld: region `iram0_0_seg' overflowed by 1056 bytes
I changed the setting in idf.py menuconfigCompiler options --> Optimization level from Debug (-0g) to Optimize for size (-0s) after which I am able to build the project. However when the firmware is flashed, the device seems to crash with the following message printed
My first issue is that I am not able to debug anything from the backtrace using the command xtensa-esp32-elf-addr2line -pfiaC -e build/dozee_next.elf Backtrace:0x400803bd:0x3ffb44b0. However if I enable Print coredump to UART, and decode the ELF content I get the following output
espcoredump.py v0.4-dev
===============================================================
==================== ESP32 CORE DUMP START ====================
Crashed task handle: 0x3ffb4590, name: 'usbserial', GDB name: 'process 1073431952'
================== CURRENT THREAD REGISTERS ===================
exccause 0x41 (DebugException)
excvaddr 0xffffffe0
epc1 0x4019e38e
epc2 0x0
epc3 0x0
epc4 0x0
epc5 0x400803c0
epc6 0x0
epc7 0x0
eps2 0x60320
eps3 0x0
eps4 0x0
eps5 0x0
eps6 0x60130
eps7 0x40090ed4
pc 0x400803c0 0x400803c0 <_DoubleExceptionVector>
lbeg 0x400013f9 1073746937
lend 0x4000140d 1073746957
lcount 0xfffffffa 4294967290
sar 0x4 4
ps 0x60126 393510
threadptr <unavailable>
br <unavailable>
scompare1 <unavailable>
acclo <unavailable>
acchi <unavailable>
m0 <unavailable>
m1 <unavailable>
m2 <unavailable>
m3 <unavailable>
expstate <unavailable>
f64r_lo <unavailable>
f64r_hi <unavailable>
f64s <unavailable>
fcr <unavailable>
fsr <unavailable>
a0 0x0 0
a1 0x3ffb44b0 1073431728
a2 0x3ffca794 1073522580
a3 0x3ffc6ae8 1073507048
a4 0x3ffc85bc 1073513916
a5 0x0 0
a6 0x0 0
a7 0x0 0
a8 0x800e7e64 -2146533788
a9 0x3ffb4050 1073430608
a10 0x3ffb4270 1073431152
a11 0x3ffb4468 1073431656
a12 0x3ffb4070 1073430640
a13 0x3ffca9ec 1073523180
a14 0x3ffb4070 1073430640
a15 0x3ffb439c 1073431452
==================== CURRENT THREAD STACK =====================
#0 _DoubleExceptionVector () at /home/dozee/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:455
======================== THREADS INFO =========================
Id Target Id Frame
* 1 process 1073431952 _DoubleExceptionVector () at /home/dozee/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:455
2 process 1073624740 0x40092769 in xQueueSemaphoreTake (xQueue=0x3ffd34f8, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
3 process 1073466980 0x4019e38e in esp_pm_impl_waiti () at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:183
4 process 1073468372 0x4019e38e in esp_pm_impl_waiti () at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:183
5 process 1073436048 0x40092636 in xQueueReceive (xQueue=0x3ffb48b4, pvBuffer=0x3ffb54f0, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
6 process 1073568072 vTaskDelay (xTicksToDelay=1000) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:1530
7 process 1073605220 vTaskDelay (xTicksToDelay=1000) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:1530
8 process 1073625104 vTaskDelay (xTicksToDelay=2000) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:1530
9 process 1073609684 vTaskDelay (xTicksToDelay=15000) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:1530
10 process 1073468736 0x400947e8 in prvProcessTimerOrBlockTask (xListWasEmpty=<optimized out>, xNextExpireTime=0) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
11 process 1073445592 0x40092769 in xQueueSemaphoreTake (xQueue=0x3ffb767c, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
12 process 1073689732 0x40092769 in xQueueSemaphoreTake (xQueue=0x3fff2978, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
13 process 1073696544 0x40092769 in xQueueSemaphoreTake (xQueue=0x3fff3c14, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
14 process 1073684868 0x40092769 in xQueueSemaphoreTake (xQueue=0x3fff1278, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
15 process 1073437856 0x40092636 in xQueueReceive (xQueue=0x3ffb57f0, pvBuffer=0x3ffd9680, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
16 process 1073443936 0x40092769 in xQueueSemaphoreTake (xQueue=0x3ffb7004, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
17 process 1073439136 0x40092636 in xQueueReceive (xQueue=0x3ffd9750, pvBuffer=0x3ffdab50, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
18 process 1073626508 0x40092636 in xQueueReceive (xQueue=0x3ffe3d2c, pvBuffer=0x3fff0ab0, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
19 process 1073446116 0x4000bff0 in ?? ()
==================== THREAD 1 (TCB: 0x3ffb4590, name: 'usbserial') =====================
#0 _DoubleExceptionVector () at /home/dozee/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:455
==================== THREAD 2 (TCB: 0x3ffe36a4, name: 'taskRecordingManager') =====================
#0 0x40092769 in xQueueSemaphoreTake (xQueue=0x3ffd34f8, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x4008fe87 in prvReceiveGeneric (pxRingbuffer=0x3ffd3468, pvItem1=0x3ffe32f4, pvItem2=0x0, xItemSize1=0x3ffe32f0, xItemSize2=0x0, xMaxSize=0, xTicksToWait=xTicksToWait@entry=1) at /home/dozee/esp/esp-idf/components/esp_ringbuf/ringbuf.c:749
#2 0x40090186 in xRingbufferReceive (xRingbuffer=0x3ffd3468, pxItemSize=0x3ffe3320, xTicksToWait=1) at /home/dozee/esp/esp-idf/components/esp_ringbuf/ringbuf.c:1105
#3 0x400d7180 in uart_read_bytes (uart_num=2, buf=0x3ffe3590, length=2, ticks_to_wait=1) at /home/dozee/esp/esp-idf/components/driver/uart.c:1206
#4 0x400defb2 in taskRecordingManager (args=<optimized out>) at /home/dozee/Dozee/Git-Repos/dozeeVSPro/main/recording_manager.c:613
==================== THREAD 3 (TCB: 0x3ffbce64, name: 'IDLE') =====================
#0 0x4019e38e in esp_pm_impl_waiti () at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:183
#1 0x400d86c0 in esp_vApplicationIdleHook () at /home/dozee/esp/esp-idf/components/esp_common/src/freertos_hooks.c:63
#2 0x40092b9f in prvIdleTask (pvParameters=<optimized out>) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:3839
==================== THREAD 4 (TCB: 0x3ffbd3d4, name: 'IDLE') =====================
#0 0x4019e38e in esp_pm_impl_waiti () at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:183
#1 0x400d86c0 in esp_vApplicationIdleHook () at /home/dozee/esp/esp-idf/components/esp_common/src/freertos_hooks.c:63
#2 0x40092b9f in prvIdleTask (pvParameters=<optimized out>) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:3839
==================== THREAD 5 (TCB: 0x3ffb5590, name: 'tiT') =====================
#0 0x40092636 in xQueueReceive (xQueue=0x3ffb48b4, pvBuffer=0x3ffb54f0, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x40098901 in sys_arch_mbox_fetch (mbox=<optimized out>, msg=0x3ffb54f0, timeout=500) at /home/dozee/esp/esp-idf/components/lwip/port/esp32/freertos/sys_arch.c:325
#2 0x40098ac2 in tcpip_timeouts_mbox_fetch (mbox=0x3ffc958c <tcpip_mbox>, msg=<optimized out>) at /home/dozee/esp/esp-idf/components/lwip/lwip/src/api/tcpip.c:110
#3 tcpip_thread (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/lwip/lwip/src/api/tcpip.c:148
==================== THREAD 6 (TCB: 0x3ffd5948, name: 'task_led') =====================
#0 vTaskDelay (xTicksToDelay=1000) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:1530
#1 0x400dc2f0 in task_led () at /home/dozee/Dozee/Git-Repos/dozeeVSPro/main/led.c:324
==================== THREAD 7 (TCB: 0x3ffdea64, name: 'SupervisorTask') =====================
#0 vTaskDelay (xTicksToDelay=1000) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:1530
#1 0x400e4a36 in TaskSupervisor (args=<optimized out>) at /home/dozee/Dozee/Git-Repos/dozeeVSPro/main/supervisor_manager.c:342
==================== THREAD 8 (TCB: 0x3ffe3810, name: 'task_gzip') =====================
#0 vTaskDelay (xTicksToDelay=2000) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:1530
#1 0x400db838 in taskGzipManager (args=<optimized out>) at /home/dozee/Dozee/Git-Repos/dozeeVSPro/main/gzip_manager.c:221
==================== THREAD 9 (TCB: 0x3ffdfbd4, name: 'taskUploadManager') =====================
#0 vTaskDelay (xTicksToDelay=15000) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:1530
#1 0x400e4e23 in taskUploadManager (args=<optimized out>) at /home/dozee/Dozee/Git-Repos/dozeeVSPro/main/upload_manager.c:224
==================== THREAD 10 (TCB: 0x3ffbd540, name: 'Tmr Svc') =====================
#0 0x400947e8 in prvProcessTimerOrBlockTask (xListWasEmpty=<optimized out>, xNextExpireTime=0) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 prvTimerTask (pvParameters=<optimized out>) at /home/dozee/esp/esp-idf/components/freertos/timers.c:555
==================== THREAD 11 (TCB: 0x3ffb7ad8, name: 'ipc1') =====================
#0 0x40092769 in xQueueSemaphoreTake (xQueue=0x3ffb767c, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x40089de5 in ipc_task (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/esp_ipc/ipc.c:51
==================== THREAD 12 (TCB: 0x3fff3484, name: 'hciT') =====================
#0 0x40092769 in xQueueSemaphoreTake (xQueue=0x3fff2978, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x40103664 in osi_sem_take (sem=0x3fff26ec, timeout=4294967295) at /home/dozee/esp/esp-idf/components/bt/common/osi/semaphore.c:60
#2 0x4010338b in osi_thread_run (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/bt/common/osi/thread.c:59
==================== THREAD 13 (TCB: 0x3fff4f20, name: 'BTU_TASK') =====================
#0 0x40092769 in xQueueSemaphoreTake (xQueue=0x3fff3c14, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x40103664 in osi_sem_take (sem=0x3fff3ac0, timeout=4294967295) at /home/dozee/esp/esp-idf/components/bt/common/osi/semaphore.c:60
#2 0x4010338b in osi_thread_run (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/bt/common/osi/thread.c:59
==================== THREAD 14 (TCB: 0x3fff2184, name: 'BTC_TASK') =====================
#0 0x40092769 in xQueueSemaphoreTake (xQueue=0x3fff1278, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x40103664 in osi_sem_take (sem=0x3fff0fec, timeout=4294967295) at /home/dozee/esp/esp-idf/components/bt/common/osi/semaphore.c:60
#2 0x4010338b in osi_thread_run (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/bt/common/osi/thread.c:59
==================== THREAD 15 (TCB: 0x3ffb5ca0, name: 'sys_evt') =====================
#0 0x40092636 in xQueueReceive (xQueue=0x3ffb57f0, pvBuffer=0x3ffd9680, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x401a3fac in esp_event_loop_run (event_loop=0x3ffb57d4, ticks_to_run=4294967295) at /home/dozee/esp/esp-idf/components/esp_event/esp_event.c:624
#2 0x401a411d in esp_event_loop_run_task (args=0x3ffb57d4) at /home/dozee/esp/esp-idf/components/esp_event/esp_event.c:115
==================== THREAD 16 (TCB: 0x3ffb7460, name: 'ipc0') =====================
#0 0x40092769 in xQueueSemaphoreTake (xQueue=0x3ffb7004, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x40089de5 in ipc_task (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/esp_ipc/ipc.c:51
==================== THREAD 17 (TCB: 0x3ffb61a0, name: 'wifi') =====================
#0 0x40092636 in xQueueReceive (xQueue=0x3ffd9750, pvBuffer=0x3ffdab50, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x400d57bc in queue_recv_wrapper (queue=0x3ffd9750, item=0x3ffdab50, block_time_tick=4294967295) at /home/dozee/esp/esp-idf/components/esp_wifi/esp32/esp_adapter.c:374
#2 0x4009b86c in ppTask () at /home/dozee/esp/esp-idf/components/esp_common/src/freertos_hooks.c:39
==================== THREAD 18 (TCB: 0x3ffe3d8c, name: 'btController') =====================
#0 0x40092636 in xQueueReceive (xQueue=0x3ffe3d2c, pvBuffer=0x3fff0ab0, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x400f068c in queue_recv_wrapper (queue=0x3ffe3d2c, item=0x3fff0ab0, block_time_ms=4294967295) at /home/dozee/esp/esp-idf/components/bt/controller/esp32/bt.c:768
#2 0x40111759 in btdm_controller_task () at /home/dozee/esp/esp-idf/components/esp_ipc/ipc.c:64
==================== THREAD 19 (TCB: 0x3ffb7ce4, name: 'esp_timer') =====================
#0 0x4000bff0 in ?? ()
#1 0x40094b16 in vPortExitCritical (mux=<optimized out>) at /home/dozee/esp/esp-idf/components/freertos/port/xtensa/port.c:472
#2 0x4009412f in ulTaskNotifyTake (xClearCountOnExit=1, xTicksToWait=4294967295) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:5203
#3 0x400d87a6 in timer_task (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/esp_timer/src/esp_timer.c:347
======================= ALL MEMORY REGIONS ========================
Name Address Size Attrs
.rtc.text 0x400c0000 0x0 RW
.rtc.dummy 0x3ff80000 0x0 RW
.rtc.force_fast 0x3ff80000 0x0 RW
.rtc.data 0x50000000 0x10 RW A
.rtc_noinit 0x50000010 0x0 RW
.rtc.force_slow 0x50000010 0x0 RW
.iram0.vectors 0x40080000 0x403 R XA
.iram0.text 0x40080404 0x1dc13 R XA
.dram0.data 0x3ffbdb60 0x518c RW A
.noinit 0x3ffc2cec 0x0 RW
.ext_ram.bss 0x3f800000 0x0 RW
.flash.rodata 0x3f400020 0x28a9c RW A
.flash.text 0x400d0020 0xd8873 R XA
.iram0.data 0x4009e018 0x0 RW
.iram0.bss 0x4009e018 0x0 RW
.dram0.heap_start 0x3ffd0a18 0x0 RW
.coredump.tasks.data 0x3ffb4590 0x168 RW
.coredump.tasks.data 0x3ffb43f0 0x198 RW
.coredump.tasks.data 0x3ffe36a4 0x168 RW
.coredump.tasks.data 0x3ffe3190 0x50c RW
.coredump.tasks.data 0x3ffbce64 0x168 RW
.coredump.tasks.data 0x3ffbccd0 0x18c RW
.coredump.tasks.data 0x3ffbd3d4 0x168 RW
.coredump.tasks.data 0x3ffbd240 0x18c RW
.coredump.tasks.data 0x3ffb5590 0x168 RW
.coredump.tasks.data 0x3ffb53c0 0x1c8 RW
.coredump.tasks.data 0x3ffd5948 0x168 RW
.coredump.tasks.data 0x3ffd57d0 0x170 RW
.coredump.tasks.data 0x3ffdea64 0x168 RW
.coredump.tasks.data 0x3ffde850 0x20c RW
.coredump.tasks.data 0x3ffe3810 0x168 RW
.coredump.tasks.data 0x3ffeda20 0x230 RW
.coredump.tasks.data 0x3ffdfbd4 0x168 RW
.coredump.tasks.data 0x3ffdf9d0 0x1fc RW
.coredump.tasks.data 0x3ffbd540 0x168 RW
.coredump.tasks.data 0x3ffd1720 0x150 RW
.coredump.tasks.data 0x3ffb7ad8 0x168 RW
.coredump.tasks.data 0x3ffb7950 0x180 RW
.coredump.tasks.data 0x3fff3484 0x168 RW
.coredump.tasks.data 0x3fff32d0 0x1ac RW
.coredump.tasks.data 0x3fff4f20 0x168 RW
.coredump.tasks.data 0x3fff4d70 0x1a8 RW
.coredump.tasks.data 0x3fff2184 0x168 RW
.coredump.tasks.data 0x3fff1fd0 0x1ac RW
.coredump.tasks.data 0x3ffb5ca0 0x168 RW
.coredump.tasks.data 0x3ffd9570 0x1d8 RW
.coredump.tasks.data 0x3ffb7460 0x168 RW
.coredump.tasks.data 0x3ffb72d0 0x188 RW
.coredump.tasks.data 0x3ffb61a0 0x168 RW
.coredump.tasks.data 0x3ffdaa30 0x1b4 RW
.coredump.tasks.data 0x3ffe3d8c 0x168 RW
.coredump.tasks.data 0x3fff0990 0x1bc RW
.coredump.tasks.data 0x3ffb7ce4 0x168 RW
.coredump.tasks.data 0x3ffbb0d0 0x1a8 RW
===================== ESP32 CORE DUMP END =====================
===============================================================
Done!
This is the first problem, the code is crashing when compiled with Compiler option = Optimize for size and I am not able to understand what the problem could be causing #0 _DoubleExceptionVector () at /home/dozee/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:455
The second problem I am facing is that, when I decode the Core Dump printed to UART and cross check with the Backtrace printed in serial logs before ESP32 reboots, they do not match
I put an assert(0) in my code as mentioned in the example of the coredump documentation with coredump printed to UART. The serial logs obtained are as below
The backtrace printed in the logs above is Backtrace:0x40084242:0x3ffbc590 0x40084935:0x3ffbc5b0 0x40089a1e:0x3ffbc5d0 0x400d2915:0x3ffbc640 0x400e3136:0x3ffbc860 but the backtrace from the current thread stack in the decoded ELF text does not match the backtrace in the logs
When I decode the coredump ELF text I get the following output
espcoredump.py v0.4-dev
===============================================================
==================== ESP32 CORE DUMP START ====================
Crashed task handle: 0x3ffbc8f4, name: 'main', GDB name: 'process 1073465588'
================== CURRENT THREAD REGISTERS ===================
exccause 0x1d (StoreProhibitedCause)
excvaddr 0x0
epc1 0x0
epc2 0x0
epc3 0x0
epc4 0x0
epc5 0x0
epc6 0x0
epc7 0x0
eps2 0x0
eps3 0x0
eps4 0x0
eps5 0x0
eps6 0x0
eps7 0x40084c68
pc 0x40084245 0x40084245 <panic_abort+21>
lbeg 0x4000c349 1073791817
lend 0x4000c36b 1073791851
lcount 0x0 0
sar 0x10 16
ps 0x60d20 396576
threadptr <unavailable>
br <unavailable>
scompare1 <unavailable>
acclo <unavailable>
acchi <unavailable>
m0 <unavailable>
m1 <unavailable>
m2 <unavailable>
m3 <unavailable>
expstate <unavailable>
f64r_lo <unavailable>
f64r_hi <unavailable>
f64s <unavailable>
fcr <unavailable>
fsr <unavailable>
a0 0x80084938 -2146940616
a1 0x3ffbc590 1073464720
a2 0x3ffbc5d0 1073464784
a3 0x3ffbc5fd 1073464829
a4 0xa 10
a5 0x3ffb6c40 1073441856
a6 0x0 0
a7 0x0 0
a8 0x0 0
a9 0x1 1
a10 0x3ffbc61d 1073464861
a11 0x3ffbc61d 1073464861
a12 0x0 0
a13 0x80 128
a14 0x1 1
a15 0x0 0
==================== CURRENT THREAD STACK =====================
#0 0x40084245 in panic_abort (details=0x3ffbc5d0 \"abort() was called at PC 0x400d2915 on core 0\") at /home/dozee/esp/esp-idf/components/esp_system/panic.c:367
#1 0x40084938 in esp_system_abort (details=0x3ffbc5d0 \"abort() was called at PC 0x400d2915 on core 0\") at /home/dozee/esp/esp-idf/components/esp_system/system_api.c:112
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
======================== THREADS INFO =========================
Id Target Id Frame
* 1 process 1073465588 0x40084245 in panic_abort (details=0x3ffbc5d0 \"abort() was called at PC 0x400d2915 on core 0\") at /home/dozee/esp/esp-idf/components/esp_system/panic.c:367
2 process 1073466980 0x400e2c82 in esp_pm_impl_waiti () at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:183
3 process 1073468372 0x400e2c82 in esp_pm_impl_waiti () at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:183
4 process 1073443936 0x4008631d in xQueueSemaphoreTake (xQueue=0x3ffb7004, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
5 process 1073446116 0x4000bff0 in ?? ()
6 process 1073468736 0x40087d94 in prvProcessTimerOrBlockTask (xListWasEmpty=<optimized out>, xNextExpireTime=0) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
7 process 1073445592 0x4008372c in esp_crosscore_int_send_yield (core_id=1) at /home/dozee/esp/esp-idf/components/esp32/crosscore_int.c:112
==================== THREAD 1 (TCB: 0x3ffbc8f4, name: 'main') =====================
#0 0x40084245 in panic_abort (details=0x3ffbc5d0 \"abort() was called at PC 0x400d2915 on core 0\") at /home/dozee/esp/esp-idf/components/esp_system/panic.c:367
#1 0x40084938 in esp_system_abort (details=0x3ffbc5d0 \"abort() was called at PC 0x400d2915 on core 0\") at /home/dozee/esp/esp-idf/components/esp_system/system_api.c:112
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
==================== THREAD 2 (TCB: 0x3ffbce64, name: 'IDLE') =====================
#0 0x400e2c82 in esp_pm_impl_waiti () at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:183
#1 0x400d21e5 in esp_vApplicationIdleHook () at /home/dozee/esp/esp-idf/components/esp_common/src/freertos_hooks.c:63
#2 0x400866e8 in prvIdleTask (pvParameters=<optimized out>) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:3839
==================== THREAD 3 (TCB: 0x3ffbd3d4, name: 'IDLE') =====================
#0 0x400e2c82 in esp_pm_impl_waiti () at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:183
#1 0x400d21e5 in esp_vApplicationIdleHook () at /home/dozee/esp/esp-idf/components/esp_common/src/freertos_hooks.c:63
#2 0x400866e8 in prvIdleTask (pvParameters=<optimized out>) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:3839
==================== THREAD 4 (TCB: 0x3ffb7460, name: 'ipc0') =====================
#0 0x4008631d in xQueueSemaphoreTake (xQueue=0x3ffb7004, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 0x400828c5 in ipc_task (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/esp_ipc/ipc.c:51
==================== THREAD 5 (TCB: 0x3ffb7ce4, name: 'esp_timer') =====================
#0 0x4000bff0 in ?? ()
#1 0x400880c2 in vPortExitCritical (mux=<optimized out>) at /home/dozee/esp/esp-idf/components/freertos/port/xtensa/port.c:472
#2 0x400877e7 in ulTaskNotifyTake (xClearCountOnExit=1, xTicksToWait=4294967295) at /home/dozee/esp/esp-idf/components/freertos/tasks.c:5203
#3 0x400d229a in timer_task (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/esp_timer/src/esp_timer.c:347
==================== THREAD 6 (TCB: 0x3ffbd540, name: 'Tmr Svc') =====================
#0 0x40087d94 in prvProcessTimerOrBlockTask (xListWasEmpty=<optimized out>, xNextExpireTime=0) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#1 prvTimerTask (pvParameters=<optimized out>) at /home/dozee/esp/esp-idf/components/freertos/timers.c:555
==================== THREAD 7 (TCB: 0x3ffb7ad8, name: 'ipc1') =====================
#0 0x4008372c in esp_crosscore_int_send_yield (core_id=1) at /home/dozee/esp/esp-idf/components/esp32/crosscore_int.c:112
#1 0x4008631d in xQueueSemaphoreTake (xQueue=0x3ffb767c, xTicksToWait=<optimized out>) at /home/dozee/esp/esp-idf/components/hal/esp32/include/hal/cpu_ll.h:39
#2 0x400828c5 in ipc_task (arg=<optimized out>) at /home/dozee/esp/esp-idf/components/esp_ipc/ipc.c:51
======================= ALL MEMORY REGIONS ========================
Name Address Size Attrs
.rtc.text 0x400c0000 0x0 RW
.rtc.dummy 0x3ff80000 0x0 RW
.rtc.force_fast 0x3ff80000 0x0 RW
.rtc.data 0x50000000 0x10 RW A
.rtc_noinit 0x50000010 0x0 RW
.rtc.force_slow 0x50000010 0x0 RW
.iram0.vectors 0x40080000 0x403 R XA
.iram0.text 0x40080404 0xa3fb R XA
.dram0.data 0x3ffbdb60 0x259c RW A
.noinit 0x3ffc00fc 0x0 RW
.ext_ram.bss 0x3f800000 0x0 RW
.flash.rodata 0x3f400020 0x2388 RW A
.flash.text 0x400d0020 0x13213 R XA
.iram0.data 0x4008a800 0x0 RW
.iram0.bss 0x4008a800 0x0 RW
.dram0.heap_start 0x3ffc0e18 0x0 RW
.coredump.tasks.data 0x3ffbc8f4 0x168 RW
.coredump.tasks.data 0x3ffbc4d0 0x41c RW
.coredump.tasks.data 0x3ffbce64 0x168 RW
.coredump.tasks.data 0x3ffbccd0 0x18c RW
.coredump.tasks.data 0x3ffbd3d4 0x168 RW
.coredump.tasks.data 0x3ffbd240 0x18c RW
.coredump.tasks.data 0x3ffb7460 0x168 RW
.coredump.tasks.data 0x3ffb72d0 0x188 RW
.coredump.tasks.data 0x3ffb7ce4 0x168 RW
.coredump.tasks.data 0x3ffbb0d0 0x1a8 RW
.coredump.tasks.data 0x3ffbd540 0x168 RW
.coredump.tasks.data 0x3ffc1b20 0x150 RW
.coredump.tasks.data 0x3ffb7ad8 0x168 RW
.coredump.tasks.data 0x3ffb7930 0x1a0 RW
===================== ESP32 CORE DUMP END =====================
===============================================================
Done!
Can someone please help me with the above issues or tell another method to capture the backtrace?
The text was updated successfully, but these errors were encountered:
github-actionsbot
changed the title
Regarding storing backtrace and retriving during reboot
Regarding storing backtrace and retriving during reboot (IDFGH-12137)
Feb 16, 2024
but the backtrace from the current thread stack in the decoded ELF text does not match the backtrace in the logs
This issue has been fixed in IDF v4.4.x and later (#6124), please try updating to a new version.
This is the first problem, the code is crashing when compiled with Compiler option = Optimize for size and I am not able to understand what the problem could be causing #0 _DoubleExceptionVector () at /home/dozee/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:455
I recommend checking the stack size of your usbserial task, it could be that you are overflowing the stack, which leads to heap corruption and the subsequent crash inside the scheduler.
Answers checklist.
General issue report
I want to be able to store the backtrace in someway --> retrieve it during a reboot --> write to a file --> upload to the cloud
I am using ESP-IDF v4.3
In trying to do this, I have faced 2 issues.
I followed the steps in the CoreDump Documentation and created the partition as below
When I build the code after this I get the following error
I changed the setting in
idf.py menuconfig
Compiler options --> Optimization level
fromDebug (-0g)
toOptimize for size (-0s)
after which I am able to build the project. However when the firmware is flashed, the device seems to crash with the following message printedMy first issue is that I am not able to debug anything from the backtrace using the command
xtensa-esp32-elf-addr2line -pfiaC -e build/dozee_next.elf Backtrace:0x400803bd:0x3ffb44b0
. However if I enablePrint coredump to UART
, and decode the ELF content I get the following outputThis is the first problem, the code is crashing when compiled with
Compiler option = Optimize for size
and I am not able to understand what the problem could be causing#0 _DoubleExceptionVector () at /home/dozee/esp/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:455
The second problem I am facing is that, when I decode the Core Dump printed to UART and cross check with the Backtrace printed in serial logs before ESP32 reboots, they do not match
I put an
assert(0)
in my code as mentioned in the example of the coredump documentation with coredump printed to UART. The serial logs obtained are as belowThe backtrace printed in the logs above is
Backtrace:0x40084242:0x3ffbc590 0x40084935:0x3ffbc5b0 0x40089a1e:0x3ffbc5d0 0x400d2915:0x3ffbc640 0x400e3136:0x3ffbc860
but the backtrace from the current thread stack in the decoded ELF text does not match the backtrace in the logsWhen I decode the coredump ELF text I get the following output
Can someone please help me with the above issues or tell another method to capture the backtrace?
The text was updated successfully, but these errors were encountered: