I've configured the core dump system to store dumps to a flash partition. We're using AWS IoT services, and when a core dump is found, I plan to upload it as a stream of MQTT messages (containing Base64 encoded chunks of the core dump data).
I've written code which reads the core dump partition in 3 KiB chunks, encodes each chunk as Base64 text, and prints the text to the debug UART (for testing).
I'm trying to simulate what we would do with these chunks once we got them from the cloud service. I concatenated the chunks together into a txt file, and decoded the Base64 to give a binary file. It looks OK - I can see the right amount of data, and it includes the string "ELF" near the start.
I tried to analyze this file using the espcoredump.py tool from the ESP-IDF sdk:
Code: Select all
& "$Env:IDF_PYTHON_ENV_PATH\Scripts\python.exe" `
"$Env:IDF_PATH\components\espcoredump\espcoredump.py" info_corefile --core core_dump.bin --core-format elf .\build\wireless-controller.elf
Code: Select all
construct.core.ConstError: Error in path (parsing) -> elf_header -> e_ident -> EI_MAG
parsing expected b'\x7fELF' but parsed b'\xa4\xac\x00\x00'
Code: Select all
construct.core.StreamError: Error in path (parsing) -> program_headers -> p_flags
stream read less than specified amount, expected 4, found 0
Code: Select all
IKUAAAABAAAAAAAAAAAAAAAAAAA=
f0VMRgEBAQAAAAAAAAAAAAQAXgABAAAAAAAAADQAAAAAAAAAAAAAADQAIAA6ACgA
AAAAAA==
BAAAAHQHAAAAAAAAAAAAAIBCAACAQgAABgAAAAAAAAA=
AQAAAPRJAADEzv4/xM7+P2QBAABkAQAABgAAAAAAAAA=
AQAAAFhLAAAAzf4/AM3+P7ABAACwAQAABgAAAAAAAAA=
AQAAAAhNAACcvfs/nL37P2QBAABkAQAABgAAAAAAAAA=
...
I copied this from the serial terminal to a text file, and analyzed with the espcoredump.py tool:
Code: Select all
& "$Env:IDF_PYTHON_ENV_PATH\Scripts\python.exe" `
"$Env:IDF_PATH\components\espcoredump\espcoredump.py" info_corefile --core uart_core_dump_b64.txt --core-format b64 .\build\wireless-controller.elf
Code: Select all
espcoredump.py v0.4-dev
===============================================================
==================== ESP32 CORE DUMP START ====================
Crashed task handle: 0x3ffbbd9c, name: '', GDB name: 'process 1073462684'
================== CURRENT THREAD REGISTERS ===================
exccause 0x1d (StoreProhibitedCause)
excvaddr 0x0
epc1 0x40128fdb
epc2 0x0
epc3 0x401a3136
epc4 0x40095bc6
epc5 0x0
epc6 0x0
eps2 0x0
eps3 0x60320
eps4 0x60f23
eps5 0x0
eps6 0x0
==================== CURRENT THREAD STACK =====================
======================== THREADS INFO =========================
Traceback (most recent call last):
File "C:\Users\Jeremycb\esp-idf\components\espcoredump\espcoredump.py", line 350, in <module>
temp_core_files = info_corefile()
File "C:\Users\Jeremycb\esp-idf\components\espcoredump\espcoredump.py", line 200, in info_corefile
threads, _ = gdb.get_thread_info()
File "C:\Users\Jeremycb\esp-idf\components\espcoredump\corefile\gdb.py", line 114, in get_thread_info
current_thread_id = result['current-thread-id']
KeyError: 'current-thread-id'
So is there a good method for uploading core dumps to a server for analysis? How do I get useful info from the core dump?
There is this page, but it only gives a general overview: https://docs.espressif.com/projects/esp ... rnals.html
We are using ESP-IDF 4.4.4