Debug Probe for Raspberry Pi Pico
Pressing the BOOTSEL button every time you want to flash a new program is annoying. On devboards like the ESP32 DevKit this step is mostly automatic because the devboard can reset the chip into bootloader mode when needed. The Pico does not have this feature, but you can get the same convenience and even more capability by using a debug probe.
This chapter explains why a debug probe is helpful, and step-by-step how to set one up and use it to flash and debug your Pico without pressing BOOTSEL each time.
Raspberry Pi Debug Probe
The Raspberry Pi Debug Probe is the official tool recommended for SWD debugging on the Pico and Pico. It is a small USB device that acts as a CMSIS-DAP adapter. CMSIS-DAP is an open standard for debuggers that lets your computer talk to microcontrollers using the SWD protocol.
The probe provides two main features:
-
SWD (Serial Wire Debug) interface - This connects to the Pico’s debug pins and is used to flash firmware and perform real time debugging. You can set breakpoints, inspect variables, and debug your program just like you would in a normal desktop application.
-
UART bridge - This provides a USB to serial connection so you can view console output or communicate with the board.
Both features work through the same USB cable that goes into your computer, which keeps the setup simple because you do not need a separate UART device.
Soldering SWD Pins
Before you can connect the Debug Probe to the Pico, you need to make the SWD pins accessible. These pins are located at the bottom edge of the Pico board, in a small 3-pin debug header separate from the main GPIO pins.
Once the SWD pins are soldered, your Pico is ready to connect to the Debug Probe.
Preparing Debug Probe
Your Debug Probe may not ship with the latest firmware, especially the version that adds support for the Pico (RP2040 chip). Updating the firmware is recommended before you start.
The official Raspberry Pi documentation provides clear instructions for updating the Debug Probe. Follow the steps provided here.
Connecting Pico with Debug Probe
The Debug Probe has two ports on its side:
- D port - For the SWD (debug) connection
- U port - For the UART (serial) connection
SWD Connection (Required)
The SWD connection is what allows flashing firmware and using a debugger. Use the JST to Dupont cable that comes with your Debug Probe.
Connect the wires from the Debug Probe’s D port to the Pico pins as follows:
| Probe Wire | Pico Pin |
|---|---|
| Orange | SWCLK |
| Black | GND |
| Yellow | SWDIO |
Make sure the Pico SWD pins are properly soldered before you attempt the connection.
UART Connection (Optional)
The UART connection is useful if you want to see serial output (like println! logs from Rust) in your computer’s terminal. This is separate from the SWD connection.
Connect the wires from the Debug Probe’s U port to the Pico pins:
| Probe Wire | Pico Pin | Physical Pin Number |
|---|---|---|
| Yellow | GP0 (TX on Pico) | Pin 1 |
| Orange | GP1 (RX on Pico) | Pin 2 |
| Black | GND | Pin 3 |
You can use any GPIO pins configured for UART, but GP0 and GP1 are the Pico’s default UART0 pins.
Powering the Pico
The Debug Probe does not supply power to the Pico, it only provides the SWD and UART signals. To power the Pico, connect the Debug Probe to your PC through its USB port, then power the Pico separately through its own USB connection. Both devices must be powered for debugging to work properly.
Final Setup
Once connected:
- Plug the Debug Probe into your computer via USB
- Ensure your Pico is powered
- The Debug Probe’s red LED should light up, indicating it has power
- Your setup is ready - no BOOTSEL button pressing needed from now on
You can now flash and debug your Pico directly through your development environment without any manual intervention.
Test it
To verify that your Debug Probe and Pico are connected correctly, you can use the quick start project. Flash it and test that everything works.
git clone https://github.com/ImplFerris/rp2040-quick
# or
# if you are using Pico w
git clone https://github.com/ImplFerris/pico-w-quick
You cannot just use cargo run like we did before, unless you modified the config.toml. Because the quick start project is set up to use picotool as its runner. You can comment out the picotool runner and enable the probe-rs runner. Then you can use the cargo run command.
Or more simply (i recommend this), you can just use the following commands provided by probe-rs. This will flash your program using the Debug Probe:
# debug mode:
# cargo flash --chip RP2040
# or
cargo flash --chip RP2040 --release
cargo embed
You can use cargo embed to flash your program and watch the log output in your terminal. The quick start project is already set up to send its log messages over RTT, so you do not need to configure anything before trying it out.
# debug mode:
#cargo embed
# or
cargo embed --chip RP2040 --release
If RTT is new to you, we will explain it later, but for now you can simply run the command to see your program run and print logs.
If everything works correctly, you should see the messages “led on!” and “led off!” printed in the system terminal whenever the LED state changes.
Embed Config
You do not need to type –chip every time you run cargo embed. Instead, you can configure the chip once using an Embed.toml file. This file can also be used to enable features like RTT and control whether a GDB server is started.
The project template used in this book always includes an Embed.toml file, regardless of whether you are using a debug probe or not.
[default.general]
chip = "RP2040"
[default.rtt]
# Whether or not an RTTUI should be opened after flashing.
enabled = true
[default.gdb]
# Whether or not a GDB server should be opened after flashing.
enabled = false
If you do not have a debug probe, this file does not really change your workflow. It simply exists in the project and is ignored unless you use cargo embed.
When you do use cargo embed, the file removes the need to specify the chip on the command line. You can now run without mentioning the chip explicitly:
cargo embed --release