Page 1 of 1

Problem downloading core dump from Flash

Posted: Thu Jun 09, 2022 10:33 am
by lg.lindstrom
Hi
I am running a ESP32 application in VsCode under Windows 11.
ESP-IDF version is 4.4

My application that crashes every 12 hour or so, give and take.

To be able to debug this I have setup a core dump.
Skärmbild 2022-06-08 093609.png
Skärmbild 2022-06-08 093609.png (12.5 KiB) Viewed 3743 times
My partition table

Code: Select all

nvs,      data, nvs,     ,        0x6000,
phy_init, data, phy,     ,        0x1000,
factory,  app,  factory, ,        2M,
coredump, data, coredump,, 64K


After a crash I am trying to download data by:

Code: Select all

espcoredump.py -p com13 dbg_corefile  build/mdcb.elf  
This causes a crash, see below. Why is that. What am I doing wrong.

Code: Select all

espcoredump.py v0.4-dev
INFO: Invoke parttool to read image.
INFO: esptool.py v3.2-dev
Serial port com13
Connecting...
Device PID identification is only supported on COM and /dev/ serial ports.
.
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Device PID identification is only supported on COM and /dev/ serial ports.
...
Detecting chip type... ESP32
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: fc:f5:c4:6f:55:a8
Uploading stub...
Running stub...
Stub running...
3072 (100 %)
3072 (100 %)
Read 3072 bytes at 0x8000 in 0.3 seconds (81.1 kbit/s)...
Hard resetting via RTS pin...
esptool.py v3.2-dev
Serial port com13
Connecting...
Device PID identification is only supported on COM and /dev/ serial ports.
.
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting...
Device PID identification is only supported on COM and /dev/ serial ports.
......
Detecting chip type... ESP32
Chip is ESP32-D0WD (revision 1)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: fc:f5:c4:6f:55:a8
Uploading stub...
Running stub...
Stub running...
65536 (100 %)
65536 (100 %)
Read 65536 bytes at 0x210000 in 5.9 seconds (88.3 kbit/s)...
Hard resetting via RTS pin...
Running C:\Users\lglin\.espressif\python_env\idf4.3_py3.8_env\Scripts\python.exe C:\Users\lglin\esp\esp-idf\components\esptool_py\esptool\esptool.py --port com13 read_flash 32768 3072 C:\Users\lglin\AppData\Local\Temp\tmp7gzdjmo1...
Running C:\Users\lglin\.espressif\python_env\idf4.3_py3.8_env\Scripts\python.exe C:\Users\lglin\esp\esp-idf\components\esptool_py\esptool\esptool.py --port com13 read_flash 2162688 65536 C:\Users\lglin\AppData\Local\Temp\tmpxnml9znm...
Read partition 'coredump' contents from device at offset 0x210000 to file 'C:\Users\lglin\AppData\Local\Temp\tmpxnml9znm'

Traceback (most recent call last):
  File "C:\Users\lglin\.espressif\python_env\idf4.3_py3.8_env\lib\site-packages\construct\lib\containers.py", line 100, in __getattr__
    return self[name]
KeyError: 'crc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\lglin\esp\esp-idf\components\espcoredump\espcoredump.py", line 352, in <module>
    temp_core_files = dbg_corefile()
  File "C:\Users\lglin\esp\esp-idf\components\espcoredump\espcoredump.py", line 125, in dbg_corefile
    core_elf_path, target, temp_files = get_core_dump_elf(e_machine=exe_elf.e_machine)
  File "C:\Users\lglin\esp\esp-idf\components\espcoredump\espcoredump.py", line 75, in get_core_dump_elf
    loader.create_corefile(exe_name=args.prog, e_machine=e_machine)
  File "C:\Users\lglin\esp\esp-idf\components\espcoredump\corefile\loader.py", line 239, in create_corefile
    self._validate_dump_file()
  File "C:\Users\lglin\esp\esp-idf\components\espcoredump\corefile\loader.py", line 214, in _validate_dump_file
    self._crc_validate()
  File "C:\Users\lglin\esp\esp-idf\components\espcoredump\corefile\loader.py", line 223, in _crc_validate
    'Invalid core dump CRC %x, should be %x' % (data_crc, self.core_src.crc))  # type: ignore
  File "C:\Users\lglin\.espressif\python_env\idf4.3_py3.8_env\lib\site-packages\construct\lib\containers.py", line 102, in __getattr__
    raise AttributeError(name)
AttributeError: crc

Re: Problem downloading core dump from Flash

Posted: Mon Jun 13, 2022 5:28 am
by lg.lindstrom
Can nobody advice me on this. I am stuck.

Re: Problem downloading core dump from Flash

Posted: Mon Jun 13, 2022 8:30 am
by ESP_Sprite
Looks like the coredump is not valid... perhaps the ESP32 crashes in such a fashion that it's unable to write a coredump?

Re: Problem downloading core dump from Flash

Posted: Mon Nov 20, 2023 3:47 pm
by shriya_dhar
I am facing a similar situation where the coredump stores invalid (0xfffff) data on the flash (I can only see the crash reason stored as 3 | 14 on cpu0 and cpu1 which doesn't giveaway a lot about the resets happening) which seems impossible to read and mend. Does anyone have any idea how to deal with such invalid coredumps?