Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork8.3k
extmod/nimble: Add timeout to deinit.#17247
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
codecovbot commentedMay 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@## master #17247 +/- ##======================================= Coverage 98.54% 98.54% ======================================= Files 169 169 Lines 21898 21898 ======================================= Hits 21579 21579 Misses 319 319 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
github-actionsbot commentedMay 5, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
Code size report:
|
Uh oh!
There was an error while loading.Please reload this page.
Should extend this to more closely match the init functionality with regard to raising exceptions on failure |
d33dd07
to5ddd3d2
CompareUh oh!
There was an error while loading.Please reload this page.
3a4c672
tob343d5b
CompareIf the BLE radio stops responding before deinit is called the function canget stuck waiting for an event that is never received, particularly if theradio is external or on a separate core.This commit adds a timeout, similar to the timeout already used in the initfunction. Updated for nimble, btstack, esp32 and zephyr bindings.Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
d5f2fc2
intomicropython:masterUh oh!
There was an error while loading.Please reload this page.
Summary
If the BLE radio stops responding before deinit is called the function can get stuck waiting for an event that is never received, particularly if the radio is external or on a separate core.
This PR adds a timeout, similar to the timeout already used in the init function. That init function timeout was also
simplified as part of this change.
Relates to#17246
Testing
This has been tested on a stm32wb55 where the deinit was intermittently locking up waiting for the state to change.
This happened on a semi-regular basis on an application automated test suite which was running through hundreds of cycles over a number of hours.
Trade-offs and Alternatives
The main alternative to this is relying on watchdog to break the unit out of the infinite C loop once the failure occurs, but this is not appropriate for all applications.