zephyr-cp: enable BLE on the Raspberry Pi Pico W - #14
Conversation
|
Not the same failure as #11, which is the 🤖 Generated with Claude Code |
Same CYW43439 as the Pico 2 W, and the shared-bus HCI driver needed no board-specific work, so this is the Pico 2 W change applied to the RP2040 board: - overlay: hang the infineon,cyw43-bt-hci node off the stock infineon,airoc-wifi node and point zephyr,bt-hci at it. - overlay: the settings partition had the same defect as the Pico 2 W's -- originally 2K at 0x180800, neither erase-sector aligned nor big enough for one of the RP2040's 4K sectors; main has since made it one aligned 4K sector at 0x17f000, which is still one short of the two nvs_mount() insists on, so bt_enable() fails before opening the HCI driver. Give settings two sectors at 0x17e000, taken from the code partition. nvm and circuitpy stay at 0x180000 and 0x181000 to match ports/raspberrypi (cptools/check_partitions.py checks this), so CIRCUITPY is not moved. - conf: BT_EXT_ADV=n, since this controller rejects the Bluetooth 5 extended advertising commands, plus a deeper system workqueue stack. HW_STACK_PROTECTION is deliberately left off here: it earned its place on the Cortex-M33 but costs RAM, and this is the constrained board. Builds at 68.67% flash and 84.32% RAM of 264K, so BLE fits with about 42K to spare. Verified on hardware after the "ranges" fix (now on main): the adapter comes up as WiFi MAC + 2 and a legacy LE scan returns nearby advertisers. That run used the earlier layout with settings at 0x181000; the 0x17e000 placement is build-tested only. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
f4d3e59 to
bb410ab
Compare
|
Rebased onto What moved.
Git followed the renames;
Build on the new head (
RAM is essentially unchanged from the description (84.32% → 84.36%); flash is up from 68.67% because the code partition is 8K smaller and Caveats: the hardware run in the description used the earlier 🤖 Generated with Claude Code |
8ac1521 to
8d2023c
Compare
Stacked on #4 (Pico 2 W BLE). Rebased onto
main121489fe70on 2026-09-08 — the RP2040 boot fix this once needed from #13 is onmain(ffd62e1c59), so the image boots on its own.Same CYW43439 as the Pico 2 W, and the shared-bus HCI driver needed no board-specific code. Only per-board devicetree/config changes were required:
infineon,cyw43-bt-hcinode off the stockinfineon,airoc-wifinode and pointzephyr,bt-hciat it.0x180800, neither erase-sector aligned nor large enough for one of the RP2040's 4 KB sectors;mainhas since made it one aligned 4 KB sector at0x17f000, which is still one short of the twonvs_mount()insists on (-EINVAL), sobt_enable()fails before opening the HCI driver.storagebecomes 8 KB at0x17e000, taking the extra sector from the code partition.nvm(0x180000) andcircuitpy(0x181000) stay whereports/raspberrypihas them, ascptools/check_partitions.pyrequires, so CIRCUITPY is not reformatted.BT_EXT_ADV=n(this controller rejects the Bluetooth 5 extended commands — see zephyr-cp: BT_EXT_ADV defaults on for every board, asserting a controller capability that is not universal #8) plus a deeper system workqueue stack.HW_STACK_PROTECTIONis deliberately left off here. It earned its place on the Cortex-M33, where it turned several silent corruptions into clean named faults, but it costs RAM and this is the constrained board (and the RP2040 has no MPU anyway).Verified on hardware
First advertiser at 113 ms, then continuous tracking. The board's WiFi MAC is
2C:CF:67:D8:D4:A3and the BLE adapter comes up as...:D8:D4:A5— MAC + 2, this part's OTP offset, derived through the CYW43439 shared-bus path (the Pico 2 W's is MAC + 1).That run used the pre-rebase layout (settings at
0x181000). The0x17e000placement is build-tested only so far.Size (post-rebase head)
BLE costs about 26 KB of RAM here. Tight but it fits with no stack trimming.
CI cannot link this until tyeth/zephyr#1 lands and the manifest points at a revision with the driver — see #16.
🤖 Generated with Claude Code