Tutorial: Replacing IAR EW with Eclipse IDE

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

Using IAR Tools In Eclipse

Using IAR Compiler and Debugger 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.

Compiler

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

IAR Eclipse Tools

IAR Eclipse Tools

That page has a link to http://eclipse-update.iar.com/ from where I can download the Eclipse plugins.

IAR Embedded Workbench for Eclipse

IAR Embedded Workbench for Eclipse

💡 The site lists 6.50/6.60.x as EW versions. It worked without issues with my EW 6.7 version.

Installation

I need

  1. Eclipse installed (I’m using Eclipse Kepler in this post)
  2. IAR Embedded workbench installed (I’m using IAR v6.7 in this post)
  3. 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:

IAR Eclipse Update Site

IAR Eclipse Update 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):

Installing IAR Plugins in Eclipse

Installing IAR Plugins in Eclipse

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

Path to IAR Embedded Workbench

Path to IAR Embedded Workbench

Importing Existing IAR Projects

With the menu File > Import I can import existing IAR projects:

Importing existing IAR Project

Importing existing IAR Project

All what I need is to specify the *.ewp (Embedded Workbench Project) file:

Embedded Workbench Project to Import into Eclipse

Embedded Workbench Project to Import into Eclipse

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:

Project Importer Reminder

Project Importer Reminder

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:

Update Imported IAR Project

Update Imported IAR Project

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:

New C Project for IAR

New C Project for IAR

Next, I can select the IAR project to be created:

Creating IAR Project

Creating IAR Project

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:

IAR Device Selection

IAR Device Selection

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

  1. C-SPY (Debugger) build related settings (semi hosting library settings)
  2. Compiler/Assembler/Linker panels:
IAR Build Tools Integration

IAR Build Tools Integration

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:

IAR Error Parser

IAR Error Parser

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.

Debugging

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:

Creating new C C++ Debug Configuration

Creating new C C++ Debug Configuration

The new created launch configuration is using GDB by default. So I need to change it using the ‘Select other’ link:

New Launch Configuration Created

New Launch Configuration Created

Here I choose to use configuration specific settings (not workspace wide settings) and select the IAR C-SPY debugger:

Using IAR C-SPY Debugger

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

Selecting J-Link as debug connection

Selecting J-Link as debug 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):

J-Link with SWD

J-Link with SWD

With this, I can debug my IAR application with C-SPY inside Eclipse :-):

Debugging FRDM-KL25Z with C-SPY and Eclipse

Debugging FRDM-KL25Z with C-SPY and Eclipse

Additionally C-SPY is offering many more views:

C-SPY Debug Views

C-SPY Debug Views

There are other options and views for trace, but not having a Segger Trace probe I was not able to try them out.

Summary

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? :mrgreen:

Happy EclipsIARing 🙂

79 thoughts on “Tutorial: Replacing IAR EW with Eclipse IDE

  1. Sounds interesting, especially as IAR and Keil/ARM have a compiler which is (currently) better than GCC. I assume it is also possible to use the Segger J-Link probes and have an Eclipse
    project that can use IAR’s compiler or GCC? This way, with multiple developers, having just one IAR license would be sufficient. With todays fast Micros, probably IAR or Keil is not really needed any more at all. My experience is that optimising the code gives me more than those 10%. Worst case, a low level routine is converted to assembly language.
    Seem like the proprietary IDEs are not here to stay, and LLVM is doing the rest.

    Like

    • That 10% (acutally sometimes it is even below 10%) is comparing optimized output (means: Optimizations turned on). Non-GCC compilers tend to use optimizations in the default settings, while gcc generates very big code with no optimizations set.
      You could set up the same project to be compiled with gcc and IAR (e.g. I do this for FreeRTOS), but it requires that the code is written in a way so it is understood by multiple compilers (especially assembly code).

      Like

  2. What are the advantages of Eclipse over free Visual Studio Style IDEs such as
    emIDE (www.emide.org) ?

    Maybe I am old style, but I still prever VS over Eclipse…

    Like

    • I have used emIDE, but not much. It is for sure an alternative to Eclipse, but in my view not as powerful and versatile than Eclipse. I see that smaller vendor companies are adopting it, as it easier to understand (as a developer to make a product out of it) than Eclipse: Eclipse is a frame work, so you can do ‘pretty much everything’ with it, while the focus on emIDE (in my view) is just the IDE. And at least currently there is not as much momentum behind emIDE compared to Eclipse. The other advantage of emIDE is that it is more like MS VisualStudio. I have used VS as well a lot, but at the end Eclipse was better for me. The good thing with Eclipse (and emIDE) is that they are open and free, so we all have choices. And choices are good 🙂

      Like

  3. Pingback: 2014: A Look into the Magic Crystal Ball | MCU on Eclipse

  4. The “Update Imported Project” command does more than just build your project. It will also update the project to reflect any changes made “on the outside”. For example, if you import a project into Eclipse and then modify the project in the EW, you can update the Eclipse project with those changes. This was initially a feature only intended for debugging the project importer, but it turned out to be very useful as a public feature as well.

    Like

  5. Pingback: Processor Expert Driver Suite V10.3 Available | MCU on Eclipse

  6. I got also stuck at the same point: the debug… I have quite a similar tool set (eclipse kepler, IAR 6.70, EWARM 7.10 and J-Link). I could setup the Run and Debug configurations, but I think I’m missing the ‘Executable Client Setup’ (project > right click > Debug As.. > Debug Configurations, then Debugger tab). Default value (gdb) and suggested ( ${cross_prefix}gdb${cross_suffix} ) don’t work and pop up the error “Error while launching command: gdb –version”. I thought I could use the gnu debugger but I could not figure out how to set it up.
    Everything else in this tutorial makes it a good reference, but this think about download/ debugging is missing some details. If anybody could come with the solution it would be great.

    Like

        • For anyone looking at this in the future, I had this problem when importing my own project, but not when I made an example project via the MCU Eclipse sample project interface.

          The sample project has:
          ${cross_prefix}gdb${cross_suffix}

          which evaluates to:
          arm-none-eabi-gdb

          My imported project has the same variables, but evaluated to:
          gdb

          I found the executable here:
          C:\Users\\AppData\Roaming\xPacks\@gnu-mcu-eclipse\arm-none-eabi-gcc\7.3.1-1.1.1\.content\bin\arm-none-eabi-gdb.exe

          So just put that path in instead of the variables. That works, but I doubt it is the right way to do it. It also might involve following the steps to download xPacks as seen on the MCU eclipse website.

          Like

        • Thank you very much. I did not think that it would be necessary to provide the full path. And this will be definitely helpful for anyone else who runs into this issue.

          Like

  7. Well, I finally managed to be able to connect to the target by installing Yagarto and using its gdb debugger application. I wanted to keep eclipse free of external toolchains to maintain compatibility with other users here using IAR and not GNU tools.

    Like

  8. I am using ubuntu LTS 14.04. I want to use eclipse with installing IAR plugin. But its not working as I thought. Do you have an solution? Thank you.

    Like

    • Ubuntu LTS 14.04 is very new, so it could be that something is not working any more. I do not have that version installed yet (and probably will wait until the dust settles down), but I think you better ask IAR that question as they maintain that plugin.

      Like

      • Hello, do u have any experience in any debian OS? I would really like to learn then. If you know many then other ubuntu versions can be also good for me to learn. Thanks for your reply. I already sent them a mail.

        Like

  9. I have this setup for ARM Cortex M3. Can you offer tips on how to configure data breakpoints? For example I want to have the processor break when a certain value is written to a variable.
    Thanks

    Like

  10. Thanks for this helpful tutorial. I imported successfull my IAR project can build this and debug it.
    But something goes wrong with the includes. They are set in the IAR Compiler for ARM -> Preprocessor and are listed working under includes but in the project the information out of the header-files are not know… have you an idea to solve this problem?

    Like

  11. Hi,
    I use Eclipse Juno under Mac OS X and I succesfully installed the IAR package for ARM 7.20.x. When I try to start a project I never get through the part where I should fill out the ‘Path to the Embedded Workbench IDE installation directory’ .
    Anything I write here is not accepted as ‘No arm/bin path found’.

    Like

  12. Hi Erich,

    I wonder if you have chance to try KDS with IAR plugin. I use KDS 1.1.1 (Kepler 4.3.1) eclipse based IDE and installed IAR 7.10 plug-in within. I am able to compile and build the project with IAR compiler under KDS but I have trouble to use IAR C-SPY debugger and it seems to me some integration problem (no able to go step-by-step through code, stop at breakpoints, other weird behavior etc… ). I am able to setup J-Link SEGGER debugging and it works fine.

    Do you think there is a need to add some additional components to KDS for correct IAR C-SPY behavior.

    Thank you for your response.

    Best regards,
    Peter

    Like

    • Hi Peter,
      I do not have C-SPY, so cannot help much here. I assume you have checked this already with IAR? To my understanding, you would need special drivers for C-SPY. And as Segger is working, why do you need C-SPY (sorry, if this is a dumb question)?

      Like

      • I followed your steps within KDS and C-SPY does not work for me and then I used SEGGER. Actually I do not need C-SPY.

        Like

  13. I have a question about linker options. Under tool settings/IAR Linker for Arm. “All options:” shows some options such as “__vector_table+0x1c:4,sum32:2;__vector_table-__vector_table+0x1B” that I can’t find how to change or delete. Where do these come from?

    Thanks!

    Like

  14. Erich,

    I did not previously have IAR Embedded Workbench, but I got a development board that uses IAR EW for all their demo code and SDK. So I got the 30-day eval license from IAR (the codesize-limited (non-time-limited) version is not adequate for the content that comes with the development board).

    I’m using KDS 2.0.0 for my main project, which uses a Freescale Kinetis K64 processor.

    So I need to migrate the SDK code in IAR over to KDS within the next 30 days to avoid having to buy an IAR license (several thousand dollars). There are multiple projects and hundreds of source code files in their provided IAR materials. The development board uses the K22 processor rather than K64.

    Are there any other articles you would recommend or things to look out for / helpful hints you have for me as I begin this task?

    Doug

    Like

    • Hi Doug,
      not sure about which SDK you are talking about. But the Kinetis SDK comes with support for IAR, Keil and GNU (KDS).
      Source files for IAR can be ported over with ease (just check pragmas/warnings carefully). More work is for assembly sources, as IAR is using a different syntax. But typically these can be ported over to GNU easily too.

      Like

    • There are several ways in Eclipse to add existing source files to the project: you can simply copy them in for example in the Windows Explorer and copy-paste them (Eclipse will ask you if you want to link to the file or copy it). Or do the same with the folder. Or place the source file into an already existing project folder. There are probably many other ways too.

      Like

  15. Great article and very helpful. I used Eclipse in the past for some time and when I came across IAR Embedded Workbench I wanted to cut my veins! No highlight of selected variables, not a proper searching tool….
    I have tried to import my IAR project for MSP430 and it seems that all the project settings were kept properly, however the assembler fails. Did you have by any chance the need to change any setting from the project when you imported it?

    Like

    • I have not used that IAR plugin for a while, as I only had a few projects by then. We have more or less completely switched to Eclipse and GNU tools by now (with a few exceptions). As for your question: most projects with IAR in Eclipse we have created from scratch, and I don’t remember we had to do anythign special with importing existing projects. So it might depend on what kind of error your assembler is reporting, not sure.

      Like

  16. Hi,
    I used this guide to work with eclipse, all thinks work great, except one issue, in IAR i can download and debug/run code, in eclipse i don’t know how to download.
    Any chance that you figured it out?

    Regards,
    Hani N

    Like

      • Thank you Erich Styger for answering and great roturial.
        I figured it out it out, when click one debug, before start debugging the eclipse(more accurate the IAR) downloading the code file(Hex or Bin) to the board and start debugging.

        Like

  17. Hey man, your site comes up every time I have a problem. You have a lot of good stuff up here!

    After lots of fighting with Eclipse I got it down to one last problem…

    Description Resource Path Location Type
    Error[Ta070]: Invalid core (ARM7TDMI) for this license Test Unknown C/C++ Problem

    I have a full license and according to IAR it sees my valid license and knows the dongle is plugged in. Any ideas?

    Like

    • I have only used the free/limited IAR tools that way.
      Could it be that the CPU/microcontroller you have selected is not included in your license?
      Otherwise, I suggest you have to contact the IAR support on this.

      Like

  18. How to import to Eclipse an existing IAR project from a –source folder– in workspace while keeping the project in that source folder?

    Importing an existing IAR project from a source folder in workspace to Eclipse creates the project under workspace (rather than under the source folder it was imported from)
    I would like Eclipse to maintain the structure of the workspace, so imported IAR projects will remain as in in their source location.

    Example:
    In Windows I have several IAR projects under branches folder:
    – /workspace/IAR_projects/branches/ver_1/project_1.ewp
    – /workspace/IAR_projects/branches/ver_2/project_2.ewp

    Importing these IAR projects to Eclipse creates a –new– folder for each project directly under workspace folder:
    – /workspace/ver_1/project_1.ewp
    – /workspace/ver_2/project_2.ewp

    BUT,I would like Eclipse to maintain the Windows structure, i.e.: remain the project in its same location where it was imported from.

    How canI do it?

    Thanks in advance.

    Like

  19. There is no option for debugging an IAR project in eclipse for MSP430, if any one knows how to configure IAR debugger in eclipse.
    please let me know

    Like

  20. Sorry for asking this here, but I haven’t been able to find information about this and it’s somehow related. Do you know how to replace keil uvision with eclipse? Because uvision sucks big time. Especially code navigation, that is the most painful experience one can have.

    Thanks!

    Like

  21. Hi,

    Great post.
    Because cmake does not support IAR EB generator.
    I want to know is it possible to have a makefile created by cmake and import it to IAR EW to establish their solution ewp.

    Thanks

    Like

    • I have not upgraded to a new IAR version (I stayed at an older version because the newer ones did not work for me for many reasons). So I might have lost track what is new, and I’m not sure what is that IAR EB generator?
      To my knowledge (I might be wrong): IAR does not support make files.

      Like

  22. Hello,
    thanks for the post. I have got a question: is this means that i can use Eclipse to compile project IAR that have a size more than 32k ??
    Cordially.

    Like

  23. Hello,
    Very grateful for your post. I have two issues which I’m facing in Eclipse 4.7.3:

    1) When I give the path to IAR Embedded Workbench installation folder under preference
    window, I see two choices for Installed IAR Toolchains (8.x and 7.x for legacy). Eclipse is not
    accepting the 8.x IAR toolchain for ARM and for 7.x a message pops up showing “not
    compatible with the compiler version 8.30.1.114”.

    2) I’m unable to import any existing IAR project into Eclipse. No error is coming but the operation
    seems to take too much time and just stay like that.

    Like

    • 1) I only have used this with the IAR 6.7 and not with later versions, so I cannot really comment on that. It worked well for me with that version. I don’t have any newer version.
      2) Same for the import function: I only used it with 6.7, and there it works pretty well.
      So you might go back to version 6.7 to give it a try. Other than that, I think you might have to contact IAR and ask for support.

      Like

  24. Hello,
    How to update an IAR project based on an eclipse project?
    I’m asking, because I added a preprocessor symbol in eclipse and it isn’t visible in IAR project.

    Like

What do you think?

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