espressif / esp-idf

Espressif IoT Development Framework. Official development framework for Espressif SoCs.
Apache License 2.0
13.7k stars 7.3k forks source link

Regarding storing backtrace and retriving during reboot (IDFGH-12137) #13193

Open sett-dozee opened 8 months ago

sett-dozee commented 8 months ago

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

# 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 menuconfig Compiler 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

Guru Meditation Error: Core  0 panic'ed (Unhandled debug exception). 
Debug exception reason: BREAK instr 
Core  0 register dump:
PC      : 0x400803c0  PS      : 0x00060336  A0      : 0x00000000  A1      : 0x3ffb44b0  
A2      : 0x3ffca734  A3      : 0x3ffc6a88  A4      : 0x3ffc855c  A5      : 0x00000000  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x800e7e64  A9      : 0x3ffb4050  
A10     : 0x3ffb4270  A11     : 0x3ffb4468  A12     : 0x3ffb4070  A13     : 0x3ffca98c  
A14     : 0x3ffb4070  A15     : 0x3ffb439c  SAR     : 0x00000004  EXCCAUSE: 0x00000001  
EXCVADDR: 0xffffffe0  LBEG    : 0x400013f9  LEND    : 0x4000140d  LCOUNT  : 0xfffffffa  

Backtrace:0x400803bd:0x3ffb44b0

ELF file SHA256: 0505095f6c3b48dd

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4688
load:0x40078000,len:14268
load:0x40080400,len:3592
entry 0x4008065c

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

abort() was called at PC 0x400d2915 on core 0

Backtrace:0x40084242:0x3ffbc590 0x40084935:0x3ffbc5b0 0x40089a1e:0x3ffbc5d0 0x400d2915:0x3ffbc640 0x400e3136:0x3ffbc860

ELF file SHA256: 91676ca46f1bc6f9

================= CORE DUMP START =================
LCsAAAABAAAAAAAAAAAAAAAAAAA=
f0VMRgEBAQAAAAAAAAAAAAQAXgABAAAAAAAAADQAAAAAAAAAAAAAADQAIAAQACgA
AAAAAA==
BAAAADQCAAAAAAAAAAAAAKAQAACgEAAABgAAAAAAAAA=
AQAAANQSAAD0yPs/9Mj7P2gBAABoAQAABgAAAAAAAAA=
AQAAADwUAADQxPs/0MT7PxwEAAAcBAAABgAAAAAAAAA=
AQAAAFgYAABkzvs/ZM77P2gBAABoAQAABgAAAAAAAAA=
AQAAAMAZAADQzPs/0Mz7P4wBAACMAQAABgAAAAAAAAA=
AQAAAEwbAADU0/s/1NP7P2gBAABoAQAABgAAAAAAAAA=
AQAAALQcAABA0vs/QNL7P4wBAACMAQAABgAAAAAAAAA=
AQAAAEAeAABgdPs/YHT7P2gBAABoAQAABgAAAAAAAAA=
AQAAAKgfAADQcvs/0HL7P4gBAACIAQ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57

rst:0xc (SW_CPU_RESET),boot:0x1b (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4688
load:0x40078000,len:14268
load:0x40080400,len:3592
entry 0x4008065c

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?

igrr commented 8 months ago

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 (https://github.com/espressif/esp-idf/issues/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.

sett-dozee commented 8 months ago

Thanks for the quick response

sett-dozee commented 8 months ago

The USB serial task has a stack size of 6 KB and when I build the code with Compiler options = Debug, this issue is not seen