MCU is an ESP32Devkit Sketch is on Arduino IDEv2.1.0 Overview:
This is a large program (~3500 lines) that reads different sensors and inputs then displays to TFT via a GUISlice setup. It also cycles through a BLE to scan for TPMS modules.
Recently it's been rebooting and I'm not sure where to start in figuring out what the cause would be. I could use some guidance (and patience) on what first steps I should take to start to decode, etc. While I am ok in writing code, I'm not knowledgeable about decoding the error messages.
Error Msg:
-abort() was called at PC 0x4019d96b on core 0
-Backtrace: 0x40083b75:0x3ffd5340 0x40092ea9:0x3ffd5360 0x40098a0d:0x3ffd5380 0x4019d96b:0x3ffd5400 0x4019d9b2:0x3ffd5420 0x4019d913:0x3ffd5440 0x4019dd42:0x3ffd5460 0x4019e871:0x3ffd5480 0x4019e950:0x3ffd54a0 0x4019eac5:0x3ffd54e0 0x400e15c9:0x3ffd5500 0x400de4bb:0x3ffd5590 0x400e4c3d:0x3ffd55f0 0x400e31d2:0x3ffd56e0 0x4010a139:0x3ffd5730 0x4010a725:0x3ffd5750 0x4013729d:0x3ffd5770 0x40137233:0x3ffd5790
PieterP's suggestion that you decode the stack trace is a good one. But you should be aware that the linked "ESP Exception Decoder" tool is only compatible with Arduino IDE 1.x. Arduino IDE 2.x will not recognize the installation of that tool.
So you have a couple of options:
Use Arduino IDE 1.x
You can install and use Arduino IDE 1.x for the purposes of having access to this "ESP Exception Decoder" tool. The Arduino IDE 1.x download links are listed here:
You can have Arduino IDE 2.x and 1.x installed at the same time without any problems so you are welcome to continue to use Arduino IDE 2.x as your everyday IDE, using Arduino IDE 1.x only when your program generates an exception and you need the "ESP Exception Decoder" tool to decode it.
You should note that it is necessary to compile and upload the problematic sketch using Arduino IDE before obtaining the stack trace for use with the "ESP Exception Decoder" tool. The reason is that the tool uses the files from the temporary build folder that is generated when you compile a sketch in Arduino IDE and it can only know where that folder is if you compiled using the IDE the tool is running in. So the procedure would go like this:
Encounter an exception from your sketch.
Start Arduino IDE 1.x
Open the problematic sketch in Arduino IDE 1.x
Compile and upload the problematic sketch to your ESP32 board.
Open Serial Monitor.
Copy the stack trace from Serial Monitor.
Select Tools > ESP Exception Decoder from the Arduino IDE 1.x menus.
The "Exception Decoder" window will open.
Paste the copied stack trace into the "Paste your stack trace here" field in the "Exception Decoder" window.
Use the Standalone Exception Decoder Tool
An alternative command line tool is mentioned in the "ESP Exception Decoder" readme:
This standalone tool can be used independent from whatever IDE or other development tool you are using with your sketches.
FYI, the Arduino IDE 2.x developers are aware of the need to support extending the functionality of Arduino IDE 2.x as was possible with the "Tools" system of Arduino IDE 1.x:
There is actually some work in progress right now with the goal of resolving that deficiency. For example:
There is still a lot of work to do so the solutions I listed in my previous reply are what we have to work with now. But at least there is some hope of a future where tools like "ESP Exception Decoder" can be added to Arduino IDE 2.x.
If you have a GitHub account, you can subscribe to the issues above to get notifications of any new developments related to this subject.
Thank you Very much for the info. I'll try the IDE v1 approach. Regarding the Standalone Decoder... is that the correct link you shared? It seems to send me to the IDE v1 Tools version.
You are welcome. I'm glad if I was able to be of assistance.
It is a link to the "Command line version" section of the IDE 1.x tool's readme, where the author of that tool shares a link to the command line version of the tool which is not IDE-dependent:
If you are searching for a command line version, look at EspStackTraceDecoder. EspStackTraceDecoder is based on the EspExceptionDecoder, but was completely rewritten for the command line usage.
If you would like a direct link to that tool, here it is:
UPDATE:
I've decoded the Exception using the approach described and could use some help understanding where the problem could be. Does anyone know how to navigate this information and help me understand what needs to be fixed in the code?
BTW, the abort happens about every 35 mins while running. From what I can tell this appears to be caused by the BLE Scanning, but that's about all I can interpret.
0x40083b75: panic_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/panic.c line 408
0x40092ea9: esp_system_abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/esp_system/esp_system.c line 137
0x40098a0d: abort at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/newlib/abort.c line 46
0x401986cf: __cxxabiv1::__terminate(void ()()) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc line 47
0x40198716: std::terminate() at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_terminate.cc line 57
0x40198677: __cxxabiv1::__cxa_throw(void, std::type_info*, void ()(void)) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/eh_throw.cc line 95
0x40198aa6: operator new(unsigned int) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/src/gcc/libstdc++-v3/libsupc++/new_op.cc line 54
0x401995ed: std::__cxx11::basic_string , std::allocator >::_M_create(unsigned int&, unsigned int) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/ext/new_allocator.h line 111
0x40199710: std::__cxx11::basic_string , std::allocator >::_M_mutate(unsigned int, unsigned int, char const*, unsigned int) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/bits/basic_string.tcc line 317
0x40199995: std::__cxx11::basic_string , std::allocator >::_M_append(char const*, unsigned int) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/bits/basic_string.tcc line 370
0x401999ee: std::__cxx11::basic_string , std::allocator >::append(char const*) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/bits/basic_string.h line 1268
0x40199a01: std::__cxx11::basic_string , std::allocator >::operator+=(char const*) at /builds/idf/crosstool-NG/.build/HOST-x86_64-w64-mingw32/xtensa-esp32-elf/build/build-cc-gcc-final/xtensa-esp32-elf/no-rtti/libstdc++-v3/include/bits/basic_string.h line 1178
0x400e013f: BLEAdvertisedDevice::toStringabi:cxx11 at C:\Users\Steve\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\BLE\src\BLEAdvertisedDevice.cpp line 549
0x400ddd87: MyAdvertisedDeviceCallbacks::onResult(BLEAdvertisedDevice) at D:\Arduinofiles\MCINFO\MCInfo_v6e/MCInfo_v6e.ino line 921
0x400e2d75: BLEScan::handleGAPEvent(esp_gap_ble_cb_event_t, esp_ble_gap_cb_param_t*) at C:\Users\Steve\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\BLE\src\BLEScan.cpp line 128
0x400e1962: BLEDevice::gapEventHandler(esp_gap_ble_cb_event_t, esp_ble_gap_cb_param_t*) at C:\Users\Steve\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.9\libraries\BLE\src\BLEDevice.cpp line 270
0x40104fe9: btc_gap_ble_cb_to_app at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/btc/profile/std/gap/btc_gap_ble.c line 70
0x401055d5: btc_gap_ble_adv_pkt_handler at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/host/bluedroid/btc/profile/std/gap/btc_gap_ble.c line 578
0x401320a9: osi_thread_generic_event_handler at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c line 425
0x4013203f: osi_thread_run at /Users/ficeto/Desktop/ESP32/ESP32S2/esp-idf-public/components/bt/common/osi/thread.c line 165
An exception appears to be thrown from operator new(std::size_t), which could indicate an out-of-memory condition, either because of actual memory usage, a memory leak, or memory fragmentation.
The BLE scans for TPMS broadcasts and then processes for display on the TFT. I've read BLE scanning can cause memory leaks/fragmentation, however, I'm not knowledgeable enough to figure out the issue.
I'll start a new post so as to close this one out since you were so kind to help me decode the issue... now to fixing it!