Skip to content

Running into a kernel panic when using as_GPS and Bluetooth aioble together #137

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ctschach opened this issue Mar 12, 2025 · 2 comments
Closed

Comments

@ctschach
Copy link

So I'm running MicroPython v1.24.1 on a Generic ESP32.

I do have several async routines:

  • a GPS reader that will get location and speed
  • a frequent Bluetooth Advertising scans to gather some data (using aioble library)
  • a function that will update an attached Nextion display

The the BLE Scanner and the Update Display are separated async functions that run totally fine.

The GPS reader is a "fake" async routine as it is using a regular uart.readline. So this is not really asynchronous ans blocking the other routines for the time it's reading and decoding data.

However, this works pretty fine all together.

But I wanted to make things better and use your wonderful as_GPS.py library to have a real asynchronous implementation. And it works fine reading from my device - without the Bluetooth Scanner.

As soon as my BLE scanning task is opening the Bluetooth device, the system runs into a kernel panic and reboots. This is repeatable, this happens always

I tried I don't think that this is. RAM issues and I still have around 83kb of free RAM available.

I know it's tough to help me here, but maybe someone has an idea what could cause the problem and how to solve it.

>>> BLE scan started
E (11733) BLE_INIT: hci inits failed

E (11733) BLE_INIT: nimble host init failed


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.1 on 2024-11-29
IDF version : v5.2.2
Machine     : Generic ESP32 module with ESP32

Guru Meditation Error: Core  1 panic'ed (LoadProhibited). Exception was unhandled.

Core  1 register dump:
PC      : 0x4012647a  PS      : 0x00060030  A0      : 0x80085434  A1      : 0x3ffdfbf0
A2      : 0x3ffc9b5c  A3      : 0xffffffff  A4      : 0x00060023  A5      : 0x3ffceb50
A6      : 0x00000003  A7      : 0x00000000  A8      : 0x8012643d  A9      : 0x3ffdfbd0
A10     : 0x00000000  A11     : 0x00000040  A12     : 0x00000000  A13     : 0x3ffcec40
A14     : 0x400fc1f0  A15     : 0x3f40a3b0  SAR     : 0x00000000  EXCCAUSE: 0x0000001c
EXCVADDR: 0x00000000  LBEG    : 0x00000000  LEND    : 0x00000000  LCOUNT  : 0x00000000

Rebooting...
ets Jul 29 2019 12:21:46

rst:0xc (SW_CPU_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:4892
ho 0 tail 12 room 4
load:0x40078000,len:14896
load:0x40080400,len:4
load:0x40080404,len:3372
entry 0x400805b0
@peterhinch
Copy link
Owner

I can't help much here as I lack experience with Bluetooth. In general asyncio applications never produce kernel panics. RAM errors produce the usual exception.

@ctschach
Copy link
Author

Looks like it's really a RAM issue. Just compiled MicroPython from the sources and freeze in some modules which gives me more free RAM and seems to have solved the issues.

Thanks Anyhow....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants