BLE Crash
Port, board and/or hardware
esp32, esp32-s3
MicroPython version
MPY version : v1.26.0 on 2025-08-09
IDF version : v5.4.2
Machine : Generic ESP32S3 module with Octal-SPIRAM with ESP32S3
Reproduction
- Install micropython 1.24 or 1.26
- Install octopuslab helpers for bluetooth, so you do not need to write whole bluetooth stack from scratch
- https://github.com/octopuslab-cz/esp32_micropython_framework/blob/main/lib/blesync_uart/server.py
- install example https://github.com/octopuslab-cz/esp32_s3_robotics/blob/main/iot/test_ble_led.py
run it
bluetooth device will appear, connect there from Blefruit Connect app
Try for to send something. Micropython will crash..
do not know which version was last where it works. probably around 1.18 or something
Expected behaviour
Working UART bluetooth/ble service and not crashing micropython.
Or at least some useful error message if helper code needs to be updated.
Observed behaviour
Stack trace
~/.e/t/x/e/x/bin> ./xtensa-esp32s3-elf-addr2line -pfiaC -e ~/down/ESP32_GENERIC_S3-SPIRAM_OCT-20250809-v1.26.0.elf 0x4202a18a:0x3fcb4670 0x42034943:0x3fcb4690 0x40379e81:0x3fcb46f0 0x4202c8ff:0x3fcb4790 0x42034291:0x3fcb4800 0x42034319:0x3fcb4820 0x42034fd8:0x3fcb4850 0x42035225:0x3fcb48d0 0x42024685:0x3fcb4900 0x42044491:0x3fcb4920 0x42044d9f:0x3fcb4940 0x42024220:0x3fcb4980
0x4202a18a: mp_obj_get_type at /home/micropython/micropython-autobuild/py/obj.c:69
(inlined by) mp_obj_len_maybe at /home/micropython/micropython-autobuild/py/obj.c:563
0x42034943: mp_call_prepare_args_n_kw_var at /home/micropython/micropython-autobuild/py/runtime.c:777
(inlined by) mp_call_method_n_kw_var at /home/micropython/micropython-autobuild/py/runtime.c:951
0x40379e81: mp_execute_bytecode at /home/micropython/micropython-autobuild/py/vm.c:1030
0x4202c8ff: fun_bc_call at /home/micropython/micropython-autobuild/py/objfun.c:295
0x42034291: mp_call_function_n_kw at /home/micropython/micropython-autobuild/py/runtime.c:727
0x42034319: mp_call_function_1 at /home/micropython/micropython-autobuild/py/runtime.c:705
0x42034fd8: mp_call_function_1_protected at /home/micropython/micropython-autobuild/py/runtime_utils.c:33
0x42035225: mp_sched_run_pending at /home/micropython/micropython-autobuild/py/scheduler.c:115
(inlined by) mp_handle_pending at /home/micropython/micropython-autobuild/py/scheduler.c:250
0x42024685: mp_hal_stdin_rx_chr at /home/micropython/micropython-autobuild/ports/esp32/mphalport.c:141
0x42044491: readline at /home/micropython/micropython-autobuild/shared/readline/readline.c:560
0x42044d9f: pyexec_friendly_repl at /home/micropython/micropython-autobuild/shared/runtime/pyexec.c:606 (discriminator 1)
0x42024220: mp_task at /home/micropython/micropython-autobuild/ports/esp32/main.c:166
Code
import ble_led
---> BLE - led
This is simple Micropython example | ESP32 & octopusLAB
BLE ESP32 device name: octopus-led-68d50
@blesync_server.on_connect
A fatal error occurred. The crash dump printed below may be used to help
determine what caused it. If you are not already running the most recent
version of MicroPython, consider upgrading. New versions often fix bugs.
To learn more about how to debug and/or report this crash visit the wiki
page at: https://github.com/micropython/micropython/wiki/ESP32-debugging
MPY version : v1.26.0 on 2025-08-09
IDF version : v5.4.2
Machine : Generic ESP32S3 module with Octal-SPIRAM with ESP32S3
Guru Meditation Error: Core 1 panic'ed (LoadProhibited). Exception was unhandled.
Core 1 register dump:
PC : 0x4202a18d PS : 0x00060730 A0 : 0x82034946 A1 : 0x3fcb4670
A2 : 0x3fcd39a0 A3 : 0x3fcb47a4 A4 : 0x00000004 A5 : 0x00000000
A6 : 0x3fcb6b30 A7 : 0x00000001 A8 : 0x3c160154 A9 : 0x8206c3f0
A10 : 0x3fcbcae0 A11 : 0x3fcd39a0 A12 : 0x00000000 A13 : 0x3fcb74a4
A14 : 0x3fcbc3b0 A15 : 0x3fcb4b08 SAR : 0x00000013 EXCCAUSE: 0x0000001c
EXCVADDR: 0x8206c3fb LBEG : 0x42034ca1 LEND : 0x42034caa LCOUNT : 0x00000000
Backtrace: 0x4202a18a:0x3fcb4670 0x42034943:0x3fcb4690 0x40379e81:0x3fcb46f0 0x4202c8ff:0x3fcb4790 0x42034291:0x3fcb4800 0x42034319:0x3fcb4820
0x42034fd8:0x3fcb4850 0x42035225:0x3fcb48d0 0x42024685:0x3fcb4900 0x42044491:0x3fcb4920 0x42044d9f:0x3fcb4940 0x42024220:0x3fcb4980
ELF file SHA256: 33ce41e10
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree
ESP32C3 and C6: Stack protection fault on IDF 5.2.2
Port, board and/or hardware
PORT: esp32, BOARD: esp32c6-devkitc-1
MicroPython version
v1.24.0-preview. forked at e9814e987bcc816fb67e38748a5afce466c45606. with #11869 applied for C6 support.
https://github.com/mzakharocsc/micropython/tree/c6
Reproduction
Code:
https://github.com/mzakharocsc/micropython/blob/c6/ports/esp32/modules/main.py
Edit file with your wifi SSID/PASSWORD. Start your MQTT broker ( I used mosquitto). Edit config['server'] = '192.168.50.31' with your broker IP address. Connect the board to UART port, Inside ports/esp32, make BOARD=ESP32_GENERIC_C6 deploy and monitor.
Code has to be run from main.py on board startup for some reason to reproduce this.
Expected behaviour
Expecting the board on startup to connect to a broker and publish continously without crashing. Code does not crash on IDF 5.1.4. On IDF 5.2.2, code crashes after a few minutes of runtime.
Observed behaviour
A fatal error occurred. The crash dump printed below may be used to help
determine what caused it. If you are not already running the most recent
version of MicroPython, consider upgrading. New versions often fix bugs.
To learn more about how to debug and/or report this crash visit the wiki
page at: https://github.com/micropython/micropython/wiki/ESP32-debugging
MPY version : v1.24.0-preview.209.gb5f390386.dirty on 2024-08-16
IDF version : v5.2.2
Machine : ESP32C6 module with ESP32C6
Guru Meditation Error: Core 0 panic'ed (Stack protection fault).
Detected in task "mp_task" at 0x4200e4fc
0x4200e4fc: nlr_jump at /home/mzakharo/station/micropythonc6x/py/nlrrv32.c:55
Stack pointer: 0x4082e8a0
Stack bounds: 0x40826d5c - 0x4082ed50
Core 0 register dump:
Stack dump detected
MEPC : 0x420196f8 RA : 0x40803aac SP : 0x4082e8a0 GP : 0x40818e94
0x420196f8: mp_obj_is_subclass_fast at /home/mzakharo/station/micropythonc6x/py/objtype.c:1364
0x40803aac: mp_execute_bytecode at /home/mzakharo/station/micropythonc6x/py/vm.c:1382 (discriminator 1)
TP : 0x407ecb7c T0 : 0x40022494 T1 : 0x4081321c T2 : 0x0000003f
0x40022494: multi_heap_internal_unlock in ROM
0x4081321c: vTaskSuspend at /home/mzakharo/esp-idf2/components/freertos/FreeRTOS-Kernel/tasks.c:1977
S0/FP : 0x40838518 S1 : 0x40838558 A0 : 0x4219e010 A1 : 0x4219e010
A2 : 0x00000000 A3 : 0x00000100 A4 : 0x0000000e A5 : 0x4082e9a0
A6 : 0x00000001 A7 : 0x00000002 S2 : 0x421a09f4 S3 : 0x408385b0
S4 : 0x0000003c S5 : 0x4219e000 S6 : 0x00000068 S7 : 0x4219e2d0
S8 : 0x4081c000 S9 : 0x4219e000 S10 : 0x421a8b20 S11 : 0x421a8b1b
T3 : 0x00000000 T4 : 0x00002b3a T5 : 0x00000003 T6 : 0x00000001
MSTATUS : 0x00001881 MTVEC : 0x40800001 MCAUSE : 0x0000001b MTVAL : 0x00001101
0x40800001: _vector_table at ??:?
MHARTID : 0x00000000
Backtrace:
mp_obj_is_subclass_fast (object=0x4219e010 <mp_type_StopIteration>, classinfo=0x4219e010 <mp_type_StopIteration>) at /home/mzakharo/station/micropythonc6x/py/objtype.c:1364
1364 bool mp_obj_is_subclass_fast(mp_const_obj_t object, mp_const_obj_t classinfo) {
#0 mp_obj_is_subclass_fast (object=0x4219e010 <mp_type_StopIteration>, classinfo=0x4219e010 <mp_type_StopIteration>) at /home/mzakharo/station/micropythonc6x/py/objtype.c:1364
#1 0x40803aac in mp_execute_bytecode (code_state=code_state@entry=0x40838518, inject_exc=inject_exc@entry=0x0) at /home/mzakharo/station/micropythonc6x/py/vm.c:1382
#2 0x4201257a in mp_obj_gen_resume (self_in=0x40838510, send_value=<optimized out>, throw_value=throw_value@entry=0x0, ret_val=ret_val@entry=0x4082e96c) at /home/mzakharo/station/micropythonc6x/py/objgenerator.c:210
#3 0x420126f4 in gen_resume_and_raise (raise_stop_iteration=true, throw_value=0x0, send_value=<optimized out>, self_in=<optimized out>) at /home/mzakharo/station/micropythonc6x/py/objgenerator.c:259
#4 gen_instance_send (self_in=<optimized out>, send_value=<optimized out>) at /home/mzakharo/station/micropythonc6x/py/objgenerator.c:286
#5 0x408040b8 in mp_execute_bytecode (code_state=code_state@entry=0x408347c0, inject_exc=inject_exc@entry=0x0) at /home/mzakharo/station/micropythonc6x/py/vm.c:1042
#6 0x4201207a in fun_bc_call (self_in=<optimized out>, n_args=1, n_kw=0, args=0x4082eb08) at /home/mzakharo/station/micropythonc6x/py/objfun.c:267
#7 0x00000000 in ?? ()
Backtrace stopped: frame did not save the PC
ELF file SHA256: aa26cad08
Rebooting...
Additional Information
No, I've provided everything above.
Code of Conduct
Yes, I agree