This document explains how you can debug the FRDM-K22F board with the P&E OpenSDAv2.1 Firmware and the Kinetis Design Studio V1.1.0.
Applicable to:
The FRDM-K22F board (FRDM-K22F|Freedom Development Board|Kinetis|Freescale) comes with OpenSDAv2.1 programmed on it, and has the CMSIS-DAP debug firmware on it by default.
(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 P&E OpenSDAv2.1 firmware to debug the board.
(Another solution is to use the Segger J-Link OpenSDAv2.1 firmware, see FRDM-K22F: Debugging with Segger J-Link OpenSDAv2.1 Firmware)
For KDS V1.1.0, you need to install an update throught an Eclipse update. The update is from www.pemicro.com/eclipse/updates within the Install New Updates dialog under the Eclipse Help menu.
!!!! Please note that there is a known issue in KDS V1.1.0 which requires to remove and add a link to P&E's update site in order for installation procedure to work in KDS v1.02. Please see description below:
Issue: The default P&E update site included in KDS v1.02 (PEMicro - http://www.pemicro.com/eclipse/updates) will not allow a user to properly update the P&E plugin on a freshly installed KDS 1.02 layout.
Workaround:
a. Remove the PEMicro - http://www.pemicro.com/eclipse/updates update site from the list of available update sites. Use the menu Help > Perferences > Install/Updates > Available Software Sites and Remove the PEMicro entry:
b. Exit the KDS Eclipse IDE and restart it from the command line with the -clean parameter. On Windows start Eclipes from the cmd.exe (DOS shell) with the -clean parameter:
c. In Eclipse, add the PEMicro - http://www.pemicro.com/eclipse/updates update site. Use the menu Help > Install New Software and press the Add button:
d) Enter http://www.pemicro.com/eclipse/updates as update Location and press OK:
e) Then update from P&E's website:
You need to install the P&E OpenSDAv2.1 firmware on the board, and you only need to do this once (unless you change the firmware again).
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):
In the Debugger tab, specify OpenSDA Embedded Debug as Interface, select the OpenSDA device as Port, and select the K22FN512M12 as device, and make sure 'SWD' is selected:
That's it. Now you can debug your application with P&E 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:
And then I'm debugging the FRDM-K22 with the P&E OpenSDAv2.1:
Happy Debugging :-)
There are so far three versions of the OpenSDA available:
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.
See also: OpenSDAv2