ports/zephyr: Switch BLE to extmod/zephyr_ble integration.#21
Draft
andrewleech wants to merge 3 commits intopr/zephyr-ble-stm32from
Draft
ports/zephyr: Switch BLE to extmod/zephyr_ble integration.#21andrewleech wants to merge 3 commits intopr/zephyr-ble-stm32from
andrewleech wants to merge 3 commits intopr/zephyr-ble-stm32from
Conversation
ba9ebb7 to
86b9e6a
Compare
209f127 to
e5ef1fe
Compare
86b9e6a to
123460b
Compare
e5ef1fe to
1b4ef75
Compare
123460b to
8e853d6
Compare
1b4ef75 to
67b0f9a
Compare
8e853d6 to
7e0b581
Compare
67b0f9a to
ced1184
Compare
7e0b581 to
86dba95
Compare
4442799 to
08fc8bd
Compare
86dba95 to
edf2fd6
Compare
Replace the native Zephyr port's custom BLE bindings with the shared extmod/zephyr_ble integration layer. This unifies the BLE API across all ports using Zephyr BLE, with the native Zephyr port using Zephyr's own kernel primitives instead of the HAL shim stubs. Includes machine.idle() fix to yield to Zephyr threads, and test fixes for nRF52840 DK BLE multitests. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Enable synchronous BLE events and increase UART RX buffer to 512 bytes for reliable raw-paste operation on the nRF52840 DK. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
The nRF52840 DK's USB CDC ACM console was unreliable — device enumeration failures and stalls during raw-paste mode. Switch to UART via JLink OB (uart0 with hw-flow-control) which is always available. Move USB device stack init from mp_task (after console init) to zephyr_start.c main() (before console init) so CDC ACM UART is ready when the console subsystem opens the device. Add DTR wait for CDC ACM console boards so output isn't lost before a host connects. Reduce MICROPY_REPL_STDIN_BUFFER_MAX to 64 (raw-paste window=32 bytes) to avoid overflowing USB-UART bridge buffers at 115200 baud. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
edf2fd6 to
c408c95
Compare
08fc8bd to
4e2de49
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replaces the Zephyr port's standalone
modbluetooth_zephyr.c(~1000 lines) with the sharedextmod/zephyr_bleintegration layer. Since the Zephyr port already runs on Zephyr RTOS, the HAL shims mostly pass through to real Zephyr APIs, but using the shared extmod means BLE feature work and bug fixes apply to all ports simultaneously.Also switches the nRF52840 DK board config from USB CDC ACM console to UART via JLink OB bridge. The Zephyr USB device_next stack has a CDC ACM RX regression (bulk OUT endpoints get STALLed) which makes USB console unreliable.
Depends on #20.
Testing
All 12 BLE multitests passing on nRF52840 DK (Zephyr port) with PYBD as central. UART console with
hw-flow-controloverlay working reliably.Generative AI
I used generative AI tools when creating this PR, but a human has checked the code and is responsible for the description above.