PlatformIO Community

PlatformIO Support for ESP32 Coredump

I’m trying to compile ESP insights with Coredump enabled code in PlatformIO. But it gives me below errors:

"/Users/sduddell/workplace/esp_insights/src/esp_insights_cbor_encoder.h:27:42: error: unknown type name ‘esp_core_dump_summary_t’

  • void esp_insights_cbor_encode_diag_crash(esp_core_dump_summary_t summary);"

"/Users/sduddell/workplace/esp_insights/src/esp_insights_encoder.c:98:5: error: unknown type name ‘esp_core_dump_summary_t’

  • esp_core_dump_summary_t *summary = malloc(sizeof(esp_core_dump_summary_t));"*
    

On debugging, I understood that version 4.4 of ESP IDF(https://github.com/espressif/esp-idf/blob/release/v4.4/components/espcoredump/include/esp_core_dump.h) has this core dump code enabled whereas latest ESP IDF version integrated in platformIO is still 4.3.1 ( https://github.com/platformio/platform-espressif32/releases )

Can you please tell when the latest version of ESP IDF(v4.4) will be integrated to platformIO, also in the meanwhile is there any workaround I can follow to resolve this issue and build my code successfully.

Thanks!!

Per https://github.com/espressif/esp-idf/releases the latest official version is 4.4-beta1, and it’s PlatformIO policy to only support stable versions – meaning with the current used 4.3.1 version, PlatformIO is still lagging behind the most recent v4.3.2 version from 6 days ago.

However, PlatformIO is adaptive. Through a platform_packages directive you can arbitrarily modify the source of the package framework-espidf, to e.g. point at a specific repository with ESP-IDF v4.4-beta1 with the PlatformIO-specific package.json file. With some luck then, the current builder script logic in espidf.py still works for the newer ESP-IDF version. (If not, things get interesting and more complicated…)

I’ve tested this out practically by creating https://github.com/maxgerhardt/esp-idf/tree/release/v4.4, which is really just the base repo plus a package.json in the release/v4.4 branch and creating a project that uses it. Additionally, since PlatformIO currently uses version 8.4.0+2021r1 of the XTensa-GCC toolchain, but current ESP-IDF requires the 2021r2 version, an extra directive regarding this has to be added in platform_packages, too.

After then activating the needed coredump configs through menuconfig → Component Config → Core dump, code like

#include <stdio.h>
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "sdkconfig.h"
#include "esp_core_dump.h"

void app_main()
{
        printf("Hello, world!\n");

        esp_core_dump_init();
        esp_core_dump_summary_t *summary = malloc(sizeof(esp_core_dump_summary_t));
        if (summary) {
                esp_err_t err = esp_core_dump_get_summary(summary);
                if (err == ESP_OK) {
                        printf("Getting core dump summary ok.");
                } else {
                        printf("Getting core dump summary not ok. Error: %d\n", (int) err);
                        printf("Probably no coredump present yet.\n");
                        printf("esp_core_dump_image_check() = %d\n", esp_core_dump_image_check());
                }
                free(summary);
        }

    while(1) {
                vTaskDelay(1000 / portTICK_PERIOD_MS);
                printf("Doing nothing...\n");
    }
}

the source file compiles fine, but linking fails at a later step.

ld.exe: cannot open linker script file esp32.peripherals.ld: No such file or directory

So I’m stuck for the moment here and opened an issue at https://github.com/platformio/platform-espressif32/issues/695 – maybe someone else can complete this.

Thanks Max for your quick reply and help!! will follow-up this linker error from the issue you have opened.

Thanks to a comment in the issue I got a working builder script.

I’ve tested the crashdump feature and it works fine.

The example app (https://github.com/maxgerhardt/pio-espidf-4.4-test) retrieves the coredump at boot (if present) and then does

Crashing in 3 seconds..
Crashing in 2 seconds..
Crashing in 1 seconds..
Crashing in 0 seconds..
Crashing..
Guru Meditation Error: Core  0 panic'ed (StoreProhibited). Exception was unhandled.

Core  0 register dump:
PC      : 0x400d0f57  PS      : 0x00060630  A0      : 0x800d0feb  A1      : 0x3ffb88b0
A2      : 0x00000064  A3      : 0x3ffb1138  A4      : 0x3ffaf988  A5      : 0x00000001
A6      : 0x3f410000  A7      : 0x3ffaf988  A8      : 0x00000000  A9      : 0x01234567
A10     : 0x00000000  A11     : 0x0000021e  A12     : 0x3ffb4e10  A13     : 0x3ffb8780
A14     : 0x00000018  A15     : 0x3ffb8780  SAR     : 0x00000009  EXCCAUSE: 0x0000001d
EXCVADDR: 0x00000000  LBEG    : 0x400014fd  LEND    : 0x4000150d  LCOUNT  : 0xfffffffd


Backtrace:0x400d0f54:0x3ffb88b00x400d0fe8:0x3ffb88d0 0x400e7150:0x3ffb88f0 0x400882c9:0x3ffb8910




ELF file SHA256: 8309f0727b020b98

I (6205) esp_core_dump_flash: Save core dump to flash...
...

and at the next reboot, this data is retrieved…

Retrieving core dump summary..
D (822) esp_core_dump_elf: ELF ident 7f E L F
D (826) esp_core_dump_elf: Ph_num 14 offset 34
D (830) esp_core_dump_elf: PHDR type 4 off 1f4 vaddr 0 paddr 0 filesz e40 memsz e40 flags 6 align 0
D (840) esp_core_dump_elf: Note NameSZ 8 DescSZ 24c Type 1 name CORE
D (846) esp_core_dump_elf: Note NameSZ 8 DescSZ 24c Type 1 name CORE
D (852) esp_core_dump_elf: Note NameSZ 8 DescSZ 24c Type 1 name CORE
D (859) esp_core_dump_elf: Note NameSZ 8 DescSZ 24c Type 1 name CORE
D (865) esp_core_dump_elf: Note NameSZ 8 DescSZ 24c Type 1 name CORE
D (872) esp_core_dump_elf: Note NameSZ 8 DescSZ 24c Type 1 name CORE
D (878) esp_core_dump_elf: PHDR type 1 off 1034 vaddr 3ffb899c paddr 3ffb899c filesz 158 memsz 158 flags 6 align 0
D (889) esp_core_dump_elf: PHDR type 1 off 118c vaddr 3ffb87f0 paddr 3ffb87f0 filesz 1a4 memsz 1a4 flags 6 align 0
D (899) esp_core_dump_elf: PHDR type 1 off 1330 vaddr 3ffb8af8 paddr 3ffb8af8 filesz 158 memsz 158 flags 6 align 0
D (909) esp_core_dump_elf: PHDR type 1 off 1488 vaddr 3ffb90b0 paddr 3ffb90b0 filesz 1a0 memsz 1a0 flags 6 align 0
D (920) esp_core_dump_elf: PHDR type 1 off 1628 vaddr 3ffb9258 paddr 3ffb9258 filesz 158 memsz 158 flags 6 align 0
D (930) esp_core_dump_elf: PHDR type 1 off 1780 vaddr 3ffb9810 paddr 3ffb9810 filesz 1a0 memsz 1a0 flags 6 align 0
D (941) esp_core_dump_elf: PHDR type 1 off 1920 vaddr 3ffafdd4 paddr 3ffafdd4 filesz 158 memsz 158 flags 6 align 0
D (951) esp_core_dump_elf: PHDR type 1 off 1a78 vaddr 3ffb5dc0 paddr 3ffb5dc0 filesz 1c0 memsz 1c0 flags 6 align 0
D (961) esp_core_dump_elf: PHDR type 1 off 1c38 vaddr 3ffb7744 paddr 3ffb7744 filesz 158 memsz 158 flags 6 align 0
D (972) esp_core_dump_elf: PHDR type 1 off 1d90 vaddr 3ffb7580 paddr 3ffb7580 filesz 1bc memsz 1bc flags 6 align 0
D (982) esp_core_dump_elf: PHDR type 1 off 1f4c vaddr 3ffb65e4 paddr 3ffb65e4 filesz 158 memsz 158 flags 6 align 0
D (993) esp_core_dump_elf: PHDR type 1 off 20a4 vaddr 3ffb6430 paddr 3ffb6430 filesz 1ac memsz 1ac flags 6 align 0
D (1003) esp_core_dump_elf: PHDR type 4 off 2250 vaddr 0 paddr 0 filesz 114 memsz 114 flags 6 align 0
D (1012) esp_core_dump_elf: Note NameSZ 14 DescSZ 48 Type 204a name ESP_CORE_DUMP_INFO
D (1020) esp_core_dump_elf: Core dump version 0x100
D (1025) esp_core_dump_elf: App ELF SHA2 8309f0727b020b98
D (1031) esp_core_dump_elf: Note NameSZ c DescSZ 94 Type 2a5 name EXTRA_INFO
D (1038) esp_core_dump_port: Crash TCB 0x3ffb899c
D (1043) esp_core_dump_port: excvaddr 0x0
D (1047) esp_core_dump_port: exccause 0x1d
D (1051) esp_core_dump_elf: Crashing task main
D (1055) esp_core_dump_port: Crashing PC 0x400d0f54
D (1060) esp_core_dump_port: A[0] 0x800d0feb
D (1065) esp_core_dump_port: A[1] 0x3ffb88b0
D (1069) esp_core_dump_port: A[2] 0x64
D (1073) esp_core_dump_port: A[3] 0x3ffb1138
D (1077) esp_core_dump_port: A[4] 0x3ffaf988
D (1082) esp_core_dump_port: A[5] 0x1
D (1085) esp_core_dump_port: A[6] 0x3f410000
D (1090) esp_core_dump_port: A[7] 0x3ffaf988
D (1094) esp_core_dump_port: A[8] 0x0
D (1098) esp_core_dump_port: A[9] 0x1234567
D (1102) esp_core_dump_port: A[10] 0x0
D (1106) esp_core_dump_port: A[11] 0x21e
D (1110) esp_core_dump_port: A[12] 0x3ffb4e10
D (1114) esp_core_dump_port: A[13] 0x3ffb8780
D (1119) esp_core_dump_port: A[14] 0x18
D (1123) esp_core_dump_port: A[15] 0x3ffb8780
D (1127) esp_core_dump_port: Crash Backtrace
D (1131) esp_core_dump_port:  0x400d0f54
D (1135) esp_core_dump_port:  0x400d0fe8
D (1139) esp_core_dump_port:  0x400e7150
D (1143) esp_core_dump_port:  0x400882c9
Getting core dump summary ok.

If you tried a previous version of this example, make sure to delete C:\Users\<user>\.platformio\platforms\espressif32* to force a download of the fixed platform version.

Hi Max, I tried this change, but I end up in some other error.

I made changes in platformio.ini to include:
platform_packages =
framework-espidf@https://github.com/maxgerhardt/esp-idf.git#release/v4.4
espressif/toolchain-xtensa-esp32@8.4.0+2021r2

I pulled in the change espidf.py from https://github.com/platformio/platform-espressif32/pull/693/files

Now, I get below error:

usage: ldgen.py [-h] [--input INPUT] [--fragments FRAGMENTS [FRAGMENTS ...]]
                [--libraries-file LIBRARIES_FILE] [--output OUTPUT]
                [--config CONFIG] [--kconfig KCONFIG] [--check-mapping]
                [--check-mapping-exceptions CHECK_MAPPING_EXCEPTIONS]
                [--env NAME=VAL] [--env-file ENV_FILE] [--objdump OBJDUMP]
ldgen.py: error: unrecognized arguments: --fragments-list /Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_phy/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/xtensa/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/espcoredump/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_hw_support/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/hal/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/driver/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/lwip/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/soc/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_system/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_event/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/freertos/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_pm/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/heap/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/bt/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_ringbuf/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_gdbstub/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/log/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/spi_flash/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_wifi/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/app_trace/linker.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_common/common.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_common/soc.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/esp_system/app.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/newlib/newlib.lf;/Users/sduddell/.platformio/packages/framework-espidf@src-98347c2f74f997bae9c72daf5a46798a/components/newlib/system_libs.lf
Compiling .pio/build/m5stack-timer-cam/bootloader/bootloader_support/src/bootloader_init.o
*** [.pio/build/m5stack-timer-cam/sections.ld] Error 2

No, that file does not work correctly, I had to adapt it espidf.py.

You should not be copying files manually. If you’re using the reference project, just

and then do a build, it should pull all the right versions and build without any intervention. It references the correct

with a few other option such as a partition table and a sdkconfig.esp32dev with the activated options regarding coredump to flash in ELF format, log level set to verbose and a reference to the partition table.

Thanks a lot, it worked for me now.
Closing this issue now.

Hi sduddell6, maxgerhard,

i stumbled over your thread and hope you might have an idea how i could overcome my problem.
I have a lolin32 oled project which is continuously crashing - unfortunately I cannot connect it to usb in the environment it crashes. Thus I havent had the chance to debug the root cause.
I would like to crash dump but this hasnt worked so far.

I used the github platform described above and also the xtensa platform-packages. I compiles fine but I cannot open menuconfig regardless what I do. I get the same message every time (scons: *** Do not know how to make File target menuconfig’ `)

Looking at your example i realized the only difference is on: platform=arduino instead of espidf. Unfortunately I need some arduino libraries so I cannot omit arduino.
Tried:
espidf only - will cause the error that the board is not supported (aside from the fact that my arduino libs would not build)
arduino, espidf - throws a lot of cmake errors.

Kind of frustrating, Im spending hours to make some simple coredump configs without sucess and this is only for collecting data on the crash issue :slight_smile:

Read some material and suppose it is connected with arduino being precompiled and not compatible with idf4.4 or vice versa. But havent figured out how to solve it. Does anybody have an idea on how i can proceed? Thanks in advance

Make sure to use platform-espressif32/examples/espidf-arduino-blink at develop · platformio/platform-espressif32 · GitHub as a base – this should build fine.

Is there no backtrace in the console that you can look it instead of going this more complicate coredump route? It should contain the same info…

oh, yeah I would love to have it over the console backtrace.

The issue is, the device is build somewhere were I cannot connect it to my pc. And even if I could, the crashes happen sometimes frequently, sometimes only in 48hours. Dont want to be sitting next to it that entire time.

This is why I wanted to save the data somewhere to push it out over wifi later on.

I will try the config off your link again and report the outcome… but until now I never made the arduino, espidf variant run through

You can use a filter to enable logging to a file, then you can dedicate a computer to being connected to the serial output and come back it later and collect the logfiles and analyze them. (Of course the esp32_exception_decoder should be enabled in these filters too) as an alternative.

Hm, that would be an option. I might need to organize a laptop from somewhere and some waterproofing but in fact that could be feasable somehow.
Let me try that…since coredump seems to be more complicated than it should be

Thank you so far

So what I did is: I found an old smartphone (had no laptop available) and installed an usb serial console and attached it.
Worked like a charm (after having figured out that the power supply of the esp32 must come from the phone in order to identify the usb connection. with a pc its possible that the esp is powered by a secondary source. assume the usb of the pc is more robust)

Now I got a crash dump. But of course it is raw. Is there a way to paste it somewhere into platformio to have it decoded? Unfortunately the kernel panic messge itsel is not of use Guru Meditation Error: Core 0 panic'ed (Double exception).

As it is a double exception…

You can’t feed the exception info post-mortem into PlatformIO :confused:

What’s the full output? Is there a backtrace with


Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC      : 0x4010ecb8  PS      : 0x00060e30  A0      : 0x8010edca  A1      : 0x3ffe1b00  
0x4010ecb8: cnx_node_leave at ??:?

A2      : 0x3ffc6750  A3      : 0x3ffc6754  A4      : 0x00000000  A5      : 0x00000000  
A6      : 0x00000000  A7      : 0x00000000  A8      : 0x8010ecb8  A9      : 0x3ffe1aa0  
A10     : 0x3ffc67ae  A11     : 0x00000061  A12     : 0x00000062  A13     : 0x02028354  
A14     : 0x40021000  A15     : 0x01800101  SAR     : 0x00000000  EXCCAUSE: 0x0000001c  
EXCVADDR: 0x00000000  LBEG    : 0x4000c2e0  LEND    : 0x4000c2f6  LCOUNT  : 0xffffffff  

ELF file SHA256: ae32296154201836951dd857974a71b30d727be7931fd32b77af4ab2c44734d9

Backtrace: 0x4010ecb5:0x3ffe1b00 0x4010edc7:0x74828249 

? Otherwise it’s gonna be very hard without a debugger.

Guru Meditation Error: Core  0 panic'ed (Double exception). 

Core  0 register dump:
PC      : 0x4008bf5f  PS      : 0x00040f36  A0      : 0x80082c72  A1      : 0x3ffb3010  
A2      : 0x00000001  A3      : 0x0000531c  A4      : 0x00000041  A5      : 0x3f400193  
A6      : 0x007bf1a8  A7      : 0x003fffff  A8      : 0x40080080  A9      : 0x3ffb3120  
A10     : 0x00060136  A11     : 0x00040026  A12     : 0x00000048  A13     : 0x3f400193  
A14     : 0x3ffb3318  A15     : 0x3ffb331c  SAR     : 0x00000004  EXCCAUSE: 0x00000002  
EXCVADDR: 0xffffffe0  LBEG    : 0x4008a055  LEND    : 0x4008a066  LCOUNT  : 0xfffffff5  


Backtrace:0x4008bf5c:0x3ffb30100x40082c6f:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0  |<-CONTINUES



 
ELF file SHA256: 0000000000000000

Rebooting...
ets Jun  8 2016 00:22:57

rst:0xc (SW_CPU_RESET),boot:0x17 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:12776
load:0x40080400,len:3032
entry 0x400805e4 

Good, you have the critical part. Do you also have the exact firmware.elf that was running on the device? (No rebuild as that would change the addresses.) It should be in .pio\build\<env>\firmware.elf on the machine that built the firmware.

With the xtensa addr2line tool you can decode the backtrace addreses to code files and lines that were involved in the crash. Like https://github.com/platformio/platform-espressif32/blob/6b942d9a458b0489e860f4cfe4ac8d10124c27f9/monitor/filter_exception_decoder.py does. Actually it would be nice if PlatformIO were able to accept that input post-mortem…

Hi Max,

thank you for the hint. I used the add2line tool as decribed here:

[> https://www.esp32.com/viewtopic.php?t=23384

And this is the output. Not sure what is actually is. I assume it is somehow related with the wifi stack as my wifi connection is running on core 0.
But maybe you can read more out of it.

C:\Users\USRNAME>C:\Users\USRNANE\.espressif\tools\xtensa-esp32-elf\esp-2020r3-8.4.0\xtensa-esp32-elf\bin\xtensa-esp32-elf-addr2line.exe -fe C:\Users\USRNANE\Documents\PlatformIO\Projects\FreeRtos_Sprudel_working_folder\.pio\build\lolin32_mini_ota-release\firmware.elf 0x4008bf5c:0x3ffb30100x40082c6f:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070 0x4008bf5c:0x3ffb30b0 0x4008bf5c:0x3ffb30e0 0x4008bf5c:0x3ffb3100 0x4008bf5c:0x3ffb3120 0x4008007d:0x3ffb3010 0x4008d27d:0x3ffb3030 0x4008bf5c:0x3ffb3050 0x4008bf5c:0x3ffb3070
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_alloca_exc
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1799
taskYIELD_OTHER_CORE
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:651
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_alloca_exc
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1799
taskYIELD_OTHER_CORE
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:651
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_alloca_exc
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1799
taskYIELD_OTHER_CORE
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:651
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_alloca_exc
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_vectors.S:1799
taskYIELD_OTHER_CORE
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/tasks.c:651
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194
_xt_context_save
/home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port/xtensa/xtensa_context.S:194

Ok, hope this might help somebody.

I found the root cause of “double exception” errors. And I assume its a sort of IDF bug as those are thrown if you do a ESP.restart(); command. Crazy that a controlled restart throws an undefined error with no way to understand where it originates from.

In my code the reason it was executed was. It is triggered by a special UDP message and it turned out that bitshifts in UDP messages are more frequent than expected. A little checksum solved the resetting.