esp32 coredump to flash invalid SHA

greycon
Posts: 33
Joined: Fri Nov 03, 2023 9:59 pm

esp32 coredump to flash invalid SHA

Postby greycon » Sun May 26, 2024 2:39 pm

I have enabled coredump to flash. I'm using the Eclipse Plugin, under MAC.

Operating System: mac os x
Java Runtime Version: 17.0.10+7
Eclipse Version: 4.31.100.v20240229-0520
Eclipse CDT Version: 11.5.0.202312062348
IDF Eclipse Plugin Version: 2.12.1.202402231119
ESP-IDF v5.1.2-dirty
Python set for IDF_PYTHON_ENV: Python 3.9.6

I have configured my partitions thusly;
# Name, Type, SubType, Offset, Size, Flags
nvs,data,nvs, 0x9000,0x6000,
otadata,data,ota,0xf000,0x2000,
phy_init,data,phy,0x11000,0x1000,
coredump,data,coredump,,64K,
factory,app,factory,,2M,
ota_0,app,ota_0,,2M,
ota_1,app,ota_1,,2M,

I trigger a crash (assert(0)) , and get :
I (8149) esp_core_dump_flash: Save core dump to flash...
I (8156) esp_core_dump_flash: Erase flash 28672 bytes @ 0x12000
I (8581) esp_core_dump_flash: Write end offset 0x6044, check sum length 4
I (8581) esp_core_dump_flash: Core dump has been saved to flash.
CPU halted.

I then use the IDF command line tools to try and analyse the dump file:
idf.py coredump-info

And it fails like this:
Serial port /dev/cu.usbserial-1460
Connecting....
Detecting chip type... Unsupported detection protocol, switching and trying again...
Connecting......
Detecting chip type... ESP32
WARNING:root:The core dump image offset is not specified. Use partition offset: 0x12000.
Failed to load core dump: Invalid application image for coredump: coredump SHA256(159728522d3b259f) != app SHA256().


I don't know what to try next. Can anyone help me?

greycon
Posts: 33
Joined: Fri Nov 03, 2023 9:59 pm

Re: esp32 coredump to flash invalid SHA

Postby greycon » Sun May 26, 2024 3:52 pm

OK, making some progress. Looks like this is my own fault. I use the Eclipse IDF Plugin for development. But I couldn't figure out how to use command tools like idf.py from that.

So, I installed a separate copy of the IDF environment, and use that for my command line work. For a coredump it seems to want to do a build of some kind, and it looks like I'm getting a conflict:

Running cmake in directory /Users/concunningham/Documents/git-repos/PharmaSlave/PSMonitor/build
Executing "cmake -G 'Unix Makefiles' -DPYTHON_DEPS_CHECKED=1 -DPYTHON=/Users/concunningham/.espressif/python_env/idf5.2_py3.12_env/bin/python -DESP_PLATFORM=1 -DCCACHE_ENABLE=0 /Users/concunningham/Documents/git-repos/PharmaSlave/PSMonitor"...
CMake Error: Error: generator : Unix Makefiles
Does not match the generator used previously: Ninja
Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

I can get around this by executing idf.py fullclean.

However, this removes the PSMonitor.bin file from the build directory. So I believe this is what the warning is about in the above post. So SHA256() means the file doesn't exist. I'm guessing.

I'll try to find out how to get this to work and report back if I do.

Meantime, anyone who knows about CMake vs Ninja builds, any thoughts? How might I run IDF tools in a way that is compable with the Eclipse Plugin installation?

greycon
Posts: 33
Joined: Fri Nov 03, 2023 9:59 pm

Re: esp32 coredump to flash invalid SHA

Postby greycon » Sun May 26, 2024 4:11 pm

OK, I removed the build directory in the Eclipse IDE, and did a full build, flashed it, and triggered the coredump. Then I tried to run a command line analysis:

idf.py coredump-info
Executing action: coredump-info
'/Users/concunningham/.espressif/python_env/idf5.2_py3.12_env/bin/python' is currently active in the environment while the project was configured with '/Users/concunningham/.espressif/python_env/idf5.1_py3.9_env/bin/python'. Run 'idf.py fullclean' to start again.

So, something is different between the Tools used by the Eclipse plugin, and the recent command line install I did. I tried re-installing the IDF Tools from Eclipse but the issue persists.

Anyone from the Eclipse Plugin side listening today?

greycon
Posts: 33
Joined: Fri Nov 03, 2023 9:59 pm

Re: esp32 coredump to flash invalid SHA

Postby greycon » Sun May 26, 2024 4:31 pm

AAaaand finally the stupid guy reads the docs properly: https://github.com/espressif/idf-eclips ... dfterminal

I didn't realise that the Plugin had the capability to launch a terminal session with everything setup correctly to run the tools.

Working like a charm now.

Who is online

Users browsing this forum: No registered users and 78 guests