Back to resources
HIL
Testing
CI
Firmware

Raspberry Pi Pico (RP2040 and RP2350) Hardware-in-the-Loop Testing in CI

Flash a Pico or Pico 2 from CI over USB or SWD, power it, read its UART and test its pins with a BenchPod and pytest. Tested on a Pico over USB; SWD for RP2040 and RP2350 is supported.

Edward Viaene · November 23, 2026 · 2 min read

A Pico is easy to flash by hand: hold BOOTSEL, plug it in, drop a UF2 on the drive. In CI nobody is there to hold the button. A BenchPod does both jobs, either through the board's USB port or through its SWD pins, and then tests the firmware.

What is tested, and what is supported

  • Over USB, Tested on a Pico: the pod puts the board in its boot loader and flashes it by UF2 drive or PICOBOOT, with every page read back. This was part of the firmware 4.0.3 bench run. The Pico 2, and Adafruit and Seeed RP2040 boards with their own UF2 bootloaders, use the same code and are Supported.
  • Over SWD, Supported: RP2040 and RP2350 are flashed with target/rp2040.cfg and target/rp2350.cfg (multidrop SWD). Use the SWD pins here, not the USB boot loader. It needs a recent OpenOCD.

Supported means that if your board does not work, you tell us the board and what you see, and we fix it. The pod is built around an FPGA, so a timing difference is a gateware or firmware change that ships as an update. What supported means has the details.

Flash over SWD

benchpod flash --target target/rp2040.cfg --file build/app.elf
benchpod flash --target target/rp2350.cfg --file build/app.elf

The pod needs SWDIO, SWCLK, UART TX and RX, and two grounds, at 3.3 V. The pod never supplies VBUS: a board powered from USB needs its own 5 V.

Flash over USB

When the SWD pads are not accessible, connect the board's USB port to the pod's USB host side and use the USB flash mode. The USB page shows the cabling for each pod revision. The same page lists the USB checks: enumeration, bus current, suspend and resume, and re-enumeration after a reset.

Then test it

Read the console from the Pico's UART, drive its GPIOs from the pod, or check that the board still enumerates after a firmware change. All of it works the same whichever way the board was flashed.

Next steps