How arm-software/cmsis-dap works
CMSIS-DAP is a protocol specification and embedded firmware for standardized debugger access to an Arm CoreSight Debug Access Port. The principal workflow is a debugger sending USB packets to a firmware transport, which signals the DAP runtime to interpret commands and perform SWD or JTAG operations against a target; responses return through the transport. The firmware also supports SWO trace and UART-related functionality, and the repository documents firmware adaptation and USB commands. Some runtime dispatch and peripheral wiring is not visible in the excerpts, so those links are omitted.
Main entry points: DAP.c DAP command engine · DAP_config.h Board configuration · main.c Firmware startup · USBD_User_HID_0.c USB HID transport
Components 16
USB transports
- USB HID transport
Firmware/Template/MDK5/USBD_User_HID_0.c - USB custom transport
Firmware/Template/MDK5/USBD_User_CustomClass_0.c - CDC UART bridge
Firmware/Template/MDK5/USBD_User_CDC_ACM_UART_0.c
DAP runtime
- Firmware startup
Firmware/Template/MDK5/main.c - RTOS objects
Firmware/Template/MDK5/osObjects.h - DAP command engine
Firmware/Source/DAP.c - DAP protocol API
Firmware/Include/DAP.h - Board configuration
Firmware/Config/DAP_config.h - Vendor commands
Firmware/Source/DAP_vendor.c
Debug interfaces
- SWD operations
Firmware/Source/SW_DP.c - JTAG operations
Firmware/Source/JTAG_DP.c - Debug target
Trace and UART
- SWO capture
Firmware/Source/SWO.c - UART services
Firmware/Source/UART.c
Protocol reference
- Protocol and adaptation docs
Documentation/Doxygen/src/mainpage.md
Other components
- Debugger host
Connections 19
- Debugger host → USB HID transport: sends packets
Firmware/Template/MDK5/USBD_User_HID_0.c - Debugger host → USB custom transport: sends packets
Firmware/Template/MDK5/USBD_User_CustomClass_0.c - Debugger host → CDC UART bridge: sends UART data
Firmware/Template/MDK5/USBD_User_CDC_ACM_UART_0.c - Firmware startup → DAP command engine: starts thread
Firmware/Template/MDK5/main.c - Firmware startup → SWO capture: starts thread
Firmware/Template/MDK5/main.c - RTOS objects → Firmware startup: declares threads
Firmware/Template/MDK5/main.c - USB HID transport → DAP command engine: signals requests
Firmware/Template/MDK5/USBD_User_HID_0.c - USB custom transport → DAP command engine: signals requests
Firmware/Template/MDK5/USBD_User_CustomClass_0.c - DAP command engine → SWD operations: calls transfers
Firmware/Source/DAP.c - DAP command engine → JTAG operations: calls transfers
Firmware/Source/DAP.c - SWD operations → Debug target: accesses target
- JTAG operations → Debug target: accesses target
- DAP command engine → DAP protocol API: uses commands
Firmware/Source/DAP.c - DAP command engine → Board configuration: uses settings
Firmware/Source/DAP.c - Vendor commands → DAP protocol API: uses command IDs
Firmware/Source/DAP_vendor.c - SWO capture → Board configuration: uses settings
Firmware/Source/SWO.c - UART services → Board configuration: uses settings
Firmware/Source/UART.c - CDC UART bridge → Board configuration: uses settings
Firmware/Template/MDK5/USBD_User_CDC_ACM_UART_0.c - Protocol and adaptation docs → Debugger host: describes protocol