Help with coredump; using saved downloaded core file not working as expected

abellofiore
Posts: 10
Joined: Tue May 16, 2023 7:02 pm

Help with coredump; using saved downloaded core file not working as expected

Postby abellofiore » Thu Aug 24, 2023 3:23 pm

My coredump is set to save as an ELF image to a flash partition (ESP32-C3, IDF v5.1).
I can create a panic and successfully get the coredump info from the device using the following command:

Code: Select all

idf.py coredump-info -s core.elf --gdb-timeout-sec 30
The above command connects to the device in boot mode, fetches the ELF from the partition, saves it to disk (-s option), then examines it and prints the info.

In the field, I want to upload the image myself and process it offline. The "coredump-info" command has a "--core" option that is supposed to take the downloaded file and use that INSTEAD of going to the device and getting the coredump contents.

However, when I issue the following command it ALWAYS tries to go to the device (COM port) and will NEVER use the file supplied (which IT saved previously). There is also NO debug/prints to tell you what/why it's not using it:

Code: Select all

idf.py coredump-info --core core.elf
Can someone enlighten me as to why this is happening?
According to this help page https://docs.espressif.com/projects/esp ... _dump.html, I should be able to do just this (albeit from a Serial port dump); I've even tried b64 encoding it to no avail (though I did check the Python and it will recognize ELF format).

ESP_igrr
Posts: 2071
Joined: Tue Dec 01, 2015 8:37 am

Re: Help with coredump; using saved downloaded core file not working as expected

Postby ESP_igrr » Fri Aug 25, 2023 5:00 pm

I think this should work if you use 'raw' type, pass the core dump (as obtained from Flash partition) to the --core argument, and also include the application ELF file as the last positional argument.

Something like this:

espcoredump.py info_corefile --core coredump-from-flash.bin -t raw project.elf

abellofiore
Posts: 10
Joined: Tue May 16, 2023 7:02 pm

Re: Help with coredump; using saved downloaded core file not working as expected

Postby abellofiore » Fri Aug 25, 2023 6:23 pm

I have the following SDKCONFIG options set for coredump:

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_CHECK_BOOT=y
CONFIG_ESP_COREDUMP_ENABLE=y
CONFIG_ESP_COREDUMP_MAX_TASKS_NUM=64
CONFIG_ESP_COREDUMP_STACK_SIZE=0
As you can see, the format is set to ELF. I have confirmed, byte for byte, that the ELF file created with the "--save-core TEXT" option is identically the one that is in flash.
Also, please note that I'm using IDF v5.1 and the espcoredump.py has been replaced by "idf.py coredump-info".

abellofiore
Posts: 10
Joined: Tue May 16, 2023 7:02 pm

Re: Help with coredump; using saved downloaded core file not working as expected

Postby abellofiore » Fri Aug 25, 2023 6:33 pm

So, you are correct.... I did a file find in the IDF v5.1 tree and found "espcoredump.py". After using the same downloaded ELF file that refused to work with the "idf.py coredump-info" command, it DOES work with "espcoredump.py".

Code: Select all

espcoredump.py info_corefile --core ..\downloaded.elf --core-format elf my_image.elf

Who is online

Users browsing this forum: No registered users and 76 guests