EspExceptionDecoder Not Working in PlatformIO 6.1.11(latest release) with ESP-IDF 5.1.2 (stable)
Posted: Fri Dec 29, 2023 4:42 am
I am trying to troubleshoot getting the esp32_exception_decoder to work, but it's not decoding exceptions as expected. The baud rate also gets knocked down to 9600 (maybe due to changes the debug modes I've enabled bring), but that is beside the point.
To Isolate the issue, I've created a fresh project in platformio with the following platformio.ini content:
I have also written a short application that purposefully induces a stack overflow to test with as follows:
I've tried:
To Isolate the issue, I've created a fresh project in platformio with the following platformio.ini content:
- [env:seeed_xiao_esp32c3]
- platform = espressif32
- board = seeed_xiao_esp32c3
- framework = espidf
- monitor_filters =
- send_on_enter
- esp32_exception_decoder
- build_type = debug
- build_flags =
- -std=gnu++20
- -g
- -Og
- build_unflags =
- -std=gnu++11
- #include "freertos/FreeRTOS.h"
- #include "freertos/task.h"
- unsigned int cause_stack_overflow(unsigned int current_depth = 0) {
- printf("Stack depth: %u\n", current_depth);
- if (current_depth < 0x1 << 31) {
- cause_stack_overflow(current_depth + 1);
- }
- return current_depth;
- }
- extern "C" void app_main() {
- printf("Output Start\n");
- vTaskDelay(pdMS_TO_TICKS(5000));
- printf("Output %u\n", cause_stack_overflow());
- printf("Output End\n");
- }
- Ensuring that my PlatformIO version is up-to-date (6.1.11, which is the latest as of now)
- Ensuring that the ESP-IDF version is up-to-date (5.1.2 which is the latest stable release of the espidf right now)
- Ensuring that the build_type in platformio is set to "debug"
- Ensuring that esp32_exception_decoder is set in monitor_filters
- Adding the -g and -Og build flags to ensure that the compiler left in debugging symbols
- Running a clean build and upload after reinstalling all relevant packages
- Searching for documentation that might be helpful such as the platformio official documentation which contains very little information.
- Searching for ESP documentation, which seems to only cover use with the Arduino IDE (I am not using arduino libraries, and am only using the espidf).
- Stack memory:
- 3fc8d040: 0x3fc8d044 0xffffffff 0x3c021660 0x403892c0 0x3fc8b2ac 0x3c021660 0x3fc8b290 0x3c021102
- 3fc8d060: 0x3fc8b2bc 0x3fc8d074 0x3fc8b2c0 0x3c021134 0x3fc8aed4 0x32373233 0x00000000 0x65737361
- 3fc8d080: 0x66207472 0x656c6961 0x70203a64 0x6f4e7672 0x79666974 0x75657551 0x74655365 0x746e6f43
- 3fc8d0a0: 0x656e6961 0x44492072 0x6f635c46 0x6e6f706d 0x73746e65 0x6572665c 0x6f747265 0x72465c73
- 3fc8d0c0: 0x54526565 0x4b2d534f 0x656e7265 0x75715c6c 0x2e657565 0x32333a63 0x28203237 0x75517870
- 3fc8d0e0: 0x53657565 0x6f437465 0x6961746e 0x2d72656e 0x4d78753e 0x61737365 0x57736567 0x69746961
- 3fc8d100: 0x3c20676e 0x51787020 0x65756575 0x43746553 0x61746e6f 0x72656e69 0x78753e2d 0x676e654c
- 3fc8d120: 0x00296874 0x6564206b 0x00000010 0x42003b64 0x00000011 0x00000011 0x00000011 0x4038126a
- 3fc8d140: 0x00000011 0x00000000 0x00000000 0x42000000 0x00000004 0x3fc8d2e0 0x3c020130 0x00000000
- 3fc8d160: 0x00000000 0x00000000 0x3fc8fda4 0x40383ac8 0x00000011 0x00000000 0x3fc8d070 0x3fc8d070
- 3fc8d180: 0x00000000 0x00000000 0x3fc8d070 0x40383f80 0x00000011 0x3fc8f48c 0x3fc8cedc 0x00000000
- 3fc8d1a0: 0x00000011 0x3fc8f48c 0x3fc8cedc 0x3fc8d070 0x00000001 0x3fc8f48c 0x3fc8cedc 0x00000000
- 3fc8d1c0: 0x00000000 0x3fc8f430 0x3fc8d070 0x40384130 0x00000000 0x00000004 0x3fc8d21c 0x403811c0
- 3fc8d1e0: 0x00000000 0x00000004 0x3fc8d22c 0x00000001 0x00000000 0x3c02012f 0x00000001 0x4038126a
- 3fc8d200: 0x00000003 0x3fc8cedc 0x3c020130 0x4038139a 0x00000000 0x3c02012f 0x3fc8d2e0 0x3fc8d070
- 3fc8d220: 0x00000000 0x3c02012f 0x00000001 0x4200d480 0x00000000 0x3c02012f 0x00000001 0x3fc8f48c
- 3fc8d240: 0x3c02012f 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000 0x00000011 0x00000001
- 3fc8d260: 0x00000003 0x00000000 0x00000000 0x3c0284d0 0x00000000 0x00000000 0x00000000 0x00000000
- 3fc8d280: 0x3c027a74 0x00000000 0x3c0278f8 0x00000000 0x3c027a74 0x00000000 0x3c0278f8 0x00000000
- 3fc8d2a0: 0x3c027a74 0x00000000 0x3c0278f8 0x3fc8d678 0x3c027a74 0x00000000 0x3c0278f8 0x00000001
- 3fc8d2c0: 0x00000000 0x00000000 0x3c0278f8 0x00000001 0x00000000 0x00000000 0x3c0278f8 0x00000001
- 3fc8d2e0: 0x3fc8d2ec 0x00000000 0x00000000 0x3c02012f 0x00000001 0x3fc8d38d 0x00000003 0x3c02012f
- 3fc8d300: 0x00000001 0x3fc8d39d 0x00000003 0x3c02012f 0x00000001 0x3fc8d3ad 0x00000003 0x3c02012f
- 3fc8d320: 0x00000001 0x3fc8d3bd 0x00000003 0x3c02012f 0x00000001 0x3fc8d3cd 0x00000003 0x3c02012f
- 3fc8d340: 0x00000001 0x3fc8d3dd 0x00000003 0x3c02012f 0x00000001 0x3fc8d3ed 0x00000003 0x3c02012f
- 3fc8d360: 0x00000001 0x3fc8d3fd 0x00000003 0x3c02012f 0x00000001 0x3fc8d40d 0x00000003 0x3c02012f
- 3fc8d380: 0x00000001 0x3fc8d41d 0x00000003 0x3636342f 0xffffffff 0x3fc8d42d 0x00000003 0x3536342f
- 3fc8d3a0: 0xffffffff 0x3fc8d43d 0x00000003 0x3436342f 0xffffffff 0x3fc8d44d 0x00000003 0x3336342f
- 3fc8d3c0: 0xffffffff 0x3fc8d45d 0x00000003 0x3236342f 0xffffffff 0x3fc8d46d 0x00000003 0x3136342f
- 3fc8d3e0: 0xffffffff 0x3fc8d47d 0x00000003 0x3036342f 0xffffffff 0x3fc8d48d 0x00000003 0x3935342f
- 3fc8d400: 0xffffffff 0x3fc8d49d 0x00000003 0x3835342f 0x000001d2 0x3fc8d4ad 0x00000003 0x3735342f
- 3fc8d420: 0x000001d1 0x3fc8d4bd 0x00000003 0x3635342f 0x000001d0 0x3fc8d4cd 0x00000003 0x3535342f