Repository navigation
feat(deploy): add RP2040/RP2350 SWD transport via probe-rs - #1820
Merged
Merged
Conversation
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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 whosefirmware 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+swdaccepted byparse_rp2040_transport, the CLI--transportparser, and the daemon request (which already validates throughthe same parser).
Rp2040Deployer::deploy_via_swdreuses the pinned FastLED/probe-rs pathalready 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, onspawn_blockingwith the existing 120 s guard.dependency on the target's USB stack.
.elf(or an Intel HEX the caller passed)is flashed. A bare
.bin/.uf2has no load address for probe-rs, so it is anamed error rather than a silent guess.
No probes were founddiagnosticsplus the captured stdout/stderr. The default transport and behavior are
unchanged when
--transport swdis not selected.--portis ignored (probe-rs selects the CMSIS-DAP probe) and the resultmessage says so.
Tests (real output)
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 --checkrc 0;
soldr cargo clippy -p fbuild-deploy -p fbuild-cli -p fbuild-daemon --all-targetsrc 0 with no warning in the touched files;soldr dylint --all -- --package fbuild-deploy --all-targetsrc 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 swdis; that retry policy is a separate change.