Skip to content

fix(rp2040): match upstream UF2 deploy semantics#1050

Merged
zackees merged 1 commit into
mainfrom
fix/rp2040-new-uf2
Jul 15, 2026
Merged

fix(rp2040): match upstream UF2 deploy semantics#1050
zackees merged 1 commit into
mainfrom
fix/rp2040-new-uf2

Conversation

@zackees

@zackees zackees commented Jul 15, 2026

Copy link
Copy Markdown
Member

Closes #1049
Progresses #1040
Related: FastLED/FastLED#3626

Summary

  • generate canonical firmware.uf2 from ELF with a SHA-256-pinned, framework-managed pqt-picotool on Windows/Linux/macOS
  • copy exactly NEW.UF2, validate family/block/address structure, wait for ROM-volume ejection, and classify only device-disappearance copy races as accepted
  • preserve stock no-port deployment while restoring catalogue-driven 1200-bps reset and returning the actual changed CDC port
  • reject ambiguous/mismatched RP2040-vs-RP2350 targets and stale UF2 artifacts
  • make editable installs stage CLI and daemon together; document FastLED/boards as the only production USB identity source

Validation

  • soldr cargo test -p fbuild-deploy rp2040 --lib (13 passed)
  • soldr cargo test -p fbuild-daemon deploy_port --lib (7 passed)
  • focused fbuild-toolchain tests (3 passed)
  • focused Clippy with warnings denied
  • ruff check setup.py and python -m py_compile setup.py
  • editable install into FastLED rebuilt/staged both native executables
  • fbuild build of tests/platform/rp2040 emitted a 166,400-byte, 325-block RP2040 UF2 with family E48BFF56

Hardware status

The attached Pico is still enumerated as stock 2E8A:0003 / RPI-RP2, but Windows reports the current virtual FAT mount as Warning / Full Repair Needed after earlier failed uploader experiments. No corrupted-mount result is claimed as acceptance evidence. Fresh reconnect plus CDC/JSON-RPC/soak remains the closeout gate on parent #1040.

Summary by CodeRabbit

  • New Features

    • RP2040 and RP2350 builds now produce UF2 firmware artifacts automatically.
    • Python package installations now include the companion background service.
    • Raspberry Pi deployment can better identify the correct connected board and serial port.
  • Bug Fixes

    • Improved BOOTSEL detection, firmware validation, device reset handling, and post-deployment serial recovery.
    • Added safeguards against stale or invalid firmware images.
  • Documentation

    • Updated board onboarding and serial-testing guidance to use the shared board catalogue.

@zackees
zackees merged commit c086773 into main Jul 15, 2026
87 of 93 checks passed
@zackees
zackees deleted the fix/rp2040-new-uf2 branch July 15, 2026 01:40
@coderabbitai

coderabbitai Bot commented Jul 15, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d66f7085-fb45-4063-b22c-6ad9ae9ddb3f

📥 Commits

Reviewing files that changed from the base of the PR and between 5796ce6 and ba80179.

⛔ Files ignored due to path filters (1)
  • uv.lock is excluded by !**/*.lock
📒 Files selected for processing (10)
  • agents/docs/README.md
  • agents/docs/deploy-architecture.md
  • agents/docs/serial-testing.md
  • crates/fbuild-build-arm/src/rp2040/orchestrator.rs
  • crates/fbuild-core/src/usb/data.rs
  • crates/fbuild-daemon/src/handlers/operations/deploy_port.rs
  • crates/fbuild-deploy/src/rp2040.rs
  • crates/fbuild-toolchain/src/toolchain/mod.rs
  • crates/fbuild-toolchain/src/toolchain/rp2040_picotool.rs
  • setup.py

📝 Walkthrough

Walkthrough

RP2040/RP2350 builds now generate managed UF2 artifacts, deployment validates BOOTSEL transfers and CDC recovery, and Raspberry Pi identity matching uses catalogue metadata. Packaging now stages and ships both the CLI and daemon binaries.

Changes

RP2040 deployment and identity

Layer / File(s) Summary
Managed UF2 build artifacts
crates/fbuild-toolchain/src/toolchain/*, crates/fbuild-build-arm/src/rp2040/orchestrator.rs
Adds managed picotool installation and converts linked ELF files into family-specific UF2 artifacts, including fast-path caching.
BOOTSEL transfer and CDC recovery
crates/fbuild-deploy/src/rp2040.rs
Validates UF2 files, writes NEW.UF2, handles volume ejection, deduplicates BOOTSEL volumes, and discovers the correct post-deploy CDC port.
Catalogue-driven RP identity
crates/fbuild-daemon/src/handlers/operations/deploy_port.rs, crates/fbuild-core/src/usb/data.rs, agents/docs/*
Classifies RP2040 and RP2350 devices from catalogue USB identities and updates related onboarding and serial-testing guidance.

CLI and daemon packaging

Layer / File(s) Summary
Daemon build and wheel staging
setup.py
Builds, locates, freshness-checks, stages, and packages both fbuild-cli and fbuild-daemon.

Estimated code review effort: 4 (Complex) | ~60 minutes

Possibly related issues

Possibly related PRs

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/rp2040-new-uf2

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

Comment @coderabbitai help to get the list of available commands.

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.

feat(rp2040): deploy parity with Arduino-Pico, PlatformIO, and official picotool

1 participant