Skip to main content

Raspberry Pi Pico H

pico-pinout.pngRust

Dependencies

rustup target install thumbv6m-none-eabi
cargo install flip-link
cargo install --locked elf2uf2-rs

Set up mount point for RP2 device in /etc/fstab:

LABEL="RPI-RP2" /mnt/rp2 auto defaults,user,noauto,nosuid,nodev,noexec 0 0

Template project setup

Template project: https://github.com/rp-rs/rp2040-project-template

  1. Uncomment elf2uf2-rs -d runner in .cargo/config.toml:
    diff --git a/.cargo/config.toml b/.cargo/config.toml
    index a565984..04a72c4 100644
    --- a/.cargo/config.toml
    +++ b/.cargo/config.toml
    @@ -2,8 +2,8 @@
     # Choose a default "cargo run" tool (see README for more info)
     # - `probe-rs` provides flashing and defmt via a hardware debugger, and stack unwind on panic
     # - elf2uf2-rs loads firmware over USB when the rp2040 is in boot mode
    -runner = "probe-rs run --chip RP2040 --protocol swd"
    -# runner = "elf2uf2-rs -d"
    +#runner = "probe-rs run --chip RP2040 --protocol swd"
    +runner = "elf2uf2-rs -d"
    
     rustflags = [
       "-C", "linker=flip-link",

  2. Connect (while holding BOOTSEL button) and mount RP2 device: mount /mnt/rp2
  3. Build and run: cargo run --release