May 02, 2009 I'm new in using IAR IDE and I need to generate a.hex file to programm my chip(LPC2148) with LPC2000 Flash Utility(LPC210XISP.exe). I observe that the output generated by IAR have elf-gcc extension or orther. Under ProjectOptions, select. The idea is that the library can be separately verified and possibly certified once, and later on used by other applications. The library is compiled and linked in a separate IAR Embedded Workbench project. The output is one ordinary ELF (or HEX) file, and one output file containing the exported symbols.
I have a binary of the form '.out', from a project that was generated by an IAR development suite. The release directory does not have an ELF or HEX file. This is for the STM32F103 ARM based micro controller. I need to program the binary onto a board off site an so I will not have an IAR development suite.
Can I use a JTAG debugger like the Segger J-Link or Atollic's ST-Link to program the board with the .out file? I know I can program .ELF file in this way. Is it possible with .out files? Can I convert it to an ELF file?
Thanks!
JeffVJeffV2 Answers
$begingroup$Yes. The .out file is actually and ELF file. Set the debugger in your IAR project options to be J-Link/J-Trace. In the download tab, check 'Verify download' and 'Use flash loader(s)'. When you debug the project, the microcontroller is programmed as part of the debugging process.
If you would like, you can also choose the 'Output Converter' category on the project options dialog and generate an output file in addition to the .out file. You probably have choices of Motorola S-record, Intel-Hex, or straight binary.
I use OpenOCD to program Cortex-M3 microcontrollers over JTAG. It works with many JTAG adapters including Olimex ARM-OCD-USB, Segger J-Link and Bus Pirate.
I'd guess that the .out is the raw binary to be copied to flash.When JTAG loading, you need this binary as you're writing direct to the flash.
If the .out is in fact an ELF file. Use objdump to convert it.
'file' on a linux system can identify ELF files:
But, not raw ARM binaries
To see if your .out is an ARM binary, you could disassemble it. Or, just hexdump the start and look for what you expect at location 0 (likely the interrupt vectors).
The ELF cannot be recreated from this. The Intel Hex file is another version of the binary. It's a list of addresses and chunks of data to write to the flash, but may contain holes.
Toby JaffeyToby Jaffey