Minimal Rust firmware template for Raspberry Pi Pico 2 / RP235x boards.
The project uses Embassy async runtime and builds for the
thumbv8m.main-none-eabihf bare-metal target. It is set up for flashing and
running through probe-rs.
- Rust with the
thumbv8m.main-none-eabihftarget installed probe-rs- A Pico 2 / RP235x board connected through a supported debug probe
Install the target with:
rustup target add thumbv8m.main-none-eabihfBuild production firmware:
make build-prodThis produces the release ELF at:
target/thumbv8m.main-none-eabihf/release/pico_rust_template
Build and flash production firmware:
make flash-prodThis uses probe-rs download --chip RP235x and then resets the board.
Build and run the development firmware:
make run-devDevelopment mode enables defmt/RTT logging and runs via the Cargo runner
configured in .cargo/config.toml.
make size
make cleanTo use this repository as the base for another Pico 2 project:
-
Fork or clone the repository.
-
Rename the package and binary in
Cargo.toml:
[package]
name = "your_project_name"
[[bin]]
name = "your_project_name"
path = "src/main.rs"- Update the binary name and output path references in
Makefile:
cargo build --bin your_project_name ...
target/thumbv8m.main-none-eabihf/release/your_project_name
cargo run --bin your_project_name ...-
Update any user-facing strings in
src/main.rs, such as log messages and file comments. -
Regenerate the lockfile after renaming:
cargo updateAfter that, the same commands should work with the new project name:
make build-prod
make flash-prod
make run-dev