ports/stm32: Add Zephyr BLE support for WB55 and PYBD.#20
Draft
andrewleech wants to merge 2 commits intopr/zephyr-ble-corefrom
Draft
ports/stm32: Add Zephyr BLE support for WB55 and PYBD.#20andrewleech wants to merge 2 commits intopr/zephyr-ble-corefrom
andrewleech wants to merge 2 commits intopr/zephyr-ble-corefrom
Conversation
9a8ad56 to
6c8c6df
Compare
ba9ebb7 to
86b9e6a
Compare
6c8c6df to
24302ac
Compare
86b9e6a to
123460b
Compare
24302ac to
59ff3cf
Compare
123460b to
8e853d6
Compare
59ff3cf to
372dab7
Compare
8e853d6 to
7e0b581
Compare
372dab7 to
39ec763
Compare
7e0b581 to
86dba95
Compare
39ec763 to
a78beb8
Compare
86dba95 to
edf2fd6
Compare
Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
Add Zephyr BLE variant configuration for PYBD_SF6 board, with HCI UART readpacket support for bulk reading from the BT coprocessor. Signed-off-by: Andrew Leech <andrew.leech@planetinnovation.com.au>
a78beb8 to
9555510
Compare
edf2fd6 to
c408c95
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
Adds Zephyr BLE integration for the STM32 port, targeting the NUCLEO_WB55 and PYBD_SF6 boards. The WB55's BLE controller runs on the M0+ coprocessor (CPU2) and communicates with the M4 host via IPCC mailbox — the HCI driver in
mpzephyrport.cbridges this to the Zephyr BLE host's H4 transport.The IPCC/rfcore integration required careful handling of the CPU2 lifecycle: HCI_Reset must not be sent to CPU2 as it corrupts all 192KB of SRAM1. This is prevented by a
drv_quirk_no_reset()hook in the Zephyr host'shci_core.c.Build variants:
NUCLEO_WB55 BOARD_VARIANT=zephyr_bleandPYBD_SF6 BOARD_VARIANT=zephyr_ble.Depends on #19.
Testing
11/11 BLE multitests passing on WB55 with nRF52840 DK as peripheral. PYBD variant builds but has not been tested with Zephyr BLE (PYBD is primarily used as a NimBLE reference central).
Trade-offs and Alternatives
The STM32 integration touches several files beyond the BLE-specific code (linker scripts, FreeRTOS hooks, system_stm32 changes) because the WB55's dual-core architecture and IPCC memory layout require careful memory section placement. These changes are guarded by
MICROPY_BLUETOOTH_ZEPHYRdefines where possible.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.