FRDM-K22F: Debugging with P&E OpenSDAv2.1 Firmware

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

FRDM-K22F: Debugging with P&E OpenSDAv2.1 Firmware

FRDM-K22F: Debugging with P&E OpenSDAv2.1 Firmware

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:

  • OpenSDAv2.1 boards (FRDM-K22F for now)
  • Kinetis Design Studio V1.1.0

 

13843_13843.pngpastedImage_0.png

 

Outline

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)

 

Update KDS from P&E Update Web Site

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:
13856_13856.pngpastedImage_6.png
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:

13857_13857.pngpastedImage_7.png
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:

13858_13858.pngpastedImage_8.png

d) Enter http://www.pemicro.com/eclipse/updates as update Location and press OK:

13859_13859.pngpastedImage_9.png

e) Then update from P&E's website:

13861_13861.pngpastedImage_13.png

 

Installation of P&E OpenSDA V2.1 Firmware

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

 

  1. Go to http://www.pemicro.com/opensda/ and download the OpenSDA Firmware Apps file (zip file) (requires registration at P&E)
  2. Unzip the firmware files to a folder on your harddisk.
  3. Power the board/Plug in the USB cable with the OpenSDA USB port, while having the Reset/SW1 pressed.
    13844_13844.pngpastedImage_6.png
  4. The device should enumerate BOOTLOADER: device on your host. You are now in bootloader mode.
    13845_13845.pngpastedImage_8.png
  5. Copy the the correct firmware file (DEBUG-FRDM-K22F_Pemicro_v108b_for_OpenSDA_v2.1.bin) to the BOOTLOADER device. Wait a few seconds to complete the operation.
  6. Unplug the board, and now power it normally (without SW1 pressed)
  7. The board should now show up as OpenSDA device, a virtual COM port and as PEMicro OpenSDA Debug Driver:
    13840_13840.pngpastedImage_5.png13841_13841.pngpastedImage_7.png13842_13842.pngpastedImage_8.png
  8. You are ready to use to debug the FRDM-K22F as if you would use a P&E Multilink :-)

 

Debugging with P&E 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):

13851_13851.pngpastedImage_0.png

 

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:

13852_13852.pngpastedImage_1.png

 

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:

13849_13849.pngpastedImage_1.png

Or use the debug icon drop-down list:

13853_13853.pngpastedImage_3.png

And then I'm debugging the FRDM-K22 with the P&E OpenSDAv2.1:

13862_13862.pngpastedImage_0.png

Happy Debugging :-)

 

Technical Details

There are so far three versions of the OpenSDA available:

  1. 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).
  2. 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.
  3. 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.

 

See also: OpenSDAv2

Labels (1)
No ratings
Version history
Last update:
‎08-07-2014 04:58 AM
Updated by: