SerialBT.available() throws exception
Posted: Tue Nov 29, 2022 11:36 pm
Hello,
I have a code, that regularly (every 5ms) calls a function from loop(), that decodes incoming serial protocols from SerialBT. Before reading the buffer it is checked by SerialBT.available() to go on with reading and decoding state machine.
The ESP32 WROOM-32E throws:
Guru Meditation Error: Core 1 panic'ed (LoadStoreAlignment). Exception was unhandled.
Core 1 register dump:
PC : 0x40092186 PS : 0x00060133 A0 : 0x80091084 A1 : 0x3ffc8780
A2 : 0x3ffbac59 A3 : 0x0000abab A4 : 0xb33fffff A5 : 0x00000001
A6 : 0x00060120 A7 : 0x0000cdcd A8 : 0x0000abab A9 : 0x3ffc8770
A10 : 0x00000000 A11 : 0x3ffc88fc A12 : 0x00000001 A13 : 0x00000001
A14 : 0x00060520 A15 : 0x00000000 SAR : 0x00000018 EXCCAUSE: 0x00000009
EXCVADDR: 0x3ffbac59 LBEG : 0x4000c28c LEND : 0x4000c296 LCOUNT : 0x00000000
ELF file SHA256: 0000000000000000
Backtrace: 0x40092186:0x3ffc8780 0x40091081:0x3ffc87b0 0x400d3ffd:0x3ffc87d0 0x400d1775:0x3ffc87f0 0x400d2a8b:0x3ffc8810 0x400d6da0:0x3ffc8840 0x4009116a:0x3ffc8860
The exception decoder outputs the following:
Decoding stack results:
0x40092186: vTaskEnterCritical at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/include/freertos/portmacro.h line 353
0x40091081: uxQueueMessagesWaiting at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c line 1749
0x400d3ffd: BluetoothSerial::available() at C:\Users\user\.platformio\packages\framework-arduinoespressif32\libraries\BluetoothSerial\src\BluetoothSerial.cpp line 670
0x400d1775: ProcessProt(unsigned char) at src\prot.cpp line 210
0x400d2a8b: loop() at src\main.cpp line 1174
0x400d6da0: loopTask(void*) at C:\Users\user\.platformio\packages\framework-arduinoespressif32\cores\esp32\main.cpp line 23
0x4009116a: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
The exceptions are different, sometimes LoadStoreAlignment, sometimes LoadProhibited, sometimes abort() called.
Generally the firmware does what it should do but it crashes after unpredictable times. I cannot isolate the condition when it throws. Sometimes is runs for several minutes up to hours without exception. After another start it crashes after 2 minutes.
All exception decoding points to the SerialBT.available(). Occurs with and without active Bluetooth connection.
Code is made with VisualStudioCode, PlatformIO, Arduino framework.
Would be really glad if somebody could help.
Thanks
I have a code, that regularly (every 5ms) calls a function from loop(), that decodes incoming serial protocols from SerialBT. Before reading the buffer it is checked by SerialBT.available() to go on with reading and decoding state machine.
The ESP32 WROOM-32E throws:
Guru Meditation Error: Core 1 panic'ed (LoadStoreAlignment). Exception was unhandled.
Core 1 register dump:
PC : 0x40092186 PS : 0x00060133 A0 : 0x80091084 A1 : 0x3ffc8780
A2 : 0x3ffbac59 A3 : 0x0000abab A4 : 0xb33fffff A5 : 0x00000001
A6 : 0x00060120 A7 : 0x0000cdcd A8 : 0x0000abab A9 : 0x3ffc8770
A10 : 0x00000000 A11 : 0x3ffc88fc A12 : 0x00000001 A13 : 0x00000001
A14 : 0x00060520 A15 : 0x00000000 SAR : 0x00000018 EXCCAUSE: 0x00000009
EXCVADDR: 0x3ffbac59 LBEG : 0x4000c28c LEND : 0x4000c296 LCOUNT : 0x00000000
ELF file SHA256: 0000000000000000
Backtrace: 0x40092186:0x3ffc8780 0x40091081:0x3ffc87b0 0x400d3ffd:0x3ffc87d0 0x400d1775:0x3ffc87f0 0x400d2a8b:0x3ffc8810 0x400d6da0:0x3ffc8840 0x4009116a:0x3ffc8860
The exception decoder outputs the following:
Decoding stack results:
0x40092186: vTaskEnterCritical at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/include/freertos/portmacro.h line 353
0x40091081: uxQueueMessagesWaiting at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/queue.c line 1749
0x400d3ffd: BluetoothSerial::available() at C:\Users\user\.platformio\packages\framework-arduinoespressif32\libraries\BluetoothSerial\src\BluetoothSerial.cpp line 670
0x400d1775: ProcessProt(unsigned char) at src\prot.cpp line 210
0x400d2a8b: loop() at src\main.cpp line 1174
0x400d6da0: loopTask(void*) at C:\Users\user\.platformio\packages\framework-arduinoespressif32\cores\esp32\main.cpp line 23
0x4009116a: vPortTaskWrapper at /home/runner/work/esp32-arduino-lib-builder/esp32-arduino-lib-builder/esp-idf/components/freertos/port.c line 143
The exceptions are different, sometimes LoadStoreAlignment, sometimes LoadProhibited, sometimes abort() called.
Generally the firmware does what it should do but it crashes after unpredictable times. I cannot isolate the condition when it throws. Sometimes is runs for several minutes up to hours without exception. After another start it crashes after 2 minutes.
All exception decoding points to the SerialBT.available(). Occurs with and without active Bluetooth connection.
Code is made with VisualStudioCode, PlatformIO, Arduino framework.
Would be really glad if somebody could help.
Thanks