Skip to content

Tracking: Pico W / Pico 2 W Bluetooth via the CYW43439 shared gSPI bus #15

Description

@tyeth

Umbrella for the CYW43439 shared-bus Bluetooth work, so nothing here is untracked. Both boards are verified working on hardware: patchram loads over the shared gSPI bus, the controller reports the expected OTP-derived BD_ADDR, and a legacy LE scan returns real advertisers.

Based on the reference implementation in beriberikix/zephyr-cyw43-driver, proposed upstream as zephyrproject-rtos/zephyr#111811 (closed not_planned by the stale bot, not on merit).

State as of 2026-09-09 (rebased onto main 121489fe70)

main moved between the first PRs and now, and two things it did changed this stack:

Pull requests

This repo — stack: main#5#4#14

PR Base Head Contents
#5 main 5f0ea1254a debug UDC thread stack (independent)
#4 #5 bb410ab164 Pico 2 W BLE enablement + settings partition fix
#14 #4 8d2023c6b5 Pico W BLE enablement + settings partition fix
#17 main 74e414d323 README "Board overlay pitfalls" (rework of #13's second commit)
#13 main closed — ranges; fix landed upstream as ffd62e1c59

Module forks

PR Contents
tyeth/zephyr#2 USB DPRAM unaligned-access fix (independent)
tyeth/zephyr#1 CYW43 shared-bus HCI driver (stacked on #2)
tyeth/hal_rpi_pico#1 cybt ring-index re-read hardening
tyeth/hal_rpi_pico#2 flash helper RAM placement (independent)
tyeth/hal_infineon#1 Murata-1YN BT coex NVRAM

⚠️ No single hal_rpi_pico branch builds working firmware — both its commits must be combined (currently integration-pico2w-ble, see #12).

Build (post-rebase heads, local zephyr tree with the driver)

Pico 2 W Pico W
FLASH 1,146,096 B / 1528 KB = 73.25% 1,181,372 B / 1,564,416 B = 75.52%
RAM 229,144 B / 520 KB = 43.03% 228,044 B / 264 KB = 84.36%
CONFIG_BT / CONFIG_BT_CYW43_SHARED_BUS y / y y / y
check_partitions.py matches raspberry_pi_pico2_w matches raspberry_pi_pico_w

CI verification

The reviewable PRs still cannot link — #16 — but the build is now verified green in CI for both
boards
on ci/pico2w-ble-assets (94bfd47b5f), which sits on top of this stack and adds one
CI-only commit overriding zephyr/hal_rpi_pico/hal_infineon in zephyr-config/west.yml to the
fork branches. That override needs tyeth/zephyr#1 to exist, not to merge, so CI verification is
decoupled from upstream review. The branch is now 0 commits behind main (was 229) and therefore
exercises the current boards/<vendor>/<board>/ layout.

Pico 2 W Pico W
run 34287512362 34287514167
FLASH 1,146,092 B = 73.25% 1,181,368 B = 75.51%
RAM 229,144 B = 43.03% 228,044 B = 84.36%
artifact (expires 2026-12-07) 8,852,015 B 8,912,451 B

CI matched the local builds to within 4 bytes of flash and exactly on RAM. The Pico W run reports
BOOT_FLASH 256 B 100.00% — a positive check that .boot2 is linked, i.e. the #6 failure mode
tested rather than inferred. This is also the first CI build of the Pico W BLE firmware; previously
only the Pico 2 W had an asset.

⚠️ Dispatching this workflow on a fork needs both --ref and -f branch=--ref only
selects the workflow file, while the checkout uses the branch input (default main), so a
--ref-only dispatch silently builds main and yields an artifact with no Bluetooth in it.

Issues

Issue State Summary
#6 closed RP2040 boards unbootable — missing ranges (fixed upstream, ffd62e1c59)
#7 closed Same defect in the STM32WBA overlay (fixed upstream, same commit)
#8 open BT_EXT_ADV defaults on port-wide, asserting a capability not all controllers have
#9 open start_scan(extended=) silently ignored
#10 open boot_out.txt stale version on incremental builds
#11 open tests / zephyr CI job red — cause not established; being re-evidenced post-rebase on #5's run
#12 open CI-only west.yml override must not merge; depends on an unreviewed branch
#16 open BLE branches cannot link in CI: HCI driver absent from pinned zephyr revision (also root-causes #13's missing Build CI run: stale base → no merge commit → no pull_request run). Path now verified green via the override branch — see above
#18 open release builds lose USB during BLE activity — the #5 UDC stack fix is debug.conf-only (verified on hardware; +unexplained post-scan stall)
tyeth/zephyr#3 open settings_nvs reads an uninitialized struct when a partition holds zero sectors
tyeth/hal_rpi_pico#3 open cybt HOST_CTRL cache makes a corruption check vacuous

Seven defects were fixed to get here — only one was mine

Defect Mine?
Unaligned memcpy into USB DPRAM (M33 widens transfers; M0+ didn't) no
UDC_RPI_PICO_STACK_SIZE 512 B under immediate logging no
storage_partition 2 KB & misaligned → NVS -EDOM (now: 4 KB upstream → NVS -EINVAL, still needs two sectors) no
Stale settings sectors → NVS -EDEADLK no
flash_enable_write emitted to XIP, called with XIP off → silent core hang no
cyw43_btbus_init(NULL) — cybt NULL-checks the handle as a sentinel yes
BT_EXT_ADV on a controller lacking extended advertising no

Known limits

  • Extended advertising is not available on this controller and cannot be made so host-side: the CYW43439 reports the feature bit clear and rejects the commands. The in-tree hal_infineon .hcd is not an alternative — it is the same CYW4343A2 firmware family at an older patch level (...0031 vs pico-sdk's ...0065) and built for UART transport, not the shared bus.
  • The georgerobotics cyw43-driver submodule supplies the controller patchram and is under LICENSE.RP, which permits use only alongside Raspberry Pi silicon. Fine for these boards; a blocker for upstreaming to Zephyr proper.
  • Measuring anything timing-sensitive on a debug.conf build is unsafe: LOG_MODE_IMMEDIATE formats and transmits in-thread over a 115200 UART and manufactured an apparent 12.5 s HCI stall that does not exist in release builds (first-detection latency ~9,700 ms debug vs 22 ms release).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions