Are you using IAR tools and you are jealous looking at what others can accomplish with Eclipse? You wish you could use your IAR build tools but taking advantage of Eclipse too?
I do not want to start a religious IDE war here ;-). At least for IAR, there is a way to bring both worlds together: having IAR build and debug tools integrated in Eclipse :
Eclipse or not?
If you are a frequent reader of this blog, then you know: I’m one of the many Eclipse lovers of this world :-). Sure, there are alternatives to Eclipse, and Eclipse does not fit everyone needs. But I believe that the future of IDE’s is Eclipse, at least until there is an even better alternative :-). Especially in the ARM world, many tool chain vendors are providing Eclipse based IDE’s, just see my recent post on ThunderBench. Yes, there are still vendors out there which have not jumped on the Eclipse bandwagon. Two of the big players in the ARM world of non-Eclipse providers are Keil and IAR: they are using their own proprietary IDE technology. Not sure how long they will be able to keep up that, given the fast pace the Eclipse technology is progressing.
Tool Chain, Chain, Chain, …
I’m using Eclipse tool chains for most of my projects. For Freescale microcontroller this is mostly Eclipse Kepler or CodeWarrior (an Eclipse based IDE provided by Freescale). For non-Freescale ARM devices I have started using the Eclipse based ThunderBench from Emprog. For other ARM devices I use the free versions of IAR (Embedded Workbench) and Keil (µVision). As you see: many (too many?) tool chains. While I see the benefit of non-Eclipse IDE’s (fewer options, ‘simpler’), they are limiting my options, or I need the ‘learn’ different user interfaces.
Eclipse Processor Expert with non-Eclipse IDE’s
For the Freescale devices I’m using Processor Expert a lot. The good thing is that this works with Keil and IAR (see “IAR ARM v6.7 comes with improved Processor Expert Support” and “Keil“), but requires yet again another IDE (the Processor Expert Driver Suite). So this requires to run and switch between two different IDE’s: workable, but not ideal. So in this configuration Eclipse is the ‘Front-End’, while IAR or Keil is the ‘back end’ to compile and download the sources.
What is really good with Keil and IAR are their compilers. That’s where they truly differentiate: to have very good compilers, producing fast and dense code. That’s where they focus on. GNU gcc is not the best compiler in the world. At least with my projects, I see that IAR is able to produce about 10% better code compared to ARM GNU. And 10% means a lot of I need to squeeze my application into a tiny microcontroller.
💡 The ‘next generation’ Open Source LLVM/clang might change that, but that’s a topic for a future article. In my research project, LLVM/clang was producing outstanding optimization results. That compiler might not be ready yet for a broad market yet, but both Apple and Google are heavily investing into it. In my view, not to far away, the LLVM/clang will re-schape the compiler industry.
What counts otherwise is the overall engineering productivity. And here in my view all the Eclipse features and plugins help to be more productive. All the outstanding editor features with the external tools (e.g. version control) integration. And of course the huge community and help behind it.
The question is: how to combine the IAR compiler with the Eclipse IDE?
IAR Eclipse Plugin Website
Looks like that IAR has received the same question and request from their customers? Not easy to find, but I have found http://www.iar.com/eclipse/ :-).
That page has a link to http://eclipse-update.iar.com/ from where I can download the Eclipse plugins.
💡 The site lists 6.50/6.60.x as EW versions. It worked without issues with my EW 6.7 version.
- Eclipse installed (I’m using Eclipse Kepler in this post)
- IAR Embedded workbench installed (I’m using IAR v6.7 in this post)
- The IAR Eclipse plugins from http://eclipse-update.iar.com/
💡 For most architectures IAR only supports Eclipse build tool integration. For ARM there is build AND debug support 🙂
The identify the update site to be used: click on the link on the IAR web site:
The normal Eclipse updater mechanism is used (menu Help > Install New Software) with providing the link to the update site (in my case to ARM 6.50):
❗ Installation of the IAR plugins does not work out of the box for CodeWarrior for MCU: it complains about missing bundle “org.apache.commons.cli 1.2.0”. I need to check later how this can be fixed. It works out of the box with Eclipse Kepler.
After restart of Eclipse, it asks me to provide the path to the IAR Embedded Workbench (Installation folder!):
Importing Existing IAR Projects
With the menu File > Import I can import existing IAR projects:
All what I need is to specify the *.ewp (Embedded Workbench Project) file:
By default, the importer creates links to the project files. That way the original files keep in their place.
I imported several projects. The importer reminded me that it was not able to convert all options and that I have to check them:
Unfortunately there was no hint *which* options were not converted. But my projects compiled just fine.
I noticed that there is an extra menu on imported IAR projects:
What it does for me is to build all the configurations of the project. But this is something Eclipse does too, so not sure why there is an extra context menu for this?
Creating Project for IAR
The other way is to create new projects directly in Eclipse. For this I use the menu File > New > Project and select a C or C++ project:
Next, I can select the IAR project to be created:
Going to the next dialog it proposes me Release/Debug build targets. The more important thing is in the next one where I have to select the device:
💡 I can change the device any time later using the menu Project > Select Device.
Pressing Finish, and my project gets created.
IAR Build Tools Integration
IAR is using the same ‘managed make’ as used by many other Eclipse build tools. It integrates with two things:
- C-SPY (Debugger) build related settings (semi hosting library settings)
- Compiler/Assembler/Linker panels:
The options are similar (or the same) as in the IAR Embedded Workbench. The Eclipse panels are easier to use in my view compared to the ones in the IAR EW (maybe because I’m much more familiar with the Eclipse way).
Because the IAR build tools do not confirm to the GNU gcc compiler message format, a special IAR Error parser is part of the plugins:
The error parser makes sure that the output in the Console view is parsed correctly so I can jump to the correct error place using the Problems view. This worked for me without problems.
Building was working very smooth. But when I wanted to debug my application on the board, I was stuck for a while. No debug configuration has been up? Finally, I have found how to debug it 🙂
For this, I open the Debug Configurations. There I select C/C++ Application and use the ‘new’ Icon:
The new created launch configuration is using GDB by default. So I need to change it using the ‘Select other’ link:
Here I choose to use configuration specific settings (not workspace wide settings) and select the IAR C-SPY debugger:
Pressing OK, this will give me IAR C-SPY debugger setting panels. In the ‘Setup’ Tab I can select if I want to use the simulator or the J-Link connection:
💡 I have not seen a way how to use any other debug probe (e.g. P&E Multilink). So I’m using here the J-Link, and for the FRDM-KL25Z I’m using the Segger OpenSDA firmware.
The debug connection choice will show more setting panels. For Freescale Kinetis-L I need to make sure I’m using SWD (and not JTAG):
With this, I can debug my IAR application with C-SPY inside Eclipse :-):
Additionally C-SPY is offering many more views:
There are other options and views for trace, but not having a Segger Trace probe I was not able to try them out.
The IAR Eclipse plugins are somewhat hidden on the IAR website. But they are a great alternative for everyone who wants to combine the power of the Eclipse IDE with the IAR compiler and build tools. The plugins are easy to use and integrated very well into Eclipse. It is even possible to use the IAR C-SPY debugger inside Eclipse, but requires additional manual configuration steps.
The IAR debugger even offers a simulator mode which can be useful if no hardware is present, and to try some source code which does not need any hardware. The IAR C-Spy debugger comes nicely integrated in Eclipse, but is limited to Segger and the IAR-owned I-Jet probes. Luckily with GDB and Eclipse there are other debuggers and probes possible.
To me, the IAR Eclipse integration brings the best of the compiler and IDE world together. I’m only wondering how long it will take until IAR will be fully on Eclipse?
Happy EclipsIARing 🙂