CMSIS-DAP
CMSIS-DAP is open-source debug firmware from ARM. It connects to a CoreSight Debug Acces Port (DAP) on a target device, via either ARM’s Serial Wire Debug (SWD) or JTAG, and relays commands between the DAP and USB.
To make installation easier on Windows, the firmware enumerates as a USB HID. The packets exchanged with it are unstructured 64 byte reports. (Microchip did exactly the same thing with their PICKit2.) The code has a somewhat curious license: it can be freely used and modified, as long as it is deployed on an ARM Cortex processor.
NOTE: You may also be interested in reading about DAPlink, which expands the capabilities of CMSIS-DAP.
It is connected like this:
Getting the source & documentation
Download the CMSIS-DAP sources and protocol documentation (an account is required, but signing up is free).
The code can only be built using Keil’s MDK software.
Getting pre-built binaries
The only prebuilt binaries I am aware of are the OpenSDA versions intended for use on Freescale’s FRDM boards. I have written instructions for fixing the FRDM firmware; essentially, by installing CMSIS-DAP on FRDM boards.
Appreciation
After carefully reading the documentation, and then even more carefully reading the C source code, and then cross-referencing five or seven different ARM documents (ARM architecture manuals, debug manuals, processor manuals), I was, in the space of a few days’ time, able to get muforth to talk to the CMSIS-DAP firmware installed on a FRDM board and lay open the guts of the KL25Z chip.
It’s a simple and well-designed protocol. And since getting it to work involves digging deeply into CoreSight, SWD, and other ARM debug arcana, I’ve developed an appreciation for the overall design. I’m impressed.
Conjecture
I can’t read ARM’s collective mind, but my conjecture is that ARM created CMSIS-DAP because they were irritated by the profusion of proprietary and undocumented debug interfaces in the so-called “ARM ecosystem”. If this is the reason, I can certainly relate, having decided to build my own BDM debug for Freescale’s S08 family of 8-bit microcontrollers. I looked at the DEMO boards available and was frustrated by the fact that P & E decided to “lock down” the debug ports on these boards. And they were undocumented, which didn’t work for me – I wanted to connect with them via muforth, and avoid using CodeWarrior.
We now have the same problem with ARM Cortex-M development boards. ST-Micro uses ST-LINK on their STM32 Discovery series. TI uses ICDI on the Stellaris Launchpad. And Freescale’s FRDM boards ship with something called OpenSDA – which isn’t open at all.
At least OpenSDA allows CMSIS-DAP to be installed on the FRDM boards. Otherwise the boards are useless!
Tips and tricks
Even though the documentation is pretty thorough, there were a few hurdles to getting connected to the target chip.
First, a “line reset” connection sequence is necessary. This involves clocking a sequence of bits into the SW-DP. ARM’s documentation – the ARM Debug Interface v5 spec and the ADI v5.1 supplement – disagreed on what this sequence should be. I settled on sending 56 ones followed by 8 zeros, and this seemed to work.
Artekit AK-CMSIS-DAP JTAG/SWD
This is the user manual and guide for the AK-CMSIS-DAP JTAG/SWD board.
Introduction
In this guide we are going to learn about the Artekit AK-CMSIS-DAP JTAG and how to use it with the most known IDEs and debugging software.

The AK-CMSIS-DAP is a JTAG/SWD probe based on the CMSIS-DAP standard (also known as DAPLink). The CMSIS-DAP standard not only eases the access to the Coresight Debug Access Port (DAP) of ARM Cortex microcontrolles, but also unifies all the JTAG protocols in a way that users and developers won’t need to support every JTAG/SWD probe protocol in their hardware/software tools.
The AK-CMSIS-DAP JTAG/SWD board is the Artekit implementation of that standard, running on quartzless SiLabs Happy Gecko EFM32 Cortex M0+ (the EFM32HG308F64G-B-QFN24), with 64KB Flash and 8KB RAM running at 25 MHz, completely open source and open hardware.
We also added buffered inputs/outputs allowing to connect targets powered from 1.8V up to 5V, isolating the lines from the internal 3.3V voltage and protecting the internal MPU pins from external short-circuits and over voltages.
The hardware
The AK-CMSIS-DAP board has one 20-pin standard JTAG connector on one side and a strip of 7 utility pins on the other. The following picture and table show the signals you can find in the standard 20-pin JTAG connector.

| PIN | Type | USAGE |
|---|---|---|
| 1 | IN | Target VCC. Must be connected to the Target VCC |
| 2 | No internal connection | |
| 3 | OUT | #TRST output (open collector) |
| 4 | PWR | Ground |
| 5 | OUT | TDI JTAG signal |
| 6 | PWR | Ground |
| 7 | I/O | TMS Output in JTAG mode, SWDIO I/O in SWD mode |
| 8 | PWR | Ground |
| 9 | OUT | TCK output in JTAG mode, SWDCLK output in SWD mode |
| 10 | PWR | Ground |
| 11 | No internal connection | |
| 12 | PWR | Ground |
| 13 | INP | TDO input in JTAG mode |
| 14 | PWR | Ground |
| 15 | OUT | Target #RESET output (open collector) |
| 16 | PWR | Ground |
| 17 | No internal connection | |
| 18 | PWR | Ground |
| 19 | No internal connection | |
| 20 | PWR | Ground |
In the top of the board you can see a 7-pin connector and a BOOT push button as shown in the following picture:

The AK-CMSIS-DAP comes programmed with an internal bootloader to upgrade the firmware using a simple RS232 line and a PC terminal program as TeraTerm. To upgrade the firmware please read the Upgrading the firmware section.
The connector pinout signals:
| PIN | Type | USAGE |
|---|---|---|
| VCC | PWR | 3.3V output from the MCU internal regulator. Can source maximum 10mA. |
| RESET | INP | Active low. Resets the internal MCU. |
| SWDCLK | OUT | SWD clock output. EFM32 debug port. |
| SWDIO | I/O | SWD data input/output. EFM32 debug port. |
| TXD | OUT | Internal UART TXD signal. For firmware upgrade or debug purposes. |
| RXD | INP | Internal UART RXD signal. For firmware upgrade or debug purposes. |
| GND | PWR | Board ground signal. |
In the AK-CMSIS-DAP, all inputs and outputs signals, to and from the JTAG/SWD connector, are buffered. It is very important to connect the pin 1 (Vcc) of the JTAG/SWD connector to the target board Vcc to adapt the internal AK-CMSIS-DAP buffers to the target signal levels.

Drivers
The CMSIS-DAP standard uses the USB HID protocol as the transport protocol, so you don’t need any drivers, no matter the operating system, to use the AK-CMSIS-DAP board. All you need is a standard USB mini cable.
Usage with KEIL uVision
Connect the AK-CMSIS-DAP to the target and to the PC, using the USB cable. In KEIL uVision, click on the “Options for Target…” button.

A new window should open. Go to the Debug tab and select CMSIS-DAP Debugger from the drop-down menu, as in the following picture. Then click on the Settings button.

In the next windows select the AK-CMSIS-DAP device. Set the JTAG or SW modes according to your target’s characteristics. In the JTAG Device Chain you can view the target device code (an STM32F103 in this case).

Usage with with IAR
Connect the AK-CMSIS-DAP to the target and to the PC, using the USB cable. Launch the IAR Embedded Workbench IDE and select Options from the Project menu.

In the next windows select Debugger/CMSIS-DAP from the menu on the left.

From this window you can configure how IAR will connect to your target through the AK-CMSIS-DAP. Select the Interface tab an configure the JTAG or SWD protocol according to your target’s characteristics.
Usage with OpenOCD
The AK-CMSIS-DAP can be used with OpenOCD as a debugging or flashing probe. You can download a precompiled version of OpenOCD for Windows from the Freddie Chopin webpage. Linux users should build OpenOCD from source or download it through, for example, apt-get on Ubuntu distros.
To use OpenOCD with SWD protocol, type from the command line:
To use OpenOCD with JTAG protocol, type from the command line:
In the examples here above, the xxxxxx.cfg file is your target MCU, for example, stm32f1x.cfg for a STM32F1xx.
The following picture shows how it should look like when OpenOCD successfully connects to the target.

Upgrading the firmware
If needed, you can download a new firmware to the AK-CMSIS-DAP board. This is done through the EFM32 serial port signals exposed on the 7-pin connector. The serial port signals have to be translated to RS232 level. For this you can use a female Artekit AK-RS232 and connect it as in the following picture.

Or you can use an AK-FT232RL breakout board to upload the firmware through USB, connected in the following way (remember to set the AK-FT232RL switch to 3.3V):

To upgrade the firmware use a program capable of doing X-MODEM file transfer. In this case, we are going to use TeraTerm.
Follow this steps:
1) Disconnect the USB cable from the AK-CMSIS-DAP.
2) Connect the PC COM cable to the AK-RS232 (or the USB cable to the AK-FT232RL) attached to the AK-CMSIS-DAP.
3) Open the COM port at 115200, 8 bits, No parity, 1 stop bit, no flow control.

4) Press the BOOT push button on the AK-CMSIS-BOARD and keep it pressed while connecting the USB cable. Wait a few seconds until the yellow (ACT) LED starts to blink. At this point you can release the BOOT push button.
5) In the terminal program you can see a message like the following:
5) Press any key in the terminal program.
6) Select the file to transfer clicking File/Transfer/XMODEM/Send… as in the next picture:

7) Select the file name to transfer.

8) Click the Open button. The transmission should start and you will see a progress bar.
CMSIS-DAP firmware
The CMSIS-DAP firmware is provided as source code and is fully configurable to a new debug unit. A source code template and several reference implementations for popular debug units are provided. Refer to Firmware configuration for more information.
The CMSIS-DAP firmware stack is composed of the following components:
- CMSIS-DAP firmware that interfaces to JTAG or SWD pins using standard I/O pins of the Cortex-M device.
- CMSIS-Driver USART that connects:
- the UART of the Cortex-M device to the SWO output from the target.
- an additional UART of the Cortex-M device to the UART from the target.
- a custom class (for USB bulk endpoints),
- the CDC ACM class to export USB COM Port.
In the examples provided, the MDK-Middleware USB stack has been used. However, it is possible to use alternative USB stacks.
- CMSIS-DAP v1.x is deprecated and not recommended for new designs.
- Use CMSIS-DAP v2.x instead that provides high-speed SWO trace streaming and does not require driver installation in modern operating systems (Mac OS, Linux, Windows). Refer to Installing CMSIS-DAP enabled debug adapters for more information.
Validation
CMSIS-DAP compliant debug units must be validated using the scripts provided in Validate the debug unit operation.
CMSIS-DAP

CMSIS-DAP is generally implemented as an on-board interface chip, providing direct USB connection from a development board to a debugger running on a host computer on one side, and over JTAG (Joint Test Action Group) or SWD (Serial Wire Debug) to the target device to access the Coresight DAP on the other. Official reference can be found here.
Configuration
If you would like to use this tool for firmware uploading, please change upload protocol:
Drivers
Please install Windows serial driver and check “USB Driver Installation” guide for your board.
Please install “udev” rules 99-platformio-udev.rules . If you already installed them before, please check that your rules are up-to-date or repeat steps.
Platforms
Atmel | SMART offers Flash- based ARM products based on the ARM Cortex-M0+, Cortex-M3 and Cortex-M4 architectures, ranging from 8KB to 2MB of Flash including a rich peripheral and feature mix.
ESP32 is a series of low-cost, low-power system on a chip microcontrollers with integrated Wi-Fi and Bluetooth. ESP32 integrates an antenna switch, RF balun, power amplifier, low-noise receive amplifier, filters, and power management modules.
Freescale Kinetis Microcontrollers is family of multiple hardware- and software-compatible ARM Cortex-M0+, Cortex-M4 and Cortex-M7-based MCU series. Kinetis MCUs offer exceptional low-power performance, scalability and feature integration.
Maxim’s microcontrollers provide low-power, efficient, and secure solutions for challenging embedded applications. Maxim’s processors embed cutting-edge technologies to secure data and intellectual property, proven analog circuitry for real-world applications, and battery-conserving low power operation.
The Nordic nRF51 Series is a family of highly flexible, multi-protocol, system-on-chip (SoC) devices for ultra-low power wireless applications. nRF51 Series devices support a range of protocol stacks including Bluetooth Smart (previously called Bluetooth low energy), ANT and proprietary 2.4GHz protocols such as Gazell.
The nRF52 Series are built for speed to carry out increasingly complex tasks in the shortest possible time and return to sleep, conserving precious battery power. They have a Cortex-M4F processor which makes them quite capable Bluetooth Smart SoCs.
The NXP LPC is a family of 32-bit microcontroller integrated circuits by NXP Semiconductors. The LPC chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Internally, each microcontroller consists of the processor core, static RAM memory, flash memory, debugging interface, and various peripherals.
RP2040 is a low-cost, high-performance microcontroller device with a large on-chip memory, symmetric dual-core processor complex, and rich peripheral.
The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development.
Frameworks
Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
Vendor-independent hardware abstraction layer for the Cortex-M processor series
Espressif IoT Development Framework. Official development framework for ESP32 chip
Open source ARM Cortex-M microcontroller library
Arm Mbed OS is a platform operating system designed for the internet of things
Standard Peripheral Library for ST STM32 microcontrollers
STM32Cube embedded software libraries, including: The HAL hardware abstraction layer, enabling portability between different STM32 devices via standardized API calls; The Low-Layer (LL) APIs, a light-weight, optimized, expert oriented set of APIs designed for both performance and runtime efficiency
Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures
Boards
For more detailed board information please scroll tables below by horizontal.
