pico-rtic-example

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

Hardware Setup

  • Program a Raspberry Pi PICO to be a CMSIS-DAP probe using DapperMime
  • 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

Software Setup

  • Rust

    • Install rustup
    • rustup self update - update rustup
    • rustup update stable - update rust
    • rustup target add thumbv6m-none-eabi - add cortex m0 compilation target for cross-compiling
  • Rust Tools

    • cargo install flip-link - linker to enable flip-link
    • cargo 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

  • 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

Running

cargo run

That's about it!

Helpful Documentation

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:

TODO

  • Update .vscode/* for rp-pico
  • get breakpoints/debugging working

License

This project is licensed under either of

at your option.

Contribution

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.