CMSIS-DAP with IAR and the KL25Z Freedom Board


Beside of USBDM, there is another Open Source implementation of a debug interface for the Freedom Board OpenSDA: 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 block diagram (Source: http://nimblemachines.com/cmsis-dap/)

CMSIS-DAP block diagram (Source: http://nimblemachines.com/cmsis-dap/)

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:

CMSIS-DAP_OpenSDA.s19 in FRDM-KL25Z_QSP,zip

CMSIS-DAP_OpenSDA.s19 in FRDM-KL25Z_QSP,zip

Download that zip file, then unpack the files. Updating the OpenSDA firmware follows the usual process:

  1. Power the FRDM-KL25Z with reset button pressed: green LED flashes.
  2. Copy the CMSIS-DAP_OpenSDA.s19 to the BOOTLOADER device.
  3. Repower the board without the reset button pressed.

Then the device should show up as ‘OpenSDA CMSIS-DAP':

OpenSDA CMSIS-DAP

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:

CMSIS DAP Driver

CMSIS DAP Driver

Then the CMSIS-DAP is enabled, and it automatically has SWD (Single Wire Debug) selected:

CMSIS DAP settings in IAR

CMSIS DAP settings in IAR

That’s it! Now I can debug my application with CMSIS-DAP:

IAR Embedded Workbench IDE debugging with CMSIS-DAP and FRDM-KL25Z

IAR Embedded Workbench IDE debugging with CMSIS-DAP and FRDM-KL25Z

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

About these ads

14 thoughts on “CMSIS-DAP with IAR and the KL25Z Freedom Board

      • 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

        Like

      • 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.

        Like

  1. Pingback: Bricking and Recovering FRDM-KL25Z Boards: Reset, SWD Clock and Low Power | MCU on Eclipse

  2. Pingback: Using Keil µVision (ARM-MDK) with Processor Expert Driver Suite | MCU on Eclipse

  3. Pingback: DIY Free Toolchain for Kinetis: Part 3 – Debugger (GDB Server with P&E and Segger) | MCU on Eclipse

  4. Pingback: The Freescale OpenSDA Trap: “No Device Available”, or something like that…. | MCU on Eclipse

  5. 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?

    Like

    • 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.

      Like

  6. Pingback: Using the FRDM-K64F with CodeWarrior | MCU on Eclipse

  7. Pingback: Segger J-Link Firmware for OpenSDAv2 | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s