Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Using Kinetis Design Studio With IAR Embedded Workbench IDE

DZone's Guide to

Using Kinetis Design Studio With IAR Embedded Workbench IDE

· Java Zone
Free Resource

Microservices! They are everywhere, or at least, the term is. When should you use a microservice architecture? What factors should be considered when making that decision? Do the benefits outweigh the costs? Why is everyone so excited about them, anyway?  Brought to you in partnership with IBM.

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

 

Discover how the Watson team is further developing SDKs in Java, Node.js, Python, iOS, and Android to access these services and make programming easy. Brought to you in partnership with IBM.

Topics:

Published at DZone with permission of Erich Styger, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}