MathieuDeprez / ESP32_CoreDump_Arduino_1.0.6

14 stars 0 forks source link

esp_core_dump_image_get() FAIL #1

Closed crisreimberg closed 2 years ago

crisreimberg commented 2 years ago

Hi, thanks for your contribution, I am trying to log and get a esp32 error, I followed your instructions but I am getting the "esp_core_dump_image_get() FAIL" message, is there something more to configure?

MathieuDeprez commented 2 years ago

Hi, if you have this message, I see two posibilities: 1) Your Esp32 didn't crash before. (Probably not your case) 2) You don't have a partition table with a coredump SubType.

If it is the case (the second option), you have to add this line to your platformio.ini: board_build.partitions = partitions.csv and of course, you have to put the partitions.csv file in the same level as your platformio.ini file if you want to have your own custom partition table, you can create it but you need to have a partition with coredump SubType like in the example.

MathieuDeprez commented 2 years ago

Hi Crisreimberg,

Did you resolve your problem?

crisreimberg commented 2 years ago

Thanks for your help and sorry for did not reply it yet, I did not have time to review my code, I dont think the problem is some of the options that you appointed, but I think I probably missed something because I used to use Arduino to develop my codes, the plataformio is new to me.

I will spend more time on it and I will come back here to tell what was happening or to ask for some addicional help.

Thanks. 😁👊

wajihalam commented 2 years ago

I am having the same problem. The partitions.csv looks fine. However, esp_core_dump_image_get() FAIL error is printed out. I tried reading the error code. The error returns: Error (ESP_ERR_INVALID_SIZE)!.

Update: The problem was: in menuconfig.... The option to save in flash was disabled.... Enabling it solved the problem.

MathieuDeprez commented 2 years ago

Hi @wajihalam, I think there is a misunderstanding. The purpose of my project is to propose a solution to people who use Arduino framework to get the coredump to flash and read it. When you use the Arduino framework, you can't go to the menuconfig, it is an IDF feature. You are probably using IDF or "IDF + Arduino" framework (in platformio.ini file). In the zip file, there is the Arduino framework that I modified thanks to the menuconfig to enable the "Coredump to flash" feature. That way, people just need to unzip it in the good folder to enjoy that feature using Arduino framework. The don't have to install the IDF framework and export the Arduino library by themselves.

Next, I have chosen 256 because it is not too big to consume too much Ram and not too small to allow the read to be fast enough. That doesn't means that the coredump has a size of 256, but the chunks size yes. In the function, you can see that while the coredump is not totally read, we read a chunk of 256 bytes maximum (it can't be less for the last one), we convert it in a human readable way (sprintf(02x)) and we print it. All of that is done in the for loop which assure to read all the coredump.