esp-coredump is a Python-based utility that aids in the post-mortem analysis of core dumps generated by Espressif chips (e.g., ESP32, ESP32-S3). It helps users retrieve and analyze the software state at the moment of an unrecoverable error, providing insights into crashed tasks, registers, and call stacks. The library is currently at version 1.16.0 and maintains an active release cadence, frequently adding support for new Espressif chips and addressing bugs.
pip install esp-coredump==1.16.0Verified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to programmatically use `esp-coredump` to analyze a core dump file. It sets up a `CoreDump` object with dummy files for illustration and attempts to retrieve core dump information. For actual usage, replace the dummy paths with your device's core dump and application ELF files.
Install the ESP-IDF framework, or download the appropriate `esp-gdb` toolchain (matching your chip and ESP-IDF version) and add its executable directory to your system's PATH. Consult ESP-IDF documentation for specific toolchain versions.
Ensure your `partitions.csv` file defines a `coredump` partition of type 'data' and subtype 'coredump' with adequate size. The required size depends on the number of tasks and stack sizes in your application.
To analyze core dumps from encrypted flash, read them directly from the ESP device using `idf.py coredump-info -c <path-to-core-dump>` after the device decrypts and sends it. Alternatively, disable flash encryption for debugging purposes if feasible for development builds.
Upgrade `esp-coredump` to version 1.12.0 or newer (e.g., `pip install --upgrade esp-coredump`). Version 1.12.0 includes a fix to replace `distutils` with `shutil` for Python 3.12 compatibility.
The ESP-IDF monitor typically handles this by automatically loading the appropriate ROM ELF files based on the target and its revision. When debugging manually, ensure that ROM ELF files are available and loaded if needed.
Install the package using pip: `python -m pip install esp-coredump`
Ensure the ESP-IDF toolchain is fully installed and that the ESP-IDF environment script (`export.sh` or `export.bat`) has been sourced in your terminal session to add the toolchain executables to the system's PATH.
For serial port access, add your user to the `dialout` group (Linux: `sudo usermod -a -G dialout $USER` and reboot) or run the command with `sudo`. For temporary file issues, check permissions of the working directory or temporary directories.
Verify your core dump partition configuration in `idf.py menuconfig` and your `partitions.csv` file. Ensure the core dump partition size is sufficient and correctly aligned. Sometimes, performing a full chip erase and re-flashing the firmware can resolve data corruption issues.