Hi all, I've enabled coredumps in menuconfig and added a coredump partition. I can cause a coredump and then use espcoredump.py -p info_corefile to read it and it works fine. But if I extract that same coredump from the partition using esptool to read the flash I get:
espcoredump.py v0.1-dev
Growing up stacks are not supported for now!
Failed to create corefile!
Here's the commands I'm using:
Show Partitions
make partition_table
Partition table binary generated. Contents:
*******************************************************************************
# Espressif ESP32 Partition Table
# Name, Type, SubType, Offset, Size, Flags
ota_0,app,ota_0,0x10000,1900K,
ota_1,app,ota_1,0x1f0000,1900K,
nvs,data,nvs,0x3cb000,16K,
otadata,data,ota,0x3cf000,8K,
phy_init,data,phy,0x3d1000,8K,
coredump,data,coredump,0x3d3000,64K,
*******************************************************************************
Core Dump With Serial (Works Fine)
~/esp/esp-idf/components/espcoredump/espcoredump.py -p /dev/cu.usbserial-A50285BI info_corefile -o 4009984 build/main.elf
espcoredump.py v0.1-dev
esptool.py v2.2.1
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
16 (100 %)
16 (100 %)
Read 16 bytes at 0x3d3000 in 0.0 seconds (4.0 kbit/s)...
Hard resetting...
esptool.py v2.2.1
Connecting....
Chip is ESP32D0WDQ6 (revision 1)
Uploading stub...
Running stub...
Stub running...
24048 (100 %)
24048 (100 %)
Read 24048 bytes at 0x3d3000 in 2.3 seconds (85.3 kbit/s)...
Hard resetting...
===============================================================
==================== ESP32 CORE DUMP START ====================
Download Core Dump Partition (Works Fine)
python $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/cu.usbserial-A50285BI --baud 115200 read_flash 4009984 65536 coredump.bin
Core Dump With Downloaded Partition (Fails)
~/esp/esp-idf/components/espcoredump/espcoredump.py info_corefile -t raw -c coredump.bin build/main.elf
espcoredump.py v0.1-dev
Growing up stacks are not supported for now!
Failed to create corefile!
Ultimately, I'm not trying to download from flash to read core dumps. I want to be able to upload them to my server after a reboot. The process is basically the same, and I get the same error.
Thanks,
Jason
How to extract coredump from partition and read it?
Re: How to extract coredump from partition and read it?
Replying to myself:
Got this figured out. If I remove the first four bytes (the magic number) it all works fine! Looks like the flash loader removes these automatically and the raw loader doesn't expect them.
Got this figured out. If I remove the first four bytes (the magic number) it all works fine! Looks like the flash loader removes these automatically and the raw loader doesn't expect them.
-
- Posts: 1
- Joined: Mon Jul 29, 2019 12:39 pm
Re: How to extract coredump from partition and read it?
Hi vonnieda,
I am trying to read the coredump partition and convert the coredump.bin into error log.
partition.csv file
# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x009000, 0x004000
otadata, data, ota, 0x00d000, 0x002000
phy_init, data, phy, 0x00f000, 0x001000
ota_0, app, ota_0, 0x010000, 0x180000
ota_1, app, ota_1, 0x190000, 0x180000
storage, data, spiffs, 0x310000, 0x080000
coredump, data, coredump,0x390000, 80K
i have read the coredump file with this command.
$ python $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 read_flash 3735552 81920 coredump.bin
I am getting the same error as your last,How can i resolve this.
$python $IDF_PATH/components/espcoredump/espcoredump.py info_corefile -t raw -c build/hello-world.elf coredump.bin
espcoredump.py v0.1-dev
Growing up stacks are not supported for now!
Failed to create corefile!
Thanks in advance.
Sorry for the bad english.
I am trying to read the coredump partition and convert the coredump.bin into error log.
partition.csv file
# Name, Type, SubType, Offset, Size
nvs, data, nvs, 0x009000, 0x004000
otadata, data, ota, 0x00d000, 0x002000
phy_init, data, phy, 0x00f000, 0x001000
ota_0, app, ota_0, 0x010000, 0x180000
ota_1, app, ota_1, 0x190000, 0x180000
storage, data, spiffs, 0x310000, 0x080000
coredump, data, coredump,0x390000, 80K
i have read the coredump file with this command.
$ python $IDF_PATH/components/esptool_py/esptool/esptool.py --chip esp32 --port /dev/ttyUSB0 --baud 115200 read_flash 3735552 81920 coredump.bin
I am getting the same error as your last,How can i resolve this.
$python $IDF_PATH/components/espcoredump/espcoredump.py info_corefile -t raw -c build/hello-world.elf coredump.bin
espcoredump.py v0.1-dev
Growing up stacks are not supported for now!
Failed to create corefile!
Thanks in advance.
Sorry for the bad english.
-
- Posts: 10
- Joined: Wed May 31, 2017 4:21 pm
Re: How to extract coredump from partition and read it?
vonnieda, I just wanted to drop in and thank you for your post! This solved a problem I was having (literally implementing the same post coredump to server).
I want to note that the newer IDF version with the file in the ELF format does not need the first four bytes stripped. But the otherwise not really documented -t and -c flags were helpful.
I want to note that the newer IDF version with the file in the ELF format does not need the first four bytes stripped. But the otherwise not really documented -t and -c flags were helpful.
Who is online
Users browsing this forum: MicroController and 62 guests