IAR compiler -> no hex file???

Everything ARM and LPC

Moderator: phalanx

Ferry
Posts: 3
Joined: Sat Nov 26, 2005 7:40 am
Location: Weesp

IAR compiler -> no hex file???

Post by Ferry » Sat Nov 26, 2005 7:52 pm

Does anybody know if the IAR compiler kan produce an hex file, which can be used with the lpc2000 flash utitlity? I compiled a source code but i got a lot of output files, but i didn't saw a hex file.
Ferry

jayjay
Posts: 110
Joined: Fri Jul 01, 2005 2:40 am

Post by jayjay » Mon Nov 28, 2005 10:14 am

I have not used the IAR for the ARM but for several other families, if you right click on the Opyions in the project properties, you should be able to select the desired output file format.

HTH
Jay

skakz
Posts: 6
Joined: Thu Dec 15, 2005 5:08 am

Post by skakz » Thu Dec 15, 2005 5:10 am

the IAR doesn't produce a hex file it needs an plugin called cspy

jayjay
Posts: 110
Joined: Fri Jul 01, 2005 2:40 am

Post by jayjay » Thu Dec 15, 2005 5:24 am

the IAR doesn't produce a hex file it needs an plugin called cspy
The C-Spy is a properitery debug monitor supplies with the IAR toolchain, it has nothing to do with hex file generation.

Jay

Ferry
Posts: 3
Joined: Sat Nov 26, 2005 7:40 am
Location: Weesp

Post by Ferry » Thu Dec 15, 2005 10:59 am

By changing the option, the IAR compiler produced an usable hex file.
Ferry

tpicker1
Posts: 5
Joined: Tue Sep 13, 2005 8:26 am

IAR and Phillips LPC2000 Flash Utility

Post by tpicker1 » Fri Dec 23, 2005 12:20 am

Just though I would make a comment for those like myself spending countless hours trying to play with the Olimex boards using IAR and the LPC2000 Flash utility.

I use IAR on MSP430's regularly but new to LPC2000's. I ordered a LPC-P2138, CFAX, CFAX board, and JTAG cable the other day, but the JTAG was backordered.

I received everything but that and tried for 2 days to play with the P2138 and LPC2000 Flash Utility as a workaround until I get the JTAG cable and found all kind of posts everywhere from "it's possible" to "it's not" and without anything saying how if possible. I even went though the Tutorial on the SparkFun's website for using Eclipse and decided that route was just to complex and "way not" worth the trouble. I decided just to wait on the cable and use IAR (one IDE without 20 other add-ons and processes to do a 5 minute job). While waiting I found it is very possible and very simple to use IAR and the utility and NOT use the JTAG at all.

The controversy all stemmed around IAR being able to create a HEX file at all to it's ability to create a valid HEX file in order for the Flash Utility to use.

It's very possible and simple for those needing to do it like myself for one reason or another. Just go into "Options..." for the project by right clicking on the project name, go to "Linker", look for the "Format" section and click "Other", which un-clicks "Debug information for C-Spy", and select "intel-extended" for "Output format". Leave "Format variant" as "none". Save the settings and re-compile. Now the output file is the same name and extension as before but now in hex.

The Flash Utility can now use this file to flash the LPC21xx. The utility will lead you to believe it needs to be ".HEX" but you can leave it as ".a79" or whatever and it works.

Not sure it will work for everyone but it works flawlessly for me and the utility has no problems with it's name nor format as indicated in so many forums. There's no need to use SUN Java Runtime, Eclipse IDE, Eclipse CDT Plug-in for C++/C Development, CYGWIN GNU C++/C Compiler and Toolset for Windows, GNUARM GNU C++/C Compiler for ARM Targets, GNUARM Insight Debugger, Philips Flash Programmer for LPC2100 Family CPUs, and Macraigor OCDremote for JTAG debugging all together for such a simple task.

As I said, I'm using IAR and the utility alone for the LPC-P2138 as well as IAR generated example code for the P2138 and don't now about all of the other boards. Just make sure you use sample code for IAR and not the other IDEs/Compilers when trying this route. Making things too complicated and tedious takes the enjoyment out of messing with it at all.

...Tim

sparktags
Posts: 1
Joined: Wed Jan 28, 2009 1:38 am

Re: IAR and Phillips LPC2000 Flash Utility

Post by sparktags » Wed Jan 28, 2009 1:44 am

tpicker1 wrote: Just go into "Options..." for the project by right clicking on the project name, go to "Linker", look for the "Format" section and click "Other", which un-clicks "Debug information for C-Spy", and select "intel-extended" for "Output format". Leave "Format variant" as "none". Save the settings and re-compile. Now the output file is the same name and extension as before but now in hex.
...Tim
I tried this, but threr is no "Format" section available there. Although there is a seperate section called "Output Converter" in the options window, which allows me to create hex files along with the default output. They also have the extension ".hex" it doesnt work when flashed thru the flash utility.

Could you please clarify in a little more detail.?

lqbweb
Posts: 3
Joined: Sun Apr 11, 2010 10:44 am

Re: IAR compiler -> no hex file???

Post by lqbweb » Sat Oct 30, 2010 6:45 am

you have also to click on "Override default" and replace the extension by ".hex" (on the same tab)

stevech
Support Volunteer
Posts: 2907
Joined: Sat Jun 05, 2004 8:51 pm
Location: USA, California

Re: IAR compiler -> no hex file???

Post by stevech » Sat Oct 30, 2010 10:32 am

I use IAR for ARM7 - it does produce .HEX files. I use them with Flash Magic.
The option to produce a .hex is a project configuration option in IAR's IDE.

mjbcswitzerland
Posts: 85
Joined: Tue Jan 08, 2008 8:49 am
Location: Switzerland
Contact:

Re: IAR compiler -> no hex file???

Post by mjbcswitzerland » Sat Nov 13, 2010 11:03 am

Hi

The linker setting in IAR has an option to set the output format (usually 2 different outputs can be generated)

There may have been an intermediate version after they moved to IAR5.0 where the option was missing (although I may be confusing with Keil uVision3 (?)). In this case there was a different utility that could be used (this will be in the documentation explaining its use - search for HEX format or similar).

In emergency the GCC objcopy utility can be used: http://www.utasker.com/forum/index.php?topic=379.0

Regards

Mark

mikeselectricstuff
Posts: 72
Joined: Sat Sep 06, 2008 12:34 pm

Re: IAR compiler -> no hex file???

Post by mikeselectricstuff » Tue Dec 07, 2010 11:17 am

The confusion may arise from the fact that answer depends on which version of IAR you are using.
V.4x will produce a hex file if you specify in the linker options (linker-> extra output -> generate extra output file -> Intel-Extended). I have a feeling you may also need to override the default filename to .hex as it uses something like .a90 by default (or I may be mis-remembering this from the AVR version)

v5.x will not generate a hex file - it only uses ARM's ELF/DWARF format. You need to use their ielftool utility to generate the hex file.
This is documented in the C/C++ Development guide

This can be automated using build actions-> post build command line to run ielftool, so it generates a hex automatically after building.

twr
Posts: 1
Joined: Wed Jan 23, 2013 6:35 pm

Re: IAR compiler -> no hex file???

Post by twr » Thu Jan 24, 2013 4:46 am

Hi all,

I have used IAR version 5.41 with STM32Fxxx micro and a free firmware loader via the STMF's com port that requires a HEX file format.

IN IAR you load your project, then under project-set options-output converter, you can select Intel Extended which is a hex format. This worked fine with the tool I was using apart from an error message after the firmware was 100% downloaded, which I ignored as everything loaded fine.

If your writing your own firmware downloader there are lots of descriptions of the Intel format on the web, the xx.bin binary representation of your firmware is a much smaller file format than Hex.

Terry Feb 2013

mitz
Posts: 1
Joined: Thu Oct 09, 2014 5:38 pm

Re: IAR compiler -> no hex file???

Post by mitz » Thu Oct 09, 2014 6:09 pm

From Project -> Options :

Image

ingoldby
Posts: 1
Joined: Tue Jul 28, 2015 7:41 am

Re: IAR compiler -> no hex file???

Post by ingoldby » Tue Jul 28, 2015 7:46 am

Sorry to dig up an old topic, but I thought I would share a solution to the same problem for anyone else searching in the future.

I was finally able to get IAR to generate a hex/bin/srec file using the output converter, but only after I changed the name of the output file name from the linker to project_name.out instead of project_name.elf

Go to Project Options (right click on the project) -> Linker -> Output -> change Output filename: to something ending in .out

Doing this enabled my output converter to work to generate my desired hex file.

Cheers!

stevech
Support Volunteer
Posts: 2907
Joined: Sat Jun 05, 2004 8:51 pm
Location: USA, California

Re:

Post by stevech » Fri Jul 31, 2015 9:02 pm

jayjay wrote:
the IAR doesn't produce a hex file it needs an plugin called cspy
The C-Spy is a properitery debug monitor supplies with the IAR toolchain, it has nothing to do with hex file generation.

Jay
Incorrect. IAR EWARM has a config setting to optionally create an intel .hex or other formats.
Built-in capability. Doesn't need C-Spy for this.

Post Reply