Example project for Raspberry Pi PICO that uses rp-rs/rp2040-hal/rp-pico rtic and rp2040-monotonic and defmt
Based on rp2040-project-template, cortex-m-quickstart, and rp-pico rtic example. See also defmt-app-template
Other examples of pico + rtic, by kalkyl here Generic (but somewhat out of date as of now) RTIC examples here Teensy has some good RTIC Examples here
- Program a Raspberry Pi PICO to be a CMSIS-DAP probe using DapperMime
- Download from DapperMime Releases
- Install onto the PICO you'll use as the probe
- Connect the probe PICO to the PICO you'll be programming
- digikey guide covers this well, though you don't need to connect the UART between the devices.
- in short:
Probe PICO | PICO to be programmed |
---|---|
VSYS | VSYS |
GND | GND |
GP2 | SWCLK |
GP3 | SWDIO |
-
Rust
- Install rustup
rustup self update
- update rustuprustup update stable
- update rustrustup target add thumbv6m-none-eabi
- add cortex m0 compilation target for cross-compiling
-
Rust Tools
cargo install flip-link
- linker to enable flip-linkcargo install probe-run
- run using probe (default, configured runner in .cargo/config.toml)cargo install elf2uf2-rs --locked
- build uf2 files (configure runner in .cargo/config.toml)- probe-rs (not currently working; don't use)
cargo install --force --git https://github.com/probe-rs/probe-rs probe-rs-debugger
-
VS Code
- Install VS Code
- Extensions:
-
Rust helper commands (only used to follow cortex_m_quickstart, used to build this example; not needed)
cargo install cargo-edit
cargo install cargo-generate
cargo run
That's about it!
High-level documentation:
Setup Guide for rp-rs (covers getting rust running on the pi pico or similar boards, including probe-run, elf2uf2-rs, etc)
Other useful information:
- Writing embedded drivers in rust
- Embedonomicon
- Embedonomicon - Concurrency
- embedded-hal Documentation
- nb (non-blocking abstraction used by embedded-hal)
- Update .vscode/* for rp-pico
- get breakpoints/debugging working
This project is licensed under either of
-
Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
-
MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.