Kinetis SDK and FRDM-K64F

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

Kinetis SDK and FRDM-K64F

Kinetis SDK and FRDM-K64F

Kinetis SDK is a new complimentary software offering from Freescale for Kinetis microcontrollers. The Kinetis software development kit (SDK) provides an extensive suite of robust peripheral drivers, stacks, middleware and example applications designed to simplify and accelerate application development on Kinetis MCUs. The addition of Processor Expert technology for software and board support configuration provides unmatched ease of use and flexibility. The Kinetis SDK includes full source code under a permissive open-source license for all hardware abstraction and peripheral driver software.

 

Kinetis SDK can be downloaded from the following location: http://freescale.com/ksdk

 

This document goes over the basics of starting with Kinetis SDK and common troubleshooting tips.

 

Getting Started with Kinetis SDK and FRDM-K64F

The FRDM-K64F is a fully featured Freescale Freedom board with a 120MHz Cortex M4 based Kinetis K64 MCU. The board also features Arduino hardware compatibility, an accelerometer and magnetometer (Freescale’s FXOS8700CQ), and push buttons/LEDs, plus an Ethernet port, microSD port, and OpenSDAv2 for debugging.

 

First download and install the latest release of Kinetis SDK from http://freescale.com/ksdk

 

Then select one of the five IDEs that Kinetis SDK supports:

Note that Kinetis Design Studio and ARM GCC are code sized unlimited and will also run on Linux.

 

Then take a look at the documentation in the /doc folder, in particular the Release Notes and the Getting Started with Kinetis SDK (KSDK) documents. The Release Notes contain an overview of Kinetis SDK, supported devices, details on the directory structure, and known issues.

 

Also note the basic Kinetis SDK directory structure. More details can be found in the Release Notes:

  • demos – SDK examples and demos
  • boards –board specific files
  • lib – where the compiled SDK libraries reside
  • platform – SDK driver and HAL source code, linker files, and startup code

 

 

Since all the examples are in the demos folder, check out the “hello_world” project at \demos\hello_world\<ide>\frdmk64f\hello_world.eww of it for a simple hello world type app.

Use the Getting Started with KSDK Guide for details on how to compile and run the demo for your particular IDE.

 

Also check out the Kinetis SDK FAQ for information on other boards supported by Kinetis SDK, MQX RTOS and other RTOS support, USB support with KSDK, and much much more.

 

Debugging Kinetis SDK on FRDM-K64F:

Typically, debugging is done via the OpenSDAv2 circuit built onto the FRDM-K64F board. Make sure to use the USB connector to the left of the Ethernet port, J26. By default the FRDM-K64F uses the CMSIS-DAP/mbed interface as the debug protocol. However it is also possible to use the P&E Micro or Segger JLink debug interfaces with the board instead.

 

Debugging with CMSIS-DAP/mbed Interface:

The FRDM-K64F board uses the CMSIS-DAP/mbed interface by default as it is using OpenSDAv2. The KSDK 1.1 demo projects should be setup to use the CMSIS-DAP debug interface by default for the FRDM-K64F projects.

 

Debugging with P&E Micro Interface:

To debug using the P&E Micro interface, the P&E Micro OpenSDAv2 app needs to be loaded onto the OpenSDAv2 circuit. Instructions for loading and using this app are in Appendix C of the Getting Started with KSDK Guide. Use the DEBUG_K64F_MBED_PEMICRO_V108.BIN file that came inside the Kinetis SDK zip file.

If you want to return to the original CMSIS-DAP/mbed interface, you can find a binary app to drag-and-drop onto the OpenSDAv2 bootloader on the FRDM-K64F mbed page. Firmware FRDM K64F - Handbook | mbed

11439_11439.pngpastedImage_2.png

 

Troubleshooting:

I’m using the CMSIS-DAP/mbed debug interface with IAR, and I can’t connect to my board anymore with an error: “Fatal error: Probe not found. Session aborted!”:

There’s an issue as described in the Kinets SDK release notes where the debugger can become non-responsive if the code is allowed to exit the main() function when using the CMSIS-DAP interface with OpenSDAv2.

 

To recover the board you have a few options:

  1. Load the P&E Micro interface app onto OpenSDAv2, and then flash a known good program
  2. The board should still enumerate as a mass storage device, and you can drag-and-drop a known good program onto the board. You may have to hit the reset button a few times to get it to properly enumerate though. A known good hello_world program has been attached to this post.

 

This will be fixed in future versions of the CMSIS-DAP/mbed interface app. In the meantime, make sure to put a while(1) loop in your code before exiting main(). Also check out the blog entry on this issue on MCU on Eclipse

 

The serial port is not enumerating:

If using the default CMSIS-DAP/mbed interface, you must first install the mbed Windows serial port driver before it will enumerate on Windows properly. It should work in Mac OS and Linux without a driver.

 

When I start debugging, I get an error message that says “Undected. Disconnect/Connect USB cable. Click Refresh List”:

The likely problem is that the FRDM-K64F has the default CMSIS-DAP/mbed firmware, and your project is trying to use the P&E Micro or JLink interface. Change the debug interface in your IDE to use CMSIS-DAP. Or else change the firmware in the OpenSDAv2 circuit to the proper firmware as described in Appendix C of the Getting Started with KSDK document.

 

When compiling the Kinetis SDK platform library in IAR 7.10.x, I the following error messages: Error[Pm056]: all if, else if constructs should contain a final else clause (MISRA C 2004 rule 14.10):

This is caused by a MISRA C 2004 rule violation. The beta Kinetis SDK was built using IAR 6.70, but the MISRA C checks were changed when IAR moved to 7.10.x which is why this comes up in IAR 7.10.x.

 

This error can be fixed by disabling MISRA C checking in the project settings.

 

Right click on the platform_lib project, and under the General Options category, scroll over (using the arrow keys on the right) to the MISRA-C-2004 tab, and uncheck “Enable MISRA-C”.

11440_11440.pngpastedImage_4.png

 

When debugging with the P&E Micro OpenSDAv2 app, I get an error that says “Error reading data from OpenSDA hardware. E17925”

This is being investigated and seems to affect IAR 7.10.x and CW10, but not earlier versions of IAR. In the meantime, use the CMSIS-DAP/mbed interface app instead.

Labels (1)
Attachments
Comments

Has anyone built any apps under the SDK using gcc tools? 

I have been able to just extract code from the SDK and build my own stuff; however, I have not been able to successfully build directly using the makefiles under the various apps.  My environment is W7 with cygwin and codesourcery's cross compiler.   Refer to FRDM-K64F Startup problems for details.

Personally I did not buy IAR for this; however, as you can see from my post above, I was also not successful in directly building the SDK stuff with GCC.  I just pulled out stuff I needed and created my own build (using gcc/make).  It wasn't too bad; however, it would have been nice to see the GCC stuff just work out of the box.

You can turn off the MISRA checking in the IAR project settings if you're using the eval version, and that should get you up and going.

KSDK supports IAR, Keil, Kinetis Design Studio, and GCC. Instructions for all those tool chains can be found in the \doc folder in the "KInetis SDK K64 User's Guide" document.

I was able to build and debug with the GCC/MinGW solution described in the user guide document. I think some people have used cygwin as well, though as Ed stated he was having problems. You still need to use "mingw32-make" instead of just "make" even with cygwin.

You might have a look at Erich Styger's tutorials on his blog: Constructing a Classroom IDE with Eclipse for ARM | MCU on Eclipse

I have managed to successfully build projects for the FRDM K64F using Eclipse Luna and the new KSDK 1.2.0 using GNU Tools for ARM Embedded Processors. I have created a blog on how to set it all up. Hope it helps: Toolchain: KSDK 1.2.0 with Eclipse 4.4 (Luna) and GNU ARM Plugin | Centaurian

No ratings
Version history
Last update:
‎05-01-2014 09:36 AM
Updated by: