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.
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/ :-).
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.
Installation
I need
- 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.
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:
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.
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?
Happy EclipsIARing 🙂
I am no IAR user, but always interested to see how vanilla Eclipse can be used with any tools and plugins for hardware dev so, duly noted 🙂
LikeLike
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.
LikeLike
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).
LikeLike
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…
LikeLike
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 🙂
LikeLike
apart from autocomplete, I dont see much difference, especially with the new GNU ARM tools eclipse plugin
LikeLike
Pingback: 2014: A Look into the Magic Crystal Ball | MCU on Eclipse
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.
LikeLike
Hi Jesper,
thanks for that information. To my understanding that ‘update project’ has to be manually. Is there a way to do this automatically?
LikeLike
Pingback: Processor Expert Driver Suite V10.3 Available | MCU on Eclipse
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.
LikeLike
Hi Joan,
it looks like it cannot find your GDB debugger. You might try to directly point to the gdb executable, or make sure the gdb is in your PATH.
LikeLike
If I just knew where it is or how to find it or how to install it…
LikeLike
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.
LikeLike
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.
LikeLike
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.
LikeLike
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.
LikeLike
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.
LikeLike
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.
LikeLike
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
LikeLike
Hi Jim,
I just posted an article how to use watchpoints in Eclipse Kepler: https://mcuoneclipse.com/2014/05/17/cc-watchpoints-with-eclipse-kepler/
LikeLike
Can you offer any help with setting data breakpoints? I have IAR for ARM with Eclipse.
LikeLike
Are you using J-Link?
If so, you can use the J-Link control panel to set data breakpoints
LikeLike
Yes, using J-Link. I will look at that, thanks for the tip!
LikeLike
The same thing like this should work as well with IAR debugger: https://mcuoneclipse.com/2014/05/17/cc-watchpoints-with-eclipse-kepler/
LikeLike
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?
LikeLike
Hi Bastian,
not sure what the problem is you describe? Is it that it just works fine compiling the files (the compiler finds the headers, as they are properly listed in the IAR Preprocessor settings), but the Eclipse Editor view (source file window) does not find them (e.g. with F3)? If so, then this could be that Eclipse Indexer thing, see https://mcuoneclipse.com/2012/03/20/fixing-the-eclipse-index/
I hope this helps,
Erich
LikeLike
Talk about Mr Murphy rules. A project I am working on requires IAR 6.6. Unfortunately the Eclipse plugins are either for 6.5 or 7.2! Am I doomed?
LikeLike
Not sure if you are doomed. Is your requirement for the 6.6 compiler? If yes, I believe you should be able to use it (swap/exchange the compiler) with the 7.2 plugins.
LikeLike
It sounds hopeful but I am an absolute newbie at this. Do you have a post on how swap/exchange the compiler with the 7.2 plugins?
LikeLike
No, unfortunately I do not have such a post available.
LikeLike
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’.
LikeLike
Unfortunately, I do not have a Mac/OS X, so cannot help here. But I believe that either this is not supposed to work somehow on a Mac, or another problem?
LikeLike
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
LikeLike
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)?
LikeLike
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.
LikeLike
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!
LikeLike
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
LikeLike
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.
LikeLike
Thanks for the article. This is very helpful =)
LikeLike
Sooo helpful, thank you. 🙂
LikeLike
How to add existing .c file to project?
LikeLike
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.
LikeLike
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?
LikeLike
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.
LikeLike
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
LikeLike
Hi Nani,
I have not used it much after that article, and not for the last 6 months. But I had it working nicely with the Segger J-Link debugger as shown in this article.
Erich
LikeLike
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.
LikeLike
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?
LikeLike
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.
LikeLike
I have built parts of OpenSSL with CLang and did not find a space difference compared to gcc.
LikeLike
Hi Gunter,
that’s my experience too: clang is getting better, but still is about 10% behind in code size compared to gcc.
LikeLike
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.
LikeLike
I think you should not check the ‘copy files into the workspace’ box.
LikeLike
Hi, how do I convert an iar workspace file to be suitable for mcuxpresso ide?
LikeLike
More info:
I am currently working on the i.mx rt1050 evk with LCD right now.
NXP provided SDK file to run to display image works only for iar.
Want a file to run to do the above via MCUxpresso IDE.
LikeLike
I have received my display too, but did not had any spare cycles/time to check it out. If time permits, I’ll have a look this weekend.
LikeLike
The only way I see is to create a new workspace in Eclipse, create a new project in Eclipse and then port over the files needed from the IAR environment.
LikeLike
I tried so but end so but ended up with a debugging error.
Copied all the required files: utilities, header, c files etc. Is the protocols different for iar and mcuxpresso ide?
LikeLike
Hello,
not sure what you mean with ‘protocols’? But yes, IAR is very different from the standard GNU compiler. It is a different compiler, and the assembly language is non-standard too.
Are you able to sucessfully compile the new application?
LikeLike
could you advise me more specifically? first time doing such file conversion. thank you.
LikeLike
Not sure what you need. If this is your first project you are porting, there might be many details.
LikeLike
oh gosh thanks anyways:)
LikeLike
what about exporting the project from iar then import to mcuxpresso ide?
LikeLike
Not sure, I have never used that (did not know that IAR could export projects to Eclipse?).
LikeLike
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
LikeLike
For MSP430 you probably best go with the TI IDE which is Eclipse based too.
LikeLike
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!
LikeLike
what about this: https://openwsn.atlassian.net/wiki/spaces/OW/pages/11534370/msp430gcc+on+Eclipse+with+mspdebug+Preferred
LikeLike
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
LikeLike
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.
LikeLike
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.
LikeLike
I mean IAR free version
LikeLike
No, you are going to use the IAR compiler with all its limitation. So you still will have a code size limited compiler.
LikeLike
thank you Erich Styger,
LikeLike
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.
LikeLike
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.
LikeLike
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.
LikeLike
I believe this not possible, as IAR projects are not compatible.
LikeLike