Skip to content

feat(deploy): add RP2040/RP2350 SWD transport via probe-rs - #1820

Merged
zackees merged 1 commit into
mainfrom
agent/rp-swd
Oct 31, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/rp-swd

Conversation

@zackees

@zackees zackees commented Oct 31, 2026

Copy link
Copy Markdown
Member

What

Adds a third RP-series deploy transport, --transport swd, closing the
"no path at all" half of #1423.

Both existing transports need a live USB endpoint on the target (picotool →
PICOBOOT vendor interface, uf2 → BOOTSEL mass-storage). A board whose
firmware wedges before or during USB bring-up presents neither, so it cannot
be flashed unattended. SWD reaches it through the debug header instead.

How

  • Rp2040Transport::Swd + swd accepted by parse_rp2040_transport, the CLI
    --transport parser, and the daemon request (which already validates through
    the same parser).
  • Rp2040Deployer::deploy_via_swd reuses the pinned FastLED/probe-rs path
    already used by the LPC845 backend: probe-rs download --chip RP2040|RP2350
    (chip chosen from the board family, probe auto-selected) followed by
    probe-rs reset, on spawn_blocking with the existing 120 s guard.
  • The SWD branch runs before any BOOTSEL/profile preparation, because it has no
    dependency on the target's USB stack.
  • Artifact selection: the co-located .elf (or an Intel HEX the caller passed)
    is flashed. A bare .bin/.uf2 has no load address for probe-rs, so it is a
    named error rather than a silent guess.
  • Missing probe: fails with probe-rs's own No probes were found diagnostics
    plus the captured stdout/stderr. The default transport and behavior are
    unchanged when --transport swd is not selected.
  • --port is ignored (probe-rs selects the CMSIS-DAP probe) and the result
    message says so.

Tests (real output)

soldr cargo test -p fbuild-deploy --lib rp2040
test result: ok. 144 passed; 0 failed; 0 ignored; 187 filtered out

New tests: parse_transport_maps_swd,
swd_transport_never_attempts_picotool_first,
swd_chip_follows_the_board_family,
swd_artifact_prefers_the_co_located_elf,
swd_artifact_rejects_an_image_without_a_load_address.

Gates: bash test → 4091 passed / 0 failed, rc 0; soldr cargo fmt --check
rc 0; soldr cargo clippy -p fbuild-deploy -p fbuild-cli -p fbuild-daemon --all-targets rc 0 with no warning in the touched files; soldr dylint --all -- --package fbuild-deploy --all-targets rc 0; boundary 44/43; test-layout ok.

Not verified

No RP2040/RP2350 board and no CMSIS-DAP probe are attached to this host (only
ESP32 USB-JTAG + CH340), so the wire-level flash is unverified past argv/unit
level. The fallback-order suggestion in #1423 (try USB first, fall back to SWD
when the target does not enumerate) is not in this PR — explicit
--transport swd is; that retry policy is a separate change.

A board whose firmware wedges before USB bring-up presents neither the
PICOBOOT interface nor a BOOTSEL volume, so both stock RP transports are
unreachable. Add --transport swd, which flashes the build's ELF through a
CMSIS-DAP probe with the probe-rs path already used by LPC845, then resets
the target. No dependency on the target's USB stack; --port is ignored and
reported. A missing probe fails with probe-rs's diagnostics.

Part of #1423.
@coderabbitai

coderabbitai Bot commented Oct 31, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zackees
zackees added this pull request to the merge queue Oct 31, 2026
Merged via the queue into main with commit 946cebe Oct 31, 2026
29 checks passed
@zackees
zackees deleted the agent/rp-swd branch October 31, 2026 11:58
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant