This is a simple but fully-featured implementation of a DAP probe based on the RP2040 microntroller found, e.g., in the Raspberry Pico board. It is based on TinyUSB's hid-composite example and inspired by pico-debug.
It shows up as a USB full-speed devices supporting DAP over HID and WebUSB. Because of RP2040's 125 MHz clock speed and fast GPIO peripheral, this provides a fast and cheap DAP probe suitable for many applications.
The code was tested on a Raspberry Pico and a 01Space RP2040-0.42LCD board, using both pyOCD (HID device) and the DAP.js examples (WebUSB device).
- The GPIO pins used for the SWD signals (
SWDIO
,SWDCLK
andnRESET
) are configured here. - the USB vendor and device ID can be configured here.
- The probe's vendor and name strings can be configured here.
The project depends on CMSIS 5, which is assumed to be symlinked from the projects' main directory. Of course, a submodule will work too. Create a build
subdirectory, and from there fun cmake ..
followed by make
. The resulting dap.uf2
can be dragged & dropped to RP2040's bootloader volume. Notice: recent version of OSX break drag & drop programming, in that case use cp -X dap.uf2 ...
. After flashing, a composite HID and WebUSB full-speed device will appear.
This code is published under the MIT license.