How raspberrypi/debugprobe works
Debugprobe is firmware for a Raspberry Pi SWD/UART debug accessory, also usable on Pico boards. A host sends CMSIS-DAP commands over USB; firmware dispatches debug operations to target-facing SWD/JTAG support, while a separate CDC UART path carries serial traffic and supports optional AutoBaud. The excerpts show startup and DAP setup, but omit much runtime wiring, so uncertain links are dashed. CMSIS core headers and board configuration are represented as supporting layers rather than a build or delivery map.
Main entry points: DAP.c DAP command engine · main.c Firmware runtime · Include Cortex-M core support · usb_descriptors.c USB descriptors
Components 21
USB and runtime
- Firmware runtime
src/main.c - USB descriptors
src/usb_descriptors.c - USB DAP endpoints
src/tusb_edpt_handler.c - USB device service
Debug protocol
- DAP command engine
CMSIS_DAP/CMSIS/DAP/Firmware/Source/DAP.c - DAP interface
CMSIS_DAP/CMSIS/DAP/Firmware/Include/DAP.h - DAP hardware config
include/DAP_config.h - SWD transport
CMSIS_DAP/CMSIS/DAP/Firmware/Source/SW_DP.c - JTAG transport
CMSIS_DAP/CMSIS/DAP/Firmware/Source/JTAG_DP.c - SWO trace
CMSIS_DAP/CMSIS/DAP/Firmware/Source/SWO.c - PIO probe I/O
src/sw_dp_pio.c
UART and baud
- CDC UART service
src/cdc_uart.c - AutoBaud detector
src/autobaud.c - USB serial identity
src/get_serial.c
Platform support
- Probe control
src/probe.c - Board selection
src/probe_config.c - Board definitions
include/board_config.h - Cortex-M core support
CMSIS_DAP/CMSIS/Core/Include - CMSIS compiler layer
CMSIS_DAP/CMSIS/Core/Include/cmsis_compiler.h - CMSIS version
CMSIS_DAP/CMSIS/Core/Include/cmsis_version.h
Other components
- Debug host
Connections 20
- Debug host → USB device service: sends USB
- USB device service → USB descriptors: uses descriptors
- USB device service → USB DAP endpoints: dispatches transfers
- Firmware runtime → DAP command engine: sets up and processes
src/main.c - USB DAP endpoints → DAP command engine: queues commands
- DAP command engine → SWD transport: uses SWD
- DAP command engine → JTAG transport: uses JTAG
- DAP command engine → SWO trace: handles trace
- DAP command engine → DAP interface: implements interface
CMSIS_DAP/CMSIS/DAP/Firmware/Source/DAP.c - DAP command engine → DAP hardware config: uses configuration
CMSIS_DAP/CMSIS/DAP/Firmware/Source/DAP.c - SWD transport → PIO probe I/O: drives probe I/O
- Firmware runtime → CDC UART service: initializes UART
src/main.c - CDC UART service → AutoBaud detector: uses baud detection
src/cdc_uart.c - Firmware runtime → AutoBaud detector: starts detection
src/main.c - USB descriptors → USB serial identity: gets serial identity
src/usb_descriptors.c - DAP hardware config → Probe control: binds probe controls
include/DAP_config.h - Board selection → Board definitions: selects board settings
- Cortex-M core support → CMSIS compiler layer: uses compiler layer
CMSIS_DAP/CMSIS/Core/Include/core_cm55.h - Cortex-M core support → CMSIS version: uses version definitions
CMSIS_DAP/CMSIS/Core/Include/core_cm55.h - CMSIS compiler layer → Cortex-M core support: provides compiler abstractions
CMSIS_DAP/CMSIS/Core/Include/cmsis_compiler.h