element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Freedom development platform
  • Products
  • Dev Tools
  • Freedom development platform
  • More
  • Cancel
Freedom development platform
Blog [FRDM-K22F - KDS - OpenSDAv2.1] Tutorial: Set-up the debug interface with P&E OpenSDAv2.1 Firmware
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Freedom development platform to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: bheemarao
  • Date Created: 18 Aug 2014 10:32 AM Date Created
  • Views 641 views
  • Likes 0 likes
  • Comments 0 comments
  • frdm-k22f
  • opensdav2.1
  • tagged
  • frdm-k22fcontent
  • segger_j-linkcontent
  • kinetis-kcontent
  • kinetis_design_studio
  • with
  • kinetis-k
  • segger_j-link
Related
Recommended

[FRDM-K22F - KDS - OpenSDAv2.1] Tutorial: Set-up the debug interface with P&E OpenSDAv2.1 Firmware

bheemarao
bheemarao
18 Aug 2014

“This tutorial was extracted from Erich Styger blog https://community.freescale.com/docs/DOC-101792 with his agreement.”

 

This document explains how you can debug the FRDM-K22FFRDM-K22F board with the P&E OpenSDAv2.1 Firmware and the Kinetis Design Studio V1.1.0.

 

Applicable to:

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

(Download link: http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=KDS_IDE&fpsp=1&tab=Design_Tools_Tab)

 

image


Outline

 

The FRDM-K22FFRDM-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 - KDS - OpenSDAv2.1] Tutorial: Set-up the debug interface 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:


image


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:


image


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:


image


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


image


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


image

 

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.


                      image

 

1. The device should enumerate BOOTLOADER: device on your host. You are now in bootloader mode.


                         image

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

3. Unplug the board, and now power it normally (without SW1 pressed)

4. The board should now show up as OpenSDA device, a virtual COM port and as PEMicro OpenSDA Debug Driver:
                                                                  image

 

          imageimage


5. You are ready to use to debug the FRDM-K22F as if you would use a P&E Multilink image

 

 

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


   image


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:


image



That's it. Now you can debug your application with P&E OpenSDA V2.1 firmware on the board image. You can use the 'Debug' button in the launch configuration:



      image


Or use the debug icon drop-down list:


                                        image


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


           image


Happy Debugging image


 

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.

  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube