Repository navigation
Description
Parent: FastLED/FastLED#3648. Related stock-ROM work: #1040 and #1049.
Context
The attached RP2040 has a repeatable physical USB-topology differential on Windows:
- Direct motherboard USB: fbuild deploy and AutoResearch RPC smoke pass.
- USB hub: the same deployment path does not work.
Direct-port evidence, captured with fbuild only:
FBUILD_DEV_MODE=1 UV_NO_SYNC=1 bash autoresearch rp2040 --rpc-smoke --timeout 120s --skip-lint --cleanwrote G:\NEW.UF2
deploy succeeded (full flash); FBUILD_DEPLOY_PORT=COM12
RESULT: RPC smoke PASS
The known working runtime identity is COM12, 2E8A:000A, serial 5303284720C4641C. The daemon records its expected subsequent-deploy transition as COM12 -> BOOTSEL G: -> COM12.
Earlier hub-path observations included Windows storage errors 1006/1392 and Disk 51/153 events. RAM-target UF2 transfers previously ejected/re-enumerated through the same ROM path, while flash-target transfer was unconfirmed. Those observations do not identify a QSPI component fault. The current physical A/B establishes that the hub path is a causal condition, but not whether its mechanism is power/reset timing, USB enumeration, or Windows removable-storage interaction.
fbuild already gives generic direct-port/hub recovery advice for Windows error 121 and direct-port guidance for error 1006 in crates/fbuild-deploy/src/rp2040.rs. It has no topology-specific diagnostic or acceptance record for this observed differential.
Proposal
Add an fbuild-owned diagnostic/hardening slice for RP2040 BOOTSEL mass-storage failures:
- Preserve fbuild as the only deploy interface; do not add PlatformIO or direct flash-tool workarounds.
- Capture and emit the available transport context around an RP2040 transfer failure (selected BOOTSEL volume, transfer/eject outcome, Windows error, runtime identity, and USB topology when the platform can supply it).
- Make the actionable failure distinguish a hub-path reproduction from an unclassified transfer failure without claiming a QSPI root cause.
- Add deterministic tests for the rendered diagnostics and retain the existing typed error guidance.
- Add physical A/B evidence for the same board/cable: hub failure signature and direct-motherboard success signature, recording serial/VID:PID, command, and outcome.
Acceptance criteria
- A hub-path failure reports the observed transfer/eject symptom and a direct-motherboard retry recommendation, without asserting a flash-component cause.
- The diagnostic includes all available identity/transport facts and explicitly labels unavailable topology information rather than guessing.
- Focused fbuild tests cover the hub-specific actionable message plus the existing 1006/121/1392 branches.
- A same-board physical A/B log records hub failure and direct-port fbuild-only success, including board serial, VID:PID, command, and decisive output.
- No PlatformIO, raw serial, or direct flashing tool is introduced.
Open questions
- Does the hub change power/reset timing, USB enumeration, or Windows MSC/filter behavior?
- Can fbuild obtain stable Windows USB topology for the selected MSC device without requiring an additional driver?
Related issues
- feat(rp2040): zero-touch deployment to an as-received Pico via ROM UF2 #1040 — stock ROM UF2 first-deployment acceptance.
- feat(rp2040): deploy parity with Arduino-Pico, PlatformIO, and official picotool #1049 — RP2040 deploy parity and attached-board diagnostic acceptance.
- meta(rp2040): transport, channel-driver implementation, and postmortem closeout FastLED#3648 — parent burn-down.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTriage
Activity
zackees commentedon Jul 16, 2026
Investigation: why the hub path fails — mechanism triage + web findings
TL;DR: There is a documented silicon erratum, RP2040-E5 ("USB device fails to exit RESET state on busy USB bus"), that specifically predicts the observed hub-vs-direct differential: it affects the mask-ROM BOOTSEL code, which cannot be patched, while runtime firmware built with the Pico SDK carries a software workaround. A device behind a hub shares its full-speed segment with sibling traffic and may never see the ~800 µs of bus idle the USB controller needs after a bus reset; a device alone on a direct root port always does. The erratum applies to B0/B1 steppings and was fixed by a mask change in B2 — so the single most decisive fact to add to the A/B log is this board's chip stepping. It is not the only candidate (VBUS sag during QSPI flash programming fits the RAM-vs-flash observation already recorded here), so below is a triage of the three mechanism families from the open question, plus an answer to the topology-detection question.
1. USB enumeration: RP2040-E5 (strongest topology-specific candidate)
PICO_RP2040_USB_DEVICE_ENUMERATION_FIX(raspberrypi/pico-sdk#759). Runtime firmware gets it; the boot ROM's mass-storage code is "the first stage bootloader that is encoded in the (hardened) ROM" and does not contain it (detailed writeup). That exactly matches the recorded asymmetry: runtimeCOM12(2E8A:000A) behaves over the hub, while the ROM BOOTSEL path (2E8A:0003 →G:) is the part that fails.2. Power/reset timing: VBUS sag during QSPI flash programming
Flash-target UF2 writes drive erase/program cycles on the QSPI flash — the highest peak-current phase of the whole deploy. A bus-powered hub, or a hub with aggressive per-port current limiting, can sag VBUS mid-transfer and brown out or USB-glitch the board, which the host sees as a mid-copy device error.
This is the mechanism that best fits an observation already in this issue: RAM-target UF2 transfers previously ejected/re-enumerated through the same hub path, while flash-target transfer was unconfirmed. RAM targets never touch QSPI and draw less peak current. If a repeat A/B shows RAM-UF2-over-hub passing while flash-UF2-over-hub fails within the same enumeration, that is strong evidence for power rather than enumeration — without implicating the flash component itself.
3. Windows MSC / transport behavior
G:is invalidated, and the copy surfaces error 1006 (ERROR_FILE_INVALID, 0x3EE — other Pico users report it verbatim as0x800703EEduring UF2 copies, e.g. this thread) or 1392.Chained story consistent with all recorded evidence
hub adds TT scheduling + shared VBUS + shared FS segment → mid-copy transient (bulk timeout or power dip) → storport retries (Event 153) / failed write (Event 51) → host resets the port → on B0/B1 silicon the ROM cannot re-enumerate on the busy segment (E5, no workaround possible in mask ROM) → volume handle invalidated → error 1006/1392 with no observed eject transition — which is precisely the branch
crates/fbuild-deploy/src/rp2040.rsalready distinguishes from the accepted late-error-after-eject case.Open question 2: topology without a driver — yes, user mode is sufficient
Windows exposes everything needed with inbox drivers, no admin, no new driver:
USBSTOR\…) →CM_Get_Parent→ USB device node (USB\VID_2E8A&PID_0003\…) → next parent. If the parent's instance ID isUSB\ROOT_HUB30\…the board is on a root port (direct); if it is anotherUSB\VID_xxxx&PID_xxxxdevice, that is an external hub — keep walking to count tiers.DEVPKEY_Device_LocationInfoon the USB devnode yields the classicPort_#0004.Hub_#0003string for the acceptance record.IOCTL_USB_GET_NODE_INFORMATION,IOCTL_USB_GET_NODE_CONNECTION_INFORMATION_EX) — the same path Microsoft's USBView sample uses.windows-rs; "explicitly labels unavailable topology information" then only applies to non-Windows hosts or genuinely absent properties.Suggested additions to the physical A/B matrix
Sources
PICO_RP2040_USB_DEVICE_ENUMERATION_FIX)harden(rp2040): hub-path deploy robustness — retries, picotool fallba…
zackees commentedon Jul 16, 2026
Resolved by merged PR #1083 (harden(rp2040): hub-path deploy robustness — retries, picotool fallback, topology diagnostics, tunable budgets).
Acceptance criteria check:
fbuild-deploy: 225 passed / 0 failed).2E8A:000A, serial5303284720C4641C, COM12, Windows 10, over the same USB hub previously producing errors 1006/1392 and Disk 51/153 events): three consecutivefbuild deploy tests/platform/rp2040 -e rp2040 -p COM12runs succeeded end-to-end — full flash viaG:\NEW.UF2, runtime CDC re-enumeration, sketch serial output confirmed (Hello from RP2040 Pico!). This exceeds the original acceptance bar (hub failure + direct-port success) by demonstrating hub-path success after hardening.Sibling issue #1082 (broader hardening-plan inventory) is already closed by the same PR.