esp-idf: Coredump into flash freezes chip (IDF-460)
Hello, I am occasionaly experiencing problems with coredumping into flash memory.
After assert(0) in my code panic handler gets invoked and starts coredump at https://github.com/espressif/esp-idf/blob/165e3edd4949586dc90fa682f907d971fee488fc/components/esp32/panic.c#L567
I have inserted ESP_COREDUMP_LOGE("Reached erase part") into esp_core_dump_flash_write_prepare function right before this line https://github.com/espressif/esp-idf/blob/9274814268f51333bd8aed65202621161e877a6a/components/esp32/core_dump.c#L334
After printing “Reached erase part” ESP chip freezes for a while and then reboots or even gets stuck up forever!
Log:
assertion "0" failed: file "/home/michal/git/flyhero-esp32/Data_Analysis/main/./main.cpp", line 67, function: void imu_task(void*)
abort() was called at PC 0x400d2dbb on core 1
0x400d2dbb: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
Backtrace: 0x4008dc3c:0x3ffbeee0 0x4008de13:0x3ffbef00 0x400d2dbb:0x3ffbef20 0x400d2b87:0x3ffbef50
0x4008dc3c: invoke_abort at /home/michal/git/flyhero-esp32-idf/components/esp32/./panic.c:651
0x4008de13: abort at /home/michal/git/flyhero-esp32-idf/components/esp32/./panic.c:651
0x400d2dbb: __assert_func at /Users/ivan/e/newlib_xtensa-2.2.0-bin/newlib_xtensa-2.2.0/xtensa-esp32-elf/newlib/libc/stdlib/../../../.././newlib/libc/stdlib/assert.c:63 (discriminator 8)
0x400d2b87: imu_task(void*) at /home/michal/git/flyhero-esp32/Data_Analysis/main/./main.cpp:67
I (6109) esp_core_dump: Save core dump to flash...
D (6109) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 4008a67a 60030 801199a9 3ffbfe20
D (6110) esp_core_dump: Stack len = 636 (3ffbfd60 3ffbffdc)
D (6111) esp_core_dump: Current task EXIT/PC/PS/A0/SP 32646231 4008dc3c 60f30 8008de16 3ffbeee0
D (6112) esp_core_dump: Stack len = 440 (3ffbee20 3ffbefd8)
D (6113) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 400d26c2 60530 8008ba84 3ffbca70
D (6114) esp_core_dump: Stack len = 364 (3ffbc9b0 3ffbcb1c)
D (6115) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 400d26c2 60630 8008ba84 3ffbc510
D (6116) esp_core_dump: Stack len = 352 (3ffbc450 3ffbc5b0)
D (6116) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 4008aa9d 60630 80119b54 3ffc0d00
D (6117) esp_core_dump: Stack len = 484 (3ffc0c40 3ffc0e24)
D (6118) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 4008c58c 60430 8008c67f 3ffbd4b0
D (6119) esp_core_dump: Stack len = 396 (3ffbd3f0 3ffbd57c)
D (6120) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 4008aa9d 60830 800ed506 3ffc2790
D (6121) esp_core_dump: Stack len = 444 (3ffc26d0 3ffc288c)
D (6121) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 4008aa9d 60730 80103bbd 3ffc7c50
D (6122) esp_core_dump: Stack len = 408 (3ffc7b90 3ffc7d28)
D (6123) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 4008aa9d 60430 800d1fa3 3ffafba0
D (6124) esp_core_dump: Stack len = 388 (3ffafae0 3ffafc64)
D (6125) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 400813ee 60630 8008aa9d 3ffc3990
D (6126) esp_core_dump: Stack len = 460 (3ffc38d0 3ffc3a9c)
D (6127) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 4008aa9d 60830 8008142b 3ffba0d0
D (6128) esp_core_dump: Stack len = 384 (3ffba010 3ffba190)
D (6128) esp_core_dump: Task EXIT/PC/PS/A0/SP 40082384 4008aa9d 60d30 8008142b 3ffba690
D (6129) esp_core_dump: Stack len = 384 (3ffba5d0 3ffba750)
D (6130) esp_core_dump: Core dump len = 9568 (12 0)
E (6131) esp_core_dump: Reached erase part
I think that the problem might be related to the fact that spi_flash_erase_range function is placed in IRAM. Any thoughts how to figure out what is the chip doing without JTAG?
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (1 by maintainers)
I’ve just come across this issue in 4.2.