Skip to content

investigate(rp2040): harden hub-path BOOTSEL mass-storage diagnostics #1081

Description

@zackees

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 --clean
wrote 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:

  1. Preserve fbuild as the only deploy interface; do not add PlatformIO or direct flash-tool workarounds.
  2. 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).
  3. Make the actionable failure distinguish a hub-path reproduction from an unclassified transfer failure without claiming a QSPI root cause.
  4. Add deterministic tests for the rendered diagnostics and retain the existing typed error guidance.
  5. 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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions