Tutorial: Using Kinetis Design Studio V3.0.0 with IAR and Keil IDE’s

Freescale Kinetis Design Studio V3.0.0 came out early May this year. One of the new cool features is that it includes the Processor Expert V3.0.0 with an extended New Project Wizard. With this wizard I’m able to create and use Processor Expert projects with IAR Embedded Workbench and Keil MDK :-).

Kinetis Design Studio, Keil MDK and IAR Embedded Workbench

Kinetis Design Studio, Keil MDK and IAR Embedded Workbench

That way I can use all the new Kinetis Devices with IAR and Keil tools even if they are not included in the Driver Suite V10.4 yet. This tutorial shows how I can use both IAR Embedded Workbench and Keil MDK with the microcontroller supported in Kinetis Design Studio.

How does it work?

When creating a project for Kinetis Design Studio, it asks me which compiler I want to use. In the case of Processor Expert, there is the ProjectInfo.xml file generated which is read by the external IAR or Keil IDE. That ProjectInfo.xml gets updated inside KDS when I change Processor Expert options or add/remove components.

Using Kinetis Design Studio with Keil and IAR

Using Kinetis Design Studio with Keil and IAR

The ProjectInfo.xml contains all information needed by either Keil or IAR IDE: which device is used, what are the options/defines, what are the files, etc.

💡 Only Processor Expert projects create the ProjectInfo.xml file.

Below is an example of such a ProjectInfo.xml file:

<?xml version="1.0" encoding="UTF-8"?>
<!--

  Copyright : 2012 Freescale, Inc. All Rights Reserved.

  This configuration file is a standard interchange file that's format is maintained
  by Freescale, Inc. The configuration file is a derivative work
  of the Processor Expert Software technology licensed for use by customers
  as defined as SOFTWARE in the product's End User License Agreement. This file
  and format are free to use and distribute for read-only purposes. You do not have
  the right to create these files or modify this format or use for any purposes other
  than interchange with the Processor Expert Software technology.

  THIS SOFTWARE IS PROVIDED "AS IS".

  NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT
  LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  PURPOSE APPLY TO THIS SOFTWARE. IN NO EVENT WILL FREESCALE BE LIABLE, WHETHER
  IN CONTRACT, TORT, OR OTHERWISE, FOR ANY INCIDENTAL, SPECIAL, INDIRECT,
  CONSEQUENTIAL OR PUNITIVE DAMAGES, INCLUDING, BUT NOT LIMITED TO, DAMAGES FOR
  ANY LOSS OF USE, LOSS OF TIME, INCONVENIENCE, COMMERCIAL LOSS, OR LOST PROFITS,
  SAVINGS, OR REVENUES TO THE FULL EXTENT SUCH MAY BE DISCLAIMED BY LAW.

-->
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ProjectInfoDescription.xsd">
  <PROCESSOR>
    <DeviceID>MK64FN1M0xxx12</DeviceID>
    <CoreNum>1</CoreNum>
    <Cores>
      <Core>
        <CoreSet>Cortex-M4</CoreSet>
      </Core>
    </Cores>
    <SRAMsize>256k</SRAMsize>
    <FLASHsize>1M</FLASHsize>
  </PROCESSOR>
  <PATHS>
    <LinkerCommandFile>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Project_Settings\Linker_Files\ProcessorExpert.ld</LinkerCommandFile>
    <IncludePaths>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\inc\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\sim\MK64F12\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\clock\MK64F12\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\inc\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\osa\inc\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\CMSIS\Include\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\include\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\startup\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\SDK\platform\devices\MK64F12\startup\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Sources\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\</Path>
    </IncludePaths>
    <SourceCodePaths>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\startup\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\drivers\src\rtc\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\mcg\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\osc\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\port\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\rtc\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\sim\MK64F12\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\osa\src\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\clock\MK64F12\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\clock\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\interrupt\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Sources\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Static_Code\System\</Path>
      <Path>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\startup\gcc\</Path>
    </SourceCodePaths>
  </PATHS>
  <FILES>
    <GeneratedCs>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\CLS1.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\CS1.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\Cpu.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\KIN1.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\KSDK1.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\UTIL1.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\WAIT1.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\clockMan1.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\hardware_init.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\osa1.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\pin_init.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\startup\system_MK64F12.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\startup.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\drivers\src\rtc\fsl_rtc_common.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\mcg\fsl_mcg_hal.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\mcg\fsl_mcg_hal_modes.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\osc\fsl_osc_hal.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\port\fsl_port_hal.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\rtc\fsl_rtc_hal.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\sim\MK64F12\fsl_sim_hal_MK64F12.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\osa\src\fsl_os_abstraction_bm.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\clock\MK64F12\fsl_clock_MK64F12.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\clock\fsl_clock_manager.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\clock\fsl_clock_manager_common.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\interrupt\fsl_interrupt_manager.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Sources\Events.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Sources\main.c</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Static_Code\System\PE_low_level_init.c</PathName>
    </GeneratedCs>
    <GeneratedHs>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\CLS1.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\CS1.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\Cpu.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\KIN1.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\KSDK1.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\PE_KSDK_Types.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\PE_low_level_init.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\SDK\platform\devices\MK64F12\startup\system_MK64F12.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\UTIL1.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\WAIT1.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\board.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\clockMan1.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\osa1.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Generated_Code\pin_init.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\CMSIS\Include\arm_common_tables.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\CMSIS\Include\arm_const_structs.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\CMSIS\Include\arm_math.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\CMSIS\Include\core_cm4.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\CMSIS\Include\core_cmFunc.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\CMSIS\Include\core_cmInstr.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\CMSIS\Include\core_cmSimd.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\include\MK64F12.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\include\MK64F12_extension.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\include\MK64F12_features.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\include\fsl_bitaccess.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\fsl_device_registers.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\startup.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\inc\fsl_mcg_hal.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\inc\fsl_mcg_hal_modes.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\inc\fsl_osc_hal.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\inc\fsl_port_hal.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\inc\fsl_rtc_hal.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\inc\fsl_sim_hal.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\hal\src\sim\MK64F12\fsl_sim_hal_MK64F12.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\osa\inc\fsl_os_abstraction.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\osa\inc\fsl_os_abstraction_bm.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\inc\fsl_clock_manager.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\inc\fsl_interrupt_manager.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\system\src\clock\MK64F12\fsl_clock_MK64F12.h</PathName>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\Sources\Events.h</PathName>
    </GeneratedHs>
    <GeneratedASMs>
      <PathName>C:\tmp\wsp_kds_3.0.0\k64f_pex_sdk\SDK\platform\devices\MK64F12\startup\gcc\startup_MK64F12.S</PathName>
    </GeneratedASMs>
  </FILES>
  <OPTIONS>
    <BuildOptions>
      <CCoptList>
       -D CPU_MK64FN1M0VLL12
       -D FSL_OSA_BM_TIMER_CONFIG=2  
      </CCoptList>
    </BuildOptions>
  </OPTIONS>
</export>

The only difference is how the Keil or IAR project then gets created, and how the settings are imported:

  • Keil: this IDE has a startup import option to import (-i) the ProjectInfo.xml. So I can launch the Keil IDE from Eclipse with that option, and it will create me a Keil project, ready to use.
  • IAR: The IAR Embedded Workbench has a Project Connector concept: I need to create a new empty project in IAR, then use the Project connector to link to the ProjectInfo.xml file, where it then reads all the necessary information.

Project Creation

The project creation is as for the Kinetis Design Studio which uses GNU GCC. Except that in the last dialog of the wizard I select either IAR or Keil to be used as compiler.

Create a new project with menu File > New > Kinetis Project. In that wizard, I select the processor or board. Then I select ‘Processor Expert‘ as option:

Processor Expert Option Selected

Processor Expert Option Selected

In the next dialog, select your tool of choice: either IAR or Keil:

IAR or Keil Compiler selection

IAR or Keil Compiler selection

💡 The compiler gets asked as well if creating a Kinetis SDK project *without* Processor Expert. But such a project cannot be used directly with IAR/Keil, as the linker file created by the wizard is still for the GNU linker.

Press Finish, and project gets created.

IAR Embedded Workbench

To use the project in IAR Embedded Workbench, create a new project with menu Project > Create New Project in the IAR Embedded Workbench. In that dialog, create an Empty project for ARM:

Empty Project for ARM

Empty Project for ARM

Save the project into the project folder created by KDS:

Saving Embedded Workbench Project File

Saving Embedded Workbench Project File

Next, I’m going to connect the IAR Embedded Workbench to the project we have created. For this I use the menu Project > Add Project Connection:

Add Project Connection

Add Project Connection

Then use Freescale Processor Expert as connection:

Freescale Processor Expert Connection

Freescale Processor Expert Connection

Next it will ask me for the Processor Expert connection file, which is the ProjectInfo.xml inside the project we have created earlier.

Selecting Processor Expert Connection File

Selecting Processor Expert Connection File

💡 The ProjectInfo.xml is a file describing all the generated source files and folders. That way the IAR Embedded Workbench gets informed about any changes.

Now you can build the project in IAR Embedded Workbench:

IAR compiling KDS Project

IAR compiling KDS Project

With this, I can use the IAR Embedded Workbench with my project. And if I add or change components in KDS, the Embedded Workbench gets notified through ProjectInfo.xml.

Using ARM Keil MDK

To use the project with ARM Keil MDK, I had to select ‘Keil ARM C/C++ Compiler’ during project creation in KDS:

IAR or Keil Compiler selection

IAR or Keil Compiler selection

All the other steps for using the Keil IDE are outlined here: https://mcuoneclipse.com/2014/11/09/using-keil-%CE%BCvision-5-with-processor-expert/

Summary

Kinetis Design Studio V3.0.0 is pretty much a complete replacement of the Processor Expert Driver Suite v10.4. Only if I would use ColdFire or Vybrid, then I still would need the Driver Suite for that. Other than that, I simply can use the Kinetis Design Studio v3.0.0 to either build my projects with GNU inside Eclipse, or use the IAR Embedded Workbench and Keil IDE, all with the same one installation 🙂

Happy IDE’ing 🙂

Links:

12 thoughts on “Tutorial: Using Kinetis Design Studio V3.0.0 with IAR and Keil IDE’s

  1. Thanks again, I have tried this feature based on information provided in one of your your earlier blog posts.

    I have to say its a bit of an issue that the project folder structure in eclipse does not translate from eclipse to IAR Embedded Workbench or Keil MDK with everything being put into either GeneratedC, GeneratedH or GeneratedASM. But their is a possible alternative for for conversion for the Keil tools .

    I have played around with the Keil conversion using the Keil uVision Plugin for Eclipse ( available on the ARM Keil website) instead of this conversion method using ProjectInfo.xml .

    The Keil plugin creates a new menu item “uVision” with sub-items including “Create / Update uVision Project…” I have tried this and have been successful in creating a project that has a folder structure that’s similar to the existing project.
    But for reasons yet undetermined the Keil Project lacked all of the path information that was necessary to successfully compile the project…
    Is the Keil plugin compatible with KDS3.0?

    Like

    • Hi Chad,
      I have not used that Kiel plugin. To my understanding it is an Eclipse plugin which integrates the Keil compiler/linker/assembler into Eclipse. It should be compatible with KDS. I’m pretty sure you need to specify the path (include path) information.

      Like

  2. Hi Erich, I’m currently developing a project that useas nearly every pin of a K22 in LQFP-100 and I’m using Codewarrior v10.6 but although Processor Expert in nature is slow, having about 40 components its excruciatingly slow to generate code and compile, I’ve tried several tricks but results are still unmanageable. I’m running it in a somewhat powerful machine: i7, 8GB RAM, HyperX SSD so I think it’s not a PC HW issue.

    I’ll be willing to jump to KDS if It’s going to be a better experience. Almost in every project I find Processor Expert bugs, I submit them via Service Request and they get fixed on next revision, so I know I’ll probably still be dealing with some issues, and I haven’t jumped into KDS fearing that it would be even more buggy/immature than CW v10.6 with PExpert.

    So the main question is that if you would recommend KDS v3.0.0 over CW v10.6 in terms of speed and reliability for a production environment. Any additional comment/advice would be greatly appreciated.

    Thanks so much for your time!

    Like

  3. I am creating a new project, using KDS to generate projectinfo.xml, and IAR workbench. KDS generates absolute paths for all the files it lists in projectinfo.xml, it would really be far more helpful to be able to generate project relative path names. In particular, using IAR workbench it would be good to be able to prefix the relative paths with $PROJ_DIR$. This is a shared project, and each developer is likely to have a different absolute path to their project.

    Like

    • I think the projectinfo.xml is usig absolute paths so IAR or Keil can find the project, regardless where it is. I agree that if the Keil or the IAR project file would be in the same folder, a relative path would work too.

      Like

  4. A coworker deleted the ProjectInfo.xml file from my project directory. How do I recreate it? I’ve tried generating code again, but the ProjectInfo.xml file doesn’t get recreated. Thank you for your help.

    Like

What do you think?

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