ESP Coredump in Flash Cannot be Read
Posted: Wed Aug 06, 2025 9:33 am
IDF: 5.5
Board: ESP-WROVER-KIT
I have taken the hello_world and added an assert into the code to trigger a failure. The assertion is triggered and the output seems to suggest that coredump is being created.
I then try to read the coredump and the tool set is not reading the coredump from flash.
Application output:
idf.py coredump-info generates the error: A fatal error occurred: Corrupt data, expected 0x1000 bytes but received 0xfe3 bytes.
Full application output:
Heap section of the configuration file:
Partition file:
The long term aim here is to record the coredump and then send this back to a server for later analysis.
Has anyone managed to do anything similar?
Regards,
Mark
Board: ESP-WROVER-KIT
I have taken the hello_world and added an assert into the code to trigger a failure. The assertion is triggered and the output seems to suggest that coredump is being created.
I then try to read the coredump and the tool set is not reading the coredump from flash.
Application output:
Code: Select all
Hello world!
This is esp32 chip with 2 CPU core(s), WiFi/BTBLE, silicon revision v1.0, 4MB external flash
Minimum free heap size: 297104 bytes
Restarting in 100 seconds...
Restarting in 99 seconds...
Restarting in 98 seconds...
Restarting in 97 seconds...
Restarting in 96 seconds...
Restarting in 95 seconds...
Restarting in 94 seconds...
Restarting in 93 seconds...
Restarting in 92 seconds...
Restarting in 91 seconds...
assert failed: app_main hello_world_main.c:47 (0)
Backtrace: 0x40081709:0x3ffb5650 0x400849b1:0x3ffb5670 0x40089bd9:0x3ffb5690 0x400d4df6:0x3ffb57b0 0x400e27e8:0x3ffb57f0 0x400850b5:0x3ffb5820
--- 0x40081709: panic_abort at /Users/markstevens/esp/esp-idf/components/esp_system/panic.c:469
--- 0x400849b1: esp_system_abort at /Users/markstevens/esp/esp-idf/components/esp_system/port/esp_system_chip.c:87
--- 0x40089bd9: __assert_func at /Users/markstevens/esp/esp-idf/components/newlib/src/assert.c:80
--- 0x400d4df6: app_main at /Users/markstevens/Public/CoreDumpTest/main/hello_world_main.c:47
--- 0x400e27e8: main_task at /Users/markstevens/esp/esp-idf/components/freertos/app_startup.c:208
--- 0x400850b5: vPortTaskWrapper at /Users/markstevens/esp/esp-idf/components/freertos/FreeRTOS-Kernel/portable/xtensa/port.c:139
ELF file SHA256: a3af34c55f24ebca
I (10240) esp_core_dump_flash: Save core dump to flash...
I (10245) esp_core_dump_common: Backing up stack @ 0x3ffb54d0 and use core dump stack @ 0x3ffb3d30
I (10254) esp_core_dump_flash: Erase flash 8192 bytes @ 0x3b0000
I (10478) esp_core_dump_flash: Write end offset 0x1fc4, check sum length 4
I (10478) esp_core_dump_common: Core dump used 1168 bytes on stack. 3012 bytes left free.
I (10481) esp_core_dump_common: Restoring stack @ 0x3ffb54d0
I (10486) esp_core_dump_flash: Core dump has been saved to flash.
CPU halted.
Full application output:
Code: Select all
Executing action: coredump-info
Serial port /dev/cu.usbserial-2101
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting....
Detecting chip type... ESP32
WARNING:root:The core dump image offset is not specified. Use partition offset: 0x3b0000.
Failed to load core dump: esptool script execution failed with error 2, failed command was: '['/Users/markstevens/.espressif/python_env/idf5.5_py3.12_env/bin/python', '-m', 'esptool', '-c', 'auto', '-p', '/dev/cu.usbserial-2101', '-b', '460800', 'read_flash', '3866624', '8132', '/var/folders/m4/sw8tgkhs20549s7f__sz62l40000gn/T/tmph5mwpbwq']'
┌────── Additional information about the error:
│
│ esptool.py v4.9.0
│ Serial port /dev/cu.usbserial-2101
│ Connecting.........
│ Detecting chip type... Unsupported detection protocol, switching and trying again...
│ Connecting....
│ Detecting chip type... ESP32
│ Chip is ESP32-D0WDQ6 (revision v1.0)
│ Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, BLK3 partially reserved, Coding Scheme 3/4
│ Crystal is 40MHz
│ MAC: 84:0d:8e:18:5b:08
│ Uploading stub...
│ Running stub...
│ Stub running...
│ Changing baud rate to 460800
│ Changed.
│ Configuring flash size...
│ A fatal error occurred: Corrupt data, expected 0x1000 bytes but received 0xfe3 bytes
│
└────── end of additional information about the error.
Code: Select all
CONFIG_ESP_COREDUMP_ENABLE_TO_FLASH=y
# CONFIG_ESP_COREDUMP_ENABLE_TO_UART is not set
# CONFIG_ESP_COREDUMP_ENABLE_TO_NONE is not set
# CONFIG_ESP_COREDUMP_DATA_FORMAT_BIN is not set
CONFIG_ESP_COREDUMP_DATA_FORMAT_ELF=y
CONFIG_ESP_COREDUMP_CHECKSUM_CRC32=y
# CONFIG_ESP_COREDUMP_CHECKSUM_SHA256 is not set
# CONFIG_ESP_COREDUMP_CAPTURE_DRAM is not set
CONFIG_ESP_COREDUMP_CHECK_BOOT=y
CONFIG_ESP_COREDUMP_ENABLE=y
CONFIG_ESP_COREDUMP_LOGS=y
CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=32
# CONFIG_ESP_COREDUMP_FLASH_NO_OVERWRITE is not set
CONFIG_ESP_COREDUMP_STACK_SIZE=4096
# end of Core dump
Code: Select all
# ESP-IDF Partition Table
# Name, Type, SubType, Offset, Size, Flags
nvs, data, nvs, 0x9000, 0x6000,
phy_init, data, phy, 0xf000, 0x1000,
factory, app, factory, 0x10000, 0x3a0000,
coredump, data, coredump, 0x3b0000, 0x10000,
littlefs, data, spiffs, 0x3c0000, 0x40000,
Has anyone managed to do anything similar?
Regards,
Mark