(see 'Technical Details' at the end about the OpenSDA differences)
OpenOCD with CMSIS-DAP for FRDM-K22F is not supported in KDS V1.1.0. Trying to debug the FRDM-K22F board with KDS V1.1.0 and OpenOCD/CMSIS-DAP results in an error in the Console View and is currently not possible, until OpenSDA gets updated (see Kinetis Design Studio V1.1.0: Release Notes and News).
One solution is to use the Segger J-Link OpenSDAv2.1 firmware to debug the board.
Unzip the firmware file (JLink-OpenSDA_v2_1.bin) in the zip file to your harddisk.
Power the board/Plug in the USB cable with the OpenSDA USB port, while having the Reset/SW1 pressed.
The device should enumerate BOOTLOADER: device on your host. You are now in bootloader mode.
Copy the Segger .bin file to that BOOTLOADER device. Wait a few seconds to complete the operation.
Unplug the board, and now power it normally (without SW1 pressed)
The board should now show up as J-Link device and with a virtual COM port:
You are ready to use to debug the FRDM-K22F as if you would do with a Segger J-Link :-)
Debugging with Segger J-Link OpenSDAv2.1
Create a new debug/launch configuration: Select your project, then use the menu Run > Debug Configurations.
Use the 'new' Icon to create a new configuration for your application and project (Main tab):
Specify MK22FN512xxx12 as your device name, and make sure 'SWD' is selected:
Have SWO disabled:
That's it. Now you can debug your application with Segger J-Link OpenSDA V2.1 firmware on the board :-).
You can use the 'Debug' button in the launch configuration:
Or use the debug icon drop-down list:
Happy Debugging :-)
There are so far three versions of the OpenSDA available:
OpenSDAv1.0: this one is on all the FRDM boards like FRDM-KL25Z, FRDM-KL26Z, FRDM-KL46Z, FRDM-K20, ... (prior FRDM-K64F). The bootloader on these boards is protected and cannot be erased and supports P&E, Segger and CMSIS-DAP debug applications (*.sda).
OpenSDAv2.0: This version was released at FTF 2014 with the FRDM-K64F board. This is an open source bootloader, and the bootloader can be replaced by the user. It supports *.bin files and P&E, Segger and CMSIS-DAP debug applications.
OpenSDAv2.1: This version is released with the FRDM-K22F board. It is the same as
The debug circuit on the board is the same for all OpenSDA versions (Kinetis K20 microcontroller): the difference is what bootloader is programmed on the K20: the bootloader on the OpenSDAv1.0 cannot be erased/changed. The bootloader on OpenSDAv2.x can be erased/changed, and the difference between the OpenSDAv2.0 and v2.1 is the address where the debug application starts: for OpenSDAv2.0 it expects the application at address 0x5000, while OpenSDAv2.1 expects the application to start at address 0x8000.