Conversation
|
Correction to my earlier evidence in this thread. I described the USB verification as "a 12 s active scan producing 925 advertisement reports". The scan duration was wrong: What still holds: USB stayed enumerated for the whole run with Two of my other framings in this thread were also wrong, per the bench work in #21/#22:
🤖 Generated with Claude Code |
The rpi_pico UDC driver's internal thread stack was only raised in debug.conf, so release builds kept Zephyr's 512-byte default and dropped off USB partway through a _bleio scan -- CDC port and CIRCUITPY volume both disappearing, with a USB device/stack error on reset. Move it to prj.conf so every build gets it. Verified on a Pico 2 W: a 12s active scan yielding 925 reports from 20 distinct devices now completes with USB intact, where the same workload previously killed the bus. This commit used to also raise BT_MAX_CONN to 4 on the Pico 2 W (Zephyr defaults to 1). Upstream has since set CONFIG_BT_MAX_CONN=5 port-wide in prj.conf, so that part is dropped: keeping it would now lower the limit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8031983 to
2843a6a
Compare
e6b7fd1 to
7527914
Compare
Update 2026-10-03: rebased onto CircuitPython 11, and
BT_MAX_CONNdropped from this PRRebased onto upstream
main@35210c2e31(after 11.0.0-alpha.1). This PR is now the single commit7527914691("fix USB loss under BLE load on the Pico W boards"), which touches onlyports/zephyr-cp/prj.conf.CONFIG_UDC_RPI_PICO_STACK_SIZE=2048inprj.conf: unchanged. This is still the fix for zephyr-cp: release builds lose USB during BLE activity — the UDC thread stack fix in #5 is debug-only #18's USB loss.CONFIG_BT_MAX_CONN=4: removed from this PR. Upstream'sprj.confnow setsCONFIG_BT_MAX_CONN=5for every board, so 4 would have lowered it. The Pico 2 W gets 5. The Pico W sets 2 in its ownboard.conf(zephyr-cp: enable BLE on the Raspberry Pi Pico W #14,b610e43) to give heap back.BT_MAX_CONN=4and the "Cost" figures below no longer describe this PR. The title still says "allow four BT connections", which is now stale.zephyr-cp-pico2w-net-contextshas no PR. It sits on zephyr-cp: enable BLE on the Raspberry Pi Pico W #14 plus the CI-onlywest.ymloverride commit, so zephyr-cp: fix USB loss under BLE load on the Pico W boards #19–zephyr-cp: freeze .mpy modules named in circuitpython.toml #23 carry that override too.Fixes #18, and lifts the connection limit that shaped the node protocol in tyeth/deepsleep_espnow_wifi_and_ble_env_collector#11.
Stacked on
zephyr-cp-pico2w-net-contexts(twelve network contexts), which is itself onci/pico2w-ble-assets.CONFIG_UDC_RPI_PICO_STACK_SIZE=2048moves toprj.conf#5 added this to
debug.confonly, so every release image kept Zephyr's 512-byte default and theusbd@50110000overflow was never actually fixed for the images we flash. On hardware the board drops off USB partway through a_bleioscan — CDC port and CIRCUITPY volume both gone, USB device/stack error on reset, recovered with an SWDreset run.Verified: with the fix, a 12 s active scan producing 925 advertisement reports from 20 distinct devices completes with USB enumerated throughout. The same workload took the bus down before.
CONFIG_BT_MAX_CONN=4on the Pico 2 WBT_MAX_CONN=1was Zephyr's default — nothing in this port set it, and the CYW43439 is not the constraint. At 1 the hub can hold a single peer, which is what pushed the collector's node protocol to connectionless advertisement broadcasts with no delivery confirmation. Four lets nodes connect and sync.Pico W is deliberately left at the default: with ~208 KB of usable heap on the Pico 2 W versus ~42 KB there, the RP2040 is node-only anyway.
Cost
RAM 231,112 → 236,864 B (43.40% → 44.48%), flash +408 B. Measured, not estimated.
Not fixed here
The post-scan stall in #18 — execution blocking on the first statement after the scan window closes until Ctrl-C. Different cause, unestablished, and unaffected by this change.
🤖 Generated with Claude Code