Tutorial: FreeRTOS Projects with Kinetis SDK V1.3 and the SDK Project Generator

This tutorial describes how to create a Kinetis SDK V1.3 project using the Freescale project generator in Kinetis Design Studio.

project generator

project generator

Outline

In this tutorial I show how to create projects with the Kinetis SDK Project Generator utility. That generator utility can create projects for different IDE’s. So instead waiting for the IDE vendors and providers to example projects or wizards to create projects, the project generator can create projects which then can be imported and used with different IDE’s.

Installation

I’m using here the Freescale Freedom FRDM-K64F board, Freescale Kinetis Design Studio V3.0.0, the Kinetis SDK v1.3 and the Freescale project generator. In general, this tutorial will work as well for any other IDE or tool combination (I hope). If you have some or all the items below already installed, you can skip some steps. The downloads below require that you have registered your account at Freescale.

  1. Download and install the Kinetis Design Studio (KDS) from http://www.freescale.com/kds.
    Use the ‘Downloads’ tab and select the installer for your host operating system. Then run the installer with the default settings.

    Kinetis Design Studio Download Section

    Kinetis Design Studio Download Section

  2. Download and install the Kinetis SDK from http://www.freescale.com/ksdk. Run the installer with the default settings.

    SDKv1.3 Download Section

    SDKv1.3 Download Section

  3. Optionally, to make KDS aware of all the devices supported in the Kinetis SDK, there is an Eclipse update available. This extends the KDS project wizard plus adds Processor Expert device support. Use the menu Help > Install New Software in KDS and update it from the update zip file inside the SDK. On Windows it is this one:
    C:\Freescale\KSDK_1.3.0\tools\eclipse_update\KSDK_1.3.0_Eclipse_Update.zip

    Installing SDK V1.3 Update in Eclipse

    Installing SDK V1.3 Update in Eclipse

  4. Download the Kinetis SDK Project Generator from here. This is a zip archive, unpack it to a location of your choice (I’m using the folder C:\Freescale\KSDK_Project_Generator_V1.0).

    Kinetis SDK Project Generator

    Kinetis SDK Project Generator

This complete the setup :-).

Creating Project with Project Generator

Launch the Project Generator executable (On Windows: <GeneratorPath>\Windows\KSDK_Project_Generator.exe).

In the generator dialog, specify a project name and select the boar

KSDK Project Generator

KSDK Project Generator

To generate a FreeRTOS project, use the ‘Advanced’ button:

KSDK Project Generator Advanced Button

KSDK Project Generator Advanced Button

Here select the IDE/Toolchain (Kinetis Design Studio), the operating system (FreeRTOS) and select ‘standalone project’ with the directory where the project shall be generated. I recommend to use the Eclipse workspace location, but it could be anywhere else too.

💡 I recommend to use the standalone project because that way all the needed files get copied, so there are no links and dependencies left to the SDK installation folder.

Advanced Project Generator Settings

Advanced Project Generator Settings

Use the ‘Generate’ button to create the project:

Advanced Generate

Advanced Generate

With this, the project gets created in the specified project folder.

💡 The project generation sometime hangs forever. Close the generator and start over again. Try to remove the settings.json present in the same folder as the executable program.

Project Generated

Project Generated

💡 The ‘standalone’ option still does create linked files in the project which is somewhat unexpected.

Importing Project in Eclipse

To use the project in KDS, I have to import it into my workspace.

For this I use the menu File > Import > General > Existing Projects into Workspace in KDS/Eclipse and specify the location where the project has been generated by the generator in the previous step.

Actually there are two projects: a library project which includes the

Importing Projects

Importing Projects

This imports the project(s) into the workspace so I can build them:

Imported Projects

Imported Projects

The first thing I recommend to change for both projects is to enable ‘parallel build’, otherwise the build might take very long:

Enable Parallel Build

Enable Parallel Build

Project and the library should build just fine. And debugging the projects works out-of-the-box :-):

Debugging FreeRTOS Project

Debugging FreeRTOS Project

Enabling ‘print size’ (see “GNU Additional Tools: Create Flash Image, Print Size and Extended Listing Options“) shows that the example project has a lot of SDK code added beside the operating system itself:

Invoking: Cross ARM GNU Print Size
arm-none-eabi-size --format=berkeley "SDK_with_FreeRTOS_MK64FN1M0VLL12.elf"
   text       data        bss        dec        hex    filename
  17944        132       9952      28028       6d7c    SDK_with_FreeRTOS_MK64FN1M0VLL12.elf

So that code size is not ideal, but caused by the way the SDK with the RTOS is put together, so there is a lot of room for improvements. For now, I’ll keep it like that, as optimzing Kinetis SDK would be worth of a whole other article series.

Summary

If the generator now would create better project settings, that would make that a perfect solution. The Kinetis SDK Project Generator solves the problem that every IDE would need its own project creation tool for the Kinetis SDK. Instead, the projects get created by the tool who should know the SDK best which is a positive thing.

Links

5 thoughts on “Tutorial: FreeRTOS Projects with Kinetis SDK V1.3 and the SDK Project Generator

  1. Depending on your naming convention, on the first build, you may have to build the ksdk_freertoslib(board/device) project before your own. Just due to a dependency error.

    This happened even though I selected parallel build.

    Like

  2. Pingback: First NXP Kinetis SDK Release: SDK V2.0 with Online On-Demand Package Builder | MCU on Eclipse

  3. Pingback: Tutorial: Blinky with Kinetis SDK V1.3 and Processor Expert | MCU on Eclipse

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.