Skip to content

feat(rp2040): wire up RP2040/RP2350 build orchestrator - #13

Merged
zackees merged 1 commit into
mainfrom
fix/rp2040-orchestrator
Apr 6, 2026
Merged

feat(rp2040): wire up RP2040/RP2350 build orchestrator#13
zackees merged 1 commit into
mainfrom
fix/rp2040-orchestrator

Conversation

@zackees

@zackeeszackees commented Apr 6, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace the stub RP2040 orchestrator (which returned "Rp2040Cores package not wired up") with a real build implementation
  • Follow the STM32 pattern: ARM GCC toolchain + arduino-pico cores + generic ArmCompiler/ArmLinker
  • Simplify mcu_config.rs to reuse ArmMcuConfig instead of the redundant Rp2040McuConfig type

Test plan

  • All 6 RP2040 unit tests pass
  • Full workspace clippy clean (-D warnings)
  • Full workspace test suite passes
  • CI: Build Raspberry Pi Pico workflow passes
  • CI: Build Raspberry Pi Pico 2 workflow passes

Summary by CodeRabbit

  • New Features

    • RP2040 microcontroller builds are now fully functional with complete compilation and linking support, including toolchain integration and MCU configuration.
  • Refactor

    • Consolidated MCU configuration handling to use a shared ARM architecture model for improved consistency across builds.

Replace the stub orchestrator that returned "Rp2040Cores package not
wired up" with a real implementation following the STM32 pattern:
ARM GCC toolchain + arduino-pico cores + generic ArmCompiler/ArmLinker.
Simplify mcu_config.rs to reuse ArmMcuConfig instead of the redundant
Rp2040McuConfig type.
@coderabbitai

coderabbitaiBot commented Apr 6, 2026

Copy link
Copy Markdown

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The changes consolidate RP2040 MCU configuration onto a shared ArmMcuConfig type, removing a custom Rp2040McuConfig struct. The orchestrator is updated from a placeholder to a functional build implementation that installs dependencies, scans sources, gathers configuration, constructs include paths, and executes a sequential ARM compilation and linking pipeline.

Changes

Cohort / File(s)Summary
Config Type Migration
crates/fbuild-build/src/rp2040/mcu_config.rs
Removed custom Rp2040McuConfig struct and McuConfig trait implementation. Updated get_rp2040_config_for_mcu() to return ArmMcuConfig instead, parsing embedded JSON directly into the shared generic ARM type. Updated tests to validate architecture and compiler flags.
Build Orchestrator Implementation
crates/fbuild-build/src/rp2040/orchestrator.rs
Replaced placeholder error-returning build() method with full implementation. Creates build context, installs ARM GCC toolchain and RP2040 cores, scans multi-directory sources, gathers MCU config and defines, constructs include paths from project/framework/toolchain sources, instantiates ARM compiler and linker, and executes sequential build pipeline.

Sequence Diagram(s)

sequenceDiagram
participant Orchestrator as RP2040<br/>Orchestrator
participant Toolchain as ARM GCC<br/>Toolchain
participant Cores as RP2040<br/>Cores Package
participant Config as MCU Config<br/>(ArmMcuConfig)
participant Compiler as ArmCompiler
participant Linker as ArmLinker
participant Pipeline as Build<br/>Pipeline
Orchestrator->>Orchestrator: Create BuildContext
Orchestrator->>Toolchain: Ensure installed
Toolchain-->>Orchestrator: Tool paths & versions
Orchestrator->>Cores: Ensure installed
Cores-->>Orchestrator: Core sources available
Orchestrator->>Orchestrator: Scan source files<br/>(sketch + framework)
Orchestrator->>Config: Fetch MCU config<br/>(now ArmMcuConfig)
Config-->>Orchestrator: Arch, compiler flags,<br/>linker script
Orchestrator->>Orchestrator: Build include path list<br/>(project + framework +<br/>toolchain + SDK)
Orchestrator->>Compiler: Instantiate with config
Orchestrator->>Linker: Instantiate with<br/>linker script & memory
Orchestrator->>Pipeline: Execute compilation<br/>& linking
Pipeline->>Compiler: Compile sources
Pipeline->>Linker: Link objects
Pipeline-->>Orchestrator: Build artifacts
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 Whiskers twitch with glee,
Config types now unified as one,
RP2040 orchestrator springs to life—
A complete build dance, no placeholder strife,
ARM compilers sing as sources compile!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check nameStatusExplanationResolution
Docstring Coverage⚠️ WarningDocstring coverage is 75.00% which is insufficient. The required threshold is 80.00%.Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check nameStatusExplanation
Description Check✅ PassedCheck skipped - CodeRabbit’s high-level summary is enabled.
Title check✅ PassedThe pull request title 'feat(rp2040): wire up RP2040/RP2350 build orchestrator' directly and clearly describes the main change—implementing the RP2040/RP2350 build orchestrator that was previously a stub.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ 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-orchestrator

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 and usage tips.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@zackees