Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Environment setup

Supply List

I have split this list into two categories: the essential items are the bare minimum to get anything running using this repository and the nonessentials are nice-to-haves that give you the leeway to continue tinkering on your own after this course is complete.

Essential Supplies

  • Raspberry Pi Pico development board with headers - Mouser # 358-SC0917
    • The board with included headers is worth the added expense because it has a socket that directly plugs into the debug probe without any soldering required.
  • Raspberry Pi Debug Probe - Mouser # 358-SC0889
    • There are ways to get code to flash to a Raspberry Pi Pico without a debug probe but having one in your toolbox is great.

Nonessential Supplies

Development Environment

OS

  • Most modern Linux distros will be fine for this. I used a freshly downloaded Debian 12 VM.
  • WSL has a hard time interfacing with hardware devices; a VM is better for this project.
  • MacOS generally mirrors Linux using the HomeBrew package manager.
  • Windows is untested, attempt at your peril.

Rust

  • If you don't have Rust installed already you will need to install rustup, the Rust toolchain manager.
  • Follow the install directions here
  • Once complete you should be able to use the cargo and rustup commands

Probe-rs

  • Probe-rs is a collection of tools to aid with embedded development in Rust, it includes software to interface with debug probes and integrations with Rust's build system, Cargo.
  • Install probe-rs following the websites directions:

IDE

  • See the official Rust tooling page
  • For people new to Rust or if you have no real preference, I would recommend VSCode or Neovim with the rust-analyzer LSP.

Setup verification

Raspberry Pi Pico

Before we move on to trying to program a board, we should always check that the manufacturer examples work. This will cut down on the scope of troubleshooting needed when something breaks.

  • Follow the guide here
  • This guide will walk you through loading a blinking light firmware on to your board through its native USB interface.
  • The debug probe is not required for this step.

Debug Probe Flashing

Now that we know the Pi Pico is running, it is time to push some example code through the debug probe interface.

  • Plug in your debug probe to the Pi Pico
  • Note that this connection does not supply power to the Pico, either plug it in via USB or an external power supply.
  • Regardless of the method you choose to power the board, light should still be blinking from the last section.
  • Pull this repository to your development machine
  • Install some build tools:
    • rustup target add thumbv6m-none-eabi
    • cargo install flip-link
    • sudo apt install gcc
    • 🚨 Ensure you have configured the UDEV rules mentioned here
  • Run cargo run
  • You should see a successful code flash and the print statements from the debug interface being printed to your console