← index #17985Issue #17279
Off-topic · high · value 1.886
QUERY · ISSUE

BLE Crash

openby petrkropened 2025-08-26updated 2025-09-20
bugport-esp32

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

CANDIDATE · ISSUE

declaring an "big buffer" on esp32-s3 (16MB Flash & 8Mb RAM) need "long" time to recover connection after crash

closedby chf-6309opened 2025-05-10updated 2025-05-10
bug

Port, board and/or hardware

esp32-s3 "generic" (from AliExpress) YD-ESP32-23 / 2022-v1.3

MicroPython version

MicroPython v1.25.0 on 2025-04-15; Generic ESP32S3 module with Octal-SPIRAM with ESP32S3

Reproduction

#LCD TFT size
width = 320
height = 480

# === Create a framebuffer RGB888 (3 bytes per pixel) ===
def create_framebuffer(width, height):
    return bytearray(width * height * 3)  # 460800 bytes - 461KB

called from main program:
buf = create_framebuffer(width, height)

Expected behaviour

with 8MB available RAM, expect that, even is the buffer isn't used, the access to the esp32 card will be possible.
The size of that buffer should be around 460KB, small compared to the 8MB available

When my program crash during tests, after the buffer allowance, it need minutes or more, to recover the USB link to the card, or before I include an:

del buf
gc.collect()

at the end of the program.

The fastest way is to do an hard RESET

Observed behaviour

the esp32 need minutes (more than five) before communication with PC and (portable) Thonny v4.17 is (again) possible, without the use of the hard reset.

First I didn't use the "Generic ESP32S3 module with Octal-SPIRAM with ESP32S3" firmware, so, the available RAM was little as ~300KB. Withe the Octal version I get;

Mémoire libre : **8312704 octets** [free memory]
stack: 736 out of 15360
GC: total: 64000, used: 8832, free: 55168, max new split: 8257536
 No. of 1-blocks: 176, 2-blocks: 22, max blk sz: 32, max free sz: 3410

MicroPython v1.25.0 on 2025-04-15; Generic ESP32S3 module with Octal-SPIRAM with ESP32S3

Type "help()" for more information.

>>> import gc
>>> gc.mem_alloc()
**10640**
>>> gc.mem_free()
**7785024**

Additional Information

No, I've provided everything above.

Code of Conduct

Yes, I agree

Keyboard

j / / n
next pair
k / / p
previous pair
1 / / h
show query pane
2 / / l
show candidate pane
c
copy suggested comment
r
toggle reasoning
g i
go to index
?
show this help
esc
close overlays

press ? or esc to close

copied