Skip to content

Raspberry Pi Pico

lbuild config: modm:rp-pico

RP2040 Official System Development Board See



The RP2040 ships with a UF2 bootloader in ROM.

To upload your application, connect the RP2040 via USB, convert the ELF to UF2 format by calling scons uf2 or make uf2 and copy the generated .uf2 file to the mounted virtual disk.


Another option is to use Picoprobe and custom version of OpenOCD provided by RPi.

You would need to build and program one of the boards with the Picoprobe firmware, configure and build RPi OpenOCD, and connect the boards via SWD. The wiring diagram and detailed description is available in the Pico Documentation.

The how-to shows steps for building and installing the RPi OpenOCD into your system globally, however, if you still want to be able to work with other OpenOCD binaries, you should only install it locally:

sudo apt install automake autoconf build-essential texinfo libtool libftdi-dev libusb-1.0-0-dev

cd ~/pico
git clone --branch rp2040 --depth=1 --no-single-branch

cd openocd

mkdir build
cd build
../configure --enable-picoprobe --prefix=$(realpath ../install)

make -j4
make install

Additional steps are needed to get access to the device from a non-privileged user on Linux. Edit or create the /etc/udev/rules.d/60-openocd.rules file and append these lines to it:

# Raspberry Pi Picoprobe
ATTRS{idVendor}=="2e8a", ATTRS{idProduct}=="0004", MODE="660", GROUP="plugdev", TAG+="uaccess"

Once you have both of your Pico boards connected according to the wiring diagram, you can run scons program to program the dev board:

export MODM_OPENOCD_BINARY=$HOME/pico/openocd/install/bin/openocd
scons program


    <option name="modm:target">rp2040</option>
    <option name="modm:platform:core:boot2">w25q080</option>
    <option name="modm:platform:core:boot2_size">2Mi</option>