Skip to the content.

Pinout

Check the RPi Pico Pinout Labels

Zero Pin Debugger Function <-> Pico Pin Target Function Notes
9 N/A        
10 SWCLK   CLK SWCLK  
11 SWDIO   DIO SWDIO  
12 UART0 TX   1 UART RX 1
13 UART0 RX   0 UART TX 1

Schematics for wiring

How to use

SWD/DAP

This should be automatically detected by your SDK if it uses openOCD/pyOCD/probe-rs.

TTY

On Linux this will expose two serial ports: one reporting the logs of the debugger, and one forwarding the target UART.

Assuming you don’t have anything else connected and that you have tio installed:

$ ls /dev
# this will show all the devices connected, we are interested in:
# ttyACM0 = UART bridge
# ttyACM1 = zeroprobe logs
$ tio /dev/ttyACM0

LED Colors

The RGB LED on the RP2040-Zero shows the state of the USB connection:

Color Meaning
Off No power, the firmware is not running, or the board is in BOOT mode
Red Powered and running, but not configured by a USB host
Blue Configured by the host and ready, no USB traffic
Green USB traffic in the last 0.5 s, on the debugger or on a serial port

The colors and the timeout can be changed, see Configure.

Fixes

In case of device not detected:

TODO

Build

Requisites:

Set up the workspace

Zeroprobe is a west manifest repository: west.yml pins Zephyr and the modules it needs (cmsis_6 and hal_rpi_pico), so a single west init creates the whole workspace.

$ python3 -m venv zeroprobe-ws/.venv
$ source zeroprobe-ws/.venv/bin/activate
$ pip install west

$ west init -m https://github.com/icpmoles/zeroprobe zeroprobe-ws
$ cd zeroprobe-ws
$ west update
$ west packages pip --install
$ west sdk install -t arm-zephyr-eabi

This creates the following layout, the same one used by the CI:

zeroprobe-ws/
├── .venv/        # Python virtual environment with west
├── .west/        # workspace config, created by west init
├── external/     # Zephyr and modules, fetched by west update
└── zeroprobe/    # this repository

If you already cloned the repository, run west init -l zeroprobe from its parent directory instead of west init -m ..., then continue with west update.

To build a branch other than main, add --mr <branch> to west init -m.

Compile

The board (rp2040_zero/rp2040) is already selected in CMakeLists.txt:

$ cd zeroprobe
$ west build

The firmware is written to build/zephyr/zephyr.uf2, flash it as described in How to use, or run west flash --runner=uf2 while the board is in BOOT mode.

Use west build -p for a pristine build, e.g. after changing west.yml or switching branch.

Configure

Options can be changed in prj.conf, in boards/rp2040_zero.conf, or interactively with west build -t menuconfig.

The status LED is set in boards/rp2040_zero.conf:

Option Default Meaning
CONFIG_APP_LED_COLOR_UNCONFIGURED 0x200000 Not configured by a USB host (red)
CONFIG_APP_LED_COLOR_CONFIGURED 0x000020 Configured by the host, no traffic (blue)
CONFIG_APP_LED_COLOR_ACTIVE 0x002000 USB traffic (green)
CONFIG_APP_LED_IDLE_TIMEOUT_MS 500 Idle time before going back to configured

Colors are 0xRRGGBB, keep the values low: the WS2812 is very bright.

The colors and the timeout can also be changed at runtime from the shell on the logs serial port (see TTY), without rebuilding:

uart:~$ led show
unconfigured 0x200000
configured   0x000020 (current)
active       0x002000
timeout      500 ms
uart:~$ led set configured 0x100010
uart:~$ led timeout 1000
uart:~$ led save
Command Effect
led show Show the settings, and which color is currently shown
led set <unconfigured\|configured\|active> <RRGGBB> Change a color until the next reboot
led timeout [ms] Show or change the idle timeout (1 to 60000 ms)
led save Save the settings to flash, they are loaded at boot
led reset Erase the saved settings and go back to the defaults

Saved settings are kept in the last 4 KB sector of the flash, which is not touched when flashing a new UF2 firmware.

Credits

Footnotes

  1. Target pins depends on the setup of your target board ↩ ↩2