ataradov / free-dap

Free and open implementation of the CMSIS-DAP debugger firmware
BSD 3-Clause "New" or "Revised" License
252 stars 61 forks source link

Free-DAP

This is a free and open implementation of the CMSIS-DAP debugger firmware.

Both SWD and JTAG protocols are supported. However JTAG was not well tested due to lack of good targets. If you have any issues with it - let me know and I'll try to help.

Platform requirements

To create a CMSIS-DAP compliant debugger, your platform must:

CMSIS-DAP version support

Free-DAP library itself is protocol agnostic and implementation of the specific version of the CMSIS-DAP protocol (v1 or v2) is up to the individual platforms.

Currently RP2040, SAM D11 and SAM D21 implementaitons were updated to support CMSIS-DAP v2. Other platforms would be updated if requested or needed by me.

Configuration

For complete list of settings see one of the existing configuration file, they are pretty obvious.

To configure clock frequency you need to specify two parameters:

Your configuration file will need to define the following pin manipulation functions:

Note that all pin manipulation functions are required even if one of the interfaces (JTAG or SWD) is not enabled.

Additionally configuration file must provide basic initialization and control functions:

Tools

A complete RP2040 build requres bin2uf2 utility to generate UF2 file suitable for the RP2040 MSC bootloader. This utility can be downloded here.

Binaries

Generally there are no pre-built binaries due to effort required to maintain them and low potential benefit because of custom hardware requirement.

For RP2040 and Raspberry Pi Pico board specifically there is a binary, since it is a standard and a widely available board that has a nonvolatile bootloader.

The UF2 file is located here. Simply boot into a BootROM MSC mode and copy that file to the drive.

I will try to do my best to keep this binary in sync with the code updates, but it is a manual process, so I may forget. Let me know if you have any issues.

The pins used are as follows:

GPIO Function
11 SWCLK/TCK
12 SWDIO/TMS
13 TDI
14 TDO
15 nRESET
0 VCP TX
1 VCP RX
2 VCP Status
25 (LED) DAP Status