Content-Length: 274927 | pFad | http://github.com/micropython/micropython/pull/17264

DD all/mpbthciport.c: Don't restart BLE polling if already running. by andrewleech · Pull Request #17264 · micropython/micropython · GitHub
Skip to content

all/mpbthciport.c: Don't restart BLE polling if already running. #17264

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andrewleech
Copy link
Contributor

Summary

When nimble stack schedules a reset (ble_hs_reset) it's handled in mp_bluetooth_nimble_os_eventq_run_all() which itself is run in mp_bluetooth_hci_poll().

The stack reset process starts with running mp_bluetooth_hci_uart_deinit then mp_bluetooth_hci_uart_init. The init function ends with mp_bluetooth_hci_start_polling(); which brings us to this PR, a C scheduled hci poll can result in a re-schedule of itself in the event of a stack reset (failure / non-resonse detected from radio).

This was first discovered in #17246

Testing

This has been tested on a stm32wb55 with the radio firware wiped so the nimble stack continually attempts to re-init the hci connection.

Trade-offs and Alternatives

This issue can also be avoided with the C scheduler loop break first proposed in af4a8e9

Copy link

github-actions bot commented May 7, 2025

Code size report:

   bare-arm:    +0 +0.000% 
minimal x86:    +0 +0.000% 
   unix x64:    +0 +0.000% standard
      stm32:    +0 +0.000% PYBV10
     mimxrt:    +0 +0.000% TEENSY40
        rp2:    +0 +0.000% RPI_PICO_W
       samd:    +0 +0.000% ADAFRUIT_ITSYBITSY_M4_EXPRESS
  qemu rv32:    +0 +0.000% VIRT_RV32

@andrewleech andrewleech force-pushed the nimble_init_timeout branch from adfe758 to 262d82a Compare May 7, 2025 05:54
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
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

Successfully merging this pull request may close these issues.

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/micropython/micropython/pull/17264

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy