Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

BLE init failures can cause infinite loop in scheduler #17246

Open
Labels
@andrewleech

Description

@andrewleech

Port, board and/or hardware

stm32wb55

MicroPython version

master branch, slightly newer than v1.25

Reproduction

On a stm32wb55 based board with the rfcore (WS) firmware blob wiped / damaged.

from bluetooth import BLEBLE().active(1)

Ends up stuck withtl_ble_wait_resp: timeout repeated on the command line every few seconds.

Expected behaviour

Thetl_ble_wait_resp: timeout message is expected due to lack of response from the rfcore, however there is a timeout in C so this should only retry a limited number of times (2 seconds worth) before aborting with a Timeout error:

mp_uint_ttimeout_start_ticks_ms=mp_hal_ticks_ms();

Observed behaviour

Instead, thetl_ble_wait_resp: timeout message repeats forever. On my application this cannot be ctrl-c interrupted, it reboots after some time only because we have a WDT running.

Additional Information

I've debugged the issue down to the scheduler, specifically the C STATIC_NODES section of it:

Image

In this case the C scheduler is used to runmp_bluetooth_hci_poll(). Due to timeout trying to communicate with hci able_hs_reset() gets run on the nimble os_eventq which starts by resetting the hci transport.
That flows through to mp_bluetooth_hci_uart_init() which itself starts the hci polling...

Image

This re-inserts the hci poll function into head of the c schedule linked list meaing it's ready to be run immediately, forming an infinite loop inmp_sched_run_pending()

Code of Conduct

Yes, I agree

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp