Using Kinetis Design Studio with IAR Embedded Workbench IDE

For everyone who wants to combine the power of Eclipse and Processor Expert with the IAR Embedded Workbench IDE, here is how to get them working side by side:KDS with IAR

We have projects at the university where we used the IAR Embedded Workbench IDE with Processor Expert. The standard way to use Processor Expert with either Keil or IAR is using the Processor Expert Microcontroller Driver Suite. This requires either installing a plugin into an existing Eclipse, or using the standalone Driver Suite Eclipse version.

So far we had to use the Processor Expert Driver Suite v10.4 (see Processor Expert (Driver Suite/Plugins/KDS) V10.4 with new Component Inspector) in Eclipse Kepler. On the other side, many students are using the Freescale Kinetis Design Studio for their lab work too. Having two Eclipse versions installed is fine, but not very elegant and uses more disk space than needed. So why not using one Eclipse instance for both? And indeed, I have found a way to eliminate the need for Processor Expert Driver suite: it is possible to use IAR with the Freescale Kinetis Design Studio (KDS) 🙂

Outline

The following tutorial shows how to create an ARM Cortex project in Kinetis Design Studio, which then can be compiled and debugged with IAR Embedded Workbench. I’m using Kinetis Design Studio V2.0.0 (KDS) and IAR Embedded Workbench V7.30.4.8187. KDS is free of charge and unlimited, while there is a free IAR version (code size limited to 16 KByte for ARM Cortex-M0+).

Project Creation

In KDS, create a new project the usual way with the menu File > New > Kinetis Design Studio Project.

New Kinetis Design Studio

New Kinetis Design Studio

Then go through the wizard, make sure you select Processor Expert:

Processor Expert Project

Processor Expert Project

Then finish the wizard and have the project created in Eclipse.

Setup for the IAR Toolchain

By default, the project has been created for the GNU compiler in KDS. To use the project for IAR, I need to change it to use the IAR ARM Compiler. To do this, select the ProcessorExpert.pe file in the project. Then in the component inspector, select the Cpu and use the Inspector (context menu, if view is not already open), go the to Build options tab and change the compiler to IAR ARM C Compiler:

IAR ARM C Compiler Setting

IAR ARM C Compiler Setting

Then use the button to generate Processor Expert Code:

Generate Processor Expert Code

Generate Processor Expert Code

Beside of the source code, this generates a file ‘ProjectInfo.xml‘ which has information which can be used by other tools, like the IAR IDE.

Connect from IAR IDE

Launch the IAR IDE and create a new project:

Create IAR Project

Create IAR Project

Select ‘Empty project’ for ARM, press OK to create it:

Empty ARM Project

Empty ARM Project

The IAR IDE will ask to save the project file (*.ewp) at this time. Store the project file inside the KDS project created earlier:

Saving IAR Project File

Saving IAR Project File

Project Connections

In order to connect to the ProjectInfo.xml, make sure ‘Enable project connections’ is enabled in IAR. The setting is behind the menu Tools > Options:

Enable Project Connections

Enable Project Connections

Use the menu Project > Add Project Connection:

Adding Project Connection

Adding Project Connection

Select Processor Expert for the connection:

Freescale Processor Expert Connection

Freescale Processor Expert Connection

Press OK, then select the ProjectInfo.xml:

Selecting ProjectInfo.xml

Selecting ProjectInfo.xml

With this, I have connected the project to IAR:

Connected Project in IAR

Connected Project in IAR

Now I can compile the project in IAR, and it should not report any errors:

Compiled Project in IAR

Compiled Project in IAR

❗ I had a case where IAR complained about a missing startup.c file. This was an entry in the generated ProjectInfo.xml file, while this file did not exist on disk (was not generated). It looks there was a glitch in writing that file. The solution was a) to close the project in Eclipse, b) re-open the project and c) re-generate code. This has fixed the entry in the ProjectInfo.xml file, and everything worked fine :-).

Summary

I can now compile/link/debug in IAR. I can switch to Eclipse and do my advanced editing, add new components or configure the project, and the IAR IDE project will be in sync. So now I can use Kinetis Design Studio instead of the Driver Suite 10.4 with IAR. And if you are using Keil (see Using Keil μVision 5 with Processor Expert): I expect that it should work the same way too 🙂

Happy IARing 🙂

Links

Advertisements

9 thoughts on “Using Kinetis Design Studio with IAR Embedded Workbench IDE

  1. Thank you for this valuable information.
    I have added a big chunk of C:\Freescale\KSDK_1.1.0\usb to my KDS project (for USB CDC).
    After making the project connection in IAR Embedded Workbench, I found that I needed to add “Additional include directories” in “Project | Options | C/C++ Compiler | Preprocessor”. Not a big deal. The include directories that I needed to add were not in ProjectInfo.xml.
    Does KDS offer any control over what gets saved in ProjectInfo.xml, or when ProjectInfo.xml gets updated?

    Like

    • No, to my knowledge there is no control over what gets into ProjectInfo.xml. And the tool adds the files and inlcudes to the xml it is aware of (or what it is generating). I believe you have added the USB files ‘outside’ of that process, so the tool has no information about these include paths present. So I think there is no clean solution for this.

      Like

  2. So, why two IDEs side by side?
    I have used IAR for MSP430 and AVR with total satisfaction — solid and reliable compiling and debugging.
    Now I am using Keil uVision for Kinetis with similar satisfaction.
    But KDS seems to promise to become the “MPLAB of Freescale” — obviating and displacing some portion of fee-licensed IDEs. So what is missing in KDS?

    Like

    • Hi Pete,
      it really depends on the user. I hear a lot of complains about the look and feel of IAR. On the other side there are others who like it that way. I would say that in my view the benefit of IAR is the better-optimizing compiler. But not a problem for me as for most of my application I can deal with the about +5-10% more code size of gcc. And gcc reduces that gap as time goes on as it seems.
      So there is really nothing missing in KDS (or IAR): it is just that some users prefer the one or the other way. But there is no Processor Expert intergrated in IAR (or Keil), as they both are not Eclipse based.

      Like

      • Hello Eric,

        I believe he’s speaking about IAR’s new experimental eclipse plugins:
        http://eclipse-update.iar.com/

        However, IAR’s eclipse plugins are not terribly great. They continue to complain about standard types (uin8_t for example) as being undefined. Obviously KDS has great advantages in other areas (namely price).

        Is KDS is using a proprietary project format based on eclipse CDT?

        Like

        • I have not downloaded these latest plugins, so I need to give it a try if I find some spare cycles, thanks for the hint.
          As for if KDS is using a proprietary project format: the answer is ‘no’, it is using the GNU ARM Eclipse (http://gnuarmeclipse.livius.net/) plugins which are a de-facto standard in my view for Eclipse + ARM devices.

          Like

  3. Great information, I’ve been using IAR for many years for a variety of projects, most recently using older Kinetis processors with an older MQX implementation. Went to use the K65 and found it was not supported with my current tools, had to update IAR, download KDS and KSDK to get that support. Everything is just so completely different from the way it used to be organized, and the documentation is less than stellar. Found this post, and had my project configured and up and running within minutes.

    Like

    • Hi Richard,
      yes, I know that the documentation is not that great. Another reason why I document my findings and how-to’s in this blog 🙂
      Glad to hear that things I document are useful for you 🙂
      Erich

      Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

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