Beside of USBDM, there is another Open Source implementation of a debug interface for the Freedom Board OpenSDA: CMSIS-DAP.

CMSIS-DAP (Source: http://nimblemachines.com/cmsis-dap/)
CMSIS-DAP stands for ‘Cortex Microcontroller Software Interface Standard – Debug Access Port’) has been published by ARM Inc. With this, there is an open source alternative to proprietary implementation (e.g. P&E OpenSDA or Segger OpenSDA).
Beside of the ARM MDK IDE, CMSIS-DAP is supported by Coocox and IAR. And IAR is what I’m using in this post.
CMSIS-DAP Firmware for OpenSDA
The CMIS-DAP firmware sources are availble from ARM CMSIS-DAP: (requires registration). Unfortunately, this is set up to be compiled with the ARM/Keil MDK IDE :-(.
The good news is: the Freescale Quick Start Package includes a pre-built version of the firmware:
Download that zip file, then unpack the files. Updating the OpenSDA firmware follows the usual process:
- Power the FRDM-KL25Z with reset button pressed: green LED flashes.
- Copy the CMSIS-DAP_OpenSDA.s19 to the BOOTLOADER device.
- Repower the board without the reset button pressed.
Then the device should show up as ‘OpenSDA CMSIS-DAP’:
❗ CMSIS-DAP now does *not* support a virtual COM (USB CDC) port. Such a port is supported by the original P&E OpenSDA and as well by the USBDM OpenSDA.
CMSIS-DAP in IAR Embedded Workbench
Once I have a project in IAR, it is really simple to change it to use CMSIS-DAP. I use the menu Project > Options… and select CMSIS DAP as Driver:
Then the CMSIS-DAP is enabled, and it automatically has SWD (Single Wire Debug) selected:
That’s it! Now I can debug my application with CMSIS-DAP:
Summary
With the CMSIS-DAP I have another open source OpenSDA debug interface beside of USBDM. USBDM is supported by CodeWarrior, and CMSIS-DAP is supported by IAR/Keil/Coocox, so this makes it an attractive alternative for the ‘open source lovers’. The low-level bootloader of the OpenSDA is not Open Source, but with CMSIS-DAP the chances are good to have a fully open source run control hardware plus software for ARM cores. And that CMSIS-DAP would the de-facto standard to debug any ARM core. And mbed jumped on the CMSIS-DAP wagon already (see links below).
Happy DAPing 🙂
Links
- ARM CMSIS-DAP: (requires registration)
- Using Keil with Freedom Board and CMSIS-DAP
- Freescale Quick Start Package with CMSIS-DAP SDA Firmware
- mbed and CMSIS-DAP: https://mbed.org/handbook/CMSIS-DAP
Reblogged this on misentopop.
LikeLike
I hope this is integrated with a GDB server. Then we would have a nice low cost unlimited toolchain.
LikeLike
Hi Luke,
I have not tried GDB server yet. But I noticed that P&E has one for OpenSDA: http://www.pemicro.com/products/product_viewDetails.cfm?product_id=15320151
LikeLike
I tried to use the P&E one but could not get the licensing to work.
The GDB server for USBDM worked well with Eclipse + codesourcery. Only it could not “Run to Line” – it could be my error though.
I like the idea of a FOSS unlimited toolchain for small companies who need to save capital for hardware/tools rather than pay for more compiler seats.
As an FAE I try lots of
LikeLike
As I have not looked into the P&E one: do you say the licensing terms did not work for you? Or is there any licensing enforcement which failed? I love FOSS tools, but at least to me it always a balance beween ‘do it yourself’ kind of thing or spending at least a few $ to get over that hump. I think with the great movement to ARM cores and the broad availability of vendors the prices already went down, or vendors are providing reasonable free limits. On the other side: some silicon vendors are affraid to give away their tools, because the ‘independent’ software tool vendors want to keep their business model. FOSS only works if there are people and users out there willing to spend their time and talent on this, with no or very limited return of investment. I guess the business model will change anyway.
LikeLike
Pingback: Bricking and Recovering FRDM-KL25Z Boards: Reset, SWD Clock and Low Power | MCU on Eclipse
Pingback: Using Keil µVision (ARM-MDK) with Processor Expert Driver Suite | MCU on Eclipse
Pingback: DIY Free Toolchain for Kinetis: Part 3 – Debugger (GDB Server with P&E and Segger) | MCU on Eclipse
Pingback: The Freescale OpenSDA Trap: “No Device Available”, or something like that…. | MCU on Eclipse
If CMSIS-DAP is avaliable for KL25Z itself with IAR, that is much better.
LikeLike
Eric,
1.) Can this be used in Freescale CodeWarrior (specifically CW10.2) with Kinetis MCU (specifically K10 ==> Cortex M4)?
2.) Does this option provide the same debugging tools as the P&E Tracelink?
LikeLike
1) Yes, you can use the IAR tools with K10 as well. It is very much the same (JTAG instead of SWD)
2) For normal run control (setting breakpoints/etc) it is the same as P&E Tracelink. I have not measured the speed, but I feel that the P&E Tracelink is faster. But to my knowledge there is no trace support with CMSIS-DAP.
LikeLike
Pingback: Using the FRDM-K64F with CodeWarrior | MCU on Eclipse
Pingback: Segger J-Link Firmware for OpenSDAv2 | MCU on Eclipse
Pingback: Using Kinetis Design Studio with IAR Embedded Workbench IDE | MCU on Eclipse
Pingback: Using the Freescale Freedom (FRDM-KL43Z) to Debug other Boards | MCU on Eclipse
Hi Erich – I know it’s an old post but the CMSIS-DAP block diagram graphic link seems to be broken.
LikeLike
Thanks for pointing this out. The link is still working, but somehow the image does not show up. I have fixed it now. Thanks!
LikeLike
At the time, I happily followed this and several other guides to make a CMSIS-DAP from my FRDM-KL25Z (bought it just to become CMSIS-DAP). While It works OK, I’ve found an even cheaper ($3.2) way:
A programmer has ported the main part of CMSIS-DAP for STM32F103 so in short it’s here:
https://github.com/x893/CMSIS-DAP
There are also pre-compiled .hex files for those who can not compile it:
https://github.com/x893/CMSIS-DAP/tree/master/Firmware/STM32/hex
Now the cheap part: there is a $3 .. 3.40 board with stm32F103 on ebay, described here:
https://github.com/palhartinger/HowTo-STM32F103C8T6/wiki/2_-Board-description.
How to flash it – via the serial port (pin PA9 & PA10) using stm32flash under Linux. But first we convert the .hex to .bin:
arm-none-eabi-objcopy -I ihex –output-target=binary CMSIS-DAP-STLINK21.hex CMSIS-DAP-STLINK21.bin
Then we flash (boot0 jumper set at position 1, power-cycled to put MCU in serial bootloader mode):
stm32flash -w CMSIS-DAP-STLINK21.bin -v -g 0x0 /dev/ttyUSB0
LikeLike
Hi Angel,
Thanks for the links and the information provided!
I have found the most difficult part for CMSIS-DAP is not to get a reasonable (or cheap) board. The problem is the quality of the flash programming/configuration files for boards and devices. It works ok for the more popular ones (e.g. FRDM-KL25Z), but as soon as another (less popular board or device) is used, in my experience it hardly works.
Erich
LikeLike
Hi,
It is really helpfull.
The prpoblem is that i made these steps but i become this error: “Fatal error: CPU did not power up Session aborted!” and i don’t know why.
Any help?
Thanks
LikeLike
Hi Bayram,
can you check if the CPU is properly powered?
LikeLike