esp-coredump.py of binary file

Fboggle
Posts: 3
Joined: Mon May 13, 2024 10:11 am

esp-coredump.py of binary file

Postby Fboggle » Mon May 13, 2024 10:38 am

Has anybody ever taken a binary file that is an image of the coredump partition and been able to decode it using esp-coredump.py?

We use Arduino development environment under vscode so I know the results will not be as robust as if they were built with idf.py. I would love to get anything.

What I have done

Installed ESP-IDF under vscode following the instructions here (https://github.com/espressif/vscode-esp ... install.md)
pip install esp-coredump
Went to the esp-idf subdirectory and executed install.bat and export.bat
Lopped the first 20 bytes off of the binary dump file (or else I get parsing expected b'\x7fELF' but parsed b'dS\x00\x00')

I execute either
  1. python3 espcoredump.py dbg_corefile out.dump
or
  1. python3 espcoredump.py info_corefile out.dump
They result with
  1. WARNING: C:\Users\r_g_v\esp\v5.3\esp-idf\components\espcoredump\project_description.json does not exist. Please build the app with "idf.py build"
  2. Please set up ESP-IDF to complete the action. Read more: https://github.com/espressif/esp-coredump/blob/master/README.md#installation

ESP_pdragun
Posts: 12
Joined: Fri Dec 02, 2022 2:18 pm

Re: esp-coredump.py of binary file

Postby ESP_pdragun » Tue May 14, 2024 7:37 am

Hello,

if you are trying to use just a coredump I would suggest following this installation guide: https://github.com/espressif/esp-coredu ... stallation
There is also an option for standalone installation without ESP-IDF if you don't need it for anything else.

You are seeing the warning because coredump needs the ELF file of the application to decode the dump. If you execute the wrapper script it will assume that you are using the ESP-IDF and try to find the ELF file in the build folder, which does not exist for you.

I would suggest executing the curedump script without the ESP-IDF wrapper as described in the README that I linked above:

Code: Select all

esp-coredump info_corefile -c out.dump app.elf
But you need to find the ELF file (app.elf above) in your Arduino build folder (the name will be probably something like yourApp.ino.elf). That being said, this is not something that is supported, it may work, but we are not testing integration with the Arduino framework.

Fboggle
Posts: 3
Joined: Mon May 13, 2024 10:11 am

Re: esp-coredump.py of binary file

Postby Fboggle » Tue May 14, 2024 6:55 pm

I did install the VSCode version of ESP-IDF. The installation suggested that instead of the standalone app. The path to esp-coredump is in my Windows path so I think it installed correctly.

I get the following message:

espcoredump.py v1.11.0
===============================================================
==================== ESP32 CORE DUMP START ====================
GDB executable not found. Please install GDB or set up ESP-IDF to complete the action. Read more: https://github.com/espressif/esp-coredu ... stallation


I downloaded the GDB and it is just a zip file. I unzipped it and added the bin directory to my windows path. I got the same result.

Thank you in advance

ESP_pdragun
Posts: 12
Joined: Fri Dec 02, 2022 2:18 pm

Re: esp-coredump.py of binary file

Postby ESP_pdragun » Wed May 15, 2024 7:55 am

There are a couple of reasons why you may see that message:
1. Ensure that after you added esp-gdb into the path you restarted the command line (PowerShell) so the changes will get applied
2. Ensure that you have the correct toolchain architecture based on the chip you are using. You either need RISCV or Extensa version. If you are using ESP32, ESP32S2, or ESP32S3 you will need the Extensa. (You may need to click "See more" in the GitHub releases to see the Extensa toolchains.)
3. Ensure that you are downloading the correct version of the toolchain. The version needs to be the same as the one used for compiling the application, you need to find that in the Arduino library.

Fboggle
Posts: 3
Joined: Mon May 13, 2024 10:11 am

Re: esp-coredump.py of binary file

Postby Fboggle » Wed May 15, 2024 8:41 pm

Thanks to your hard work, it is working. Here the steps I took.
1) I installed the ESP-IDF VScode extension
2) I found the path to the xtensa stuff and added it to my Windows path
It looked something like ~/.espressif/tools/xtensa-esp-elf-gdb/14.2_20240403/xtensa-esp-elf-gdb/bin (I hate backslashes)
3) I used pip to install esp-coredump and esptool (esptool may have come along with esp-coredump)

Then I was able to open a new powershell (or Git Bash) window and enter esp-coredump info_corefile -c mydump.bin myapp.elf

I cannot thank you enough. Name three charities and I'll send $20 bucks to one of them.

Who is online

Users browsing this forum: Baidu [Spider] and 70 guests