SparkFun Forums 

Where electronics enthusiasts find answers.

Everything ARM and LPC
By Ferry
#8177
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.
By jayjay
#8199
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
By skakz
#8587
the IAR doesn't produce a hex file it needs an plugin called cspy
By jayjay
#8589
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
By Ferry
#8595
By changing the option, the IAR compiler produced an usable hex file.
By tpicker1
#8732
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
By sparktags
#64665
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.?
By stevech
#112495
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.
By mjbcswitzerland
#113374
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
By mikeselectricstuff
#115069
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.
By twr
#154576
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
By ingoldby
#183643
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!
By stevech
#183724
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.