cancel
Showing results for 
Search instead for 
Did you mean: 

IAR Compiler and Linker. Output file extensions

morpeh89
Associate II
Posted on April 22, 2010 at 19:10

IAR Compiler and Linker. Output file extensions

10 REPLIES 10
Posted on May 17, 2011 at 13:48

Been a while since I demo'd IAR, using an STR912 + J-Link

But you should be able to select a CPU (make/model) for the project, and select the J-Link as the debug/download device. Then just Build and Download from the IDE. As I recall IAR can also generate HEX files, and the Segger J-Flash application can program those into the device.  The J-Flash application costs more.

You should contact IAR support if you want support for their product.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
morpeh89
Associate II
Posted on May 17, 2011 at 13:48

Thank You for the answer! I don't have any problems while using IDE - but now I need to use iccarm.exe, and maybe some other console-like applications.

Surely, write to IAR support would be the best variant for me...

but do You know, what file formats can be downloaded to STM32 controllers? Or it depends on program-downloader (such as JLink, J-Flash or some other)?

Posted on May 17, 2011 at 13:48

We'll it depends on what the tools support. I generally use Intel Hex, Motorola S Records, Binary, or ELF/AXF Objects. IAR has their own object format I don't care for.

The STM32 Flash Loader application, which connects to the USART1 Boot Loader, can support .HEX (Intel), .S19 (Motorola) and .BIN (Binary). I would suspect most tools would support these as a minimum. J-Flash supports extensions .MOT, .SREC, .S19, .S, .HEX and .BIN

The ST boot loader has it's own protocol that receives binary data, the PC side application deals with the addresses and data format conversions.

There are other ST app notes/code using Y-Modem to upload binary data. My application downloads a binary via HTTP to update itself.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on May 17, 2011 at 13:48

''what file formats can be downloaded to STM32 controllers? Or it depends on program-downloader''

 

File formats are utterly irrelevant to the STM32:  all it sees is the stream of bits that arrives on its JTAG port (or whatever) to be programmed into the memory array - it doesn't even know whether those bits represent code or data!

File formats are only relevant to the host applications that have to read them.

Posted on May 17, 2011 at 13:48

Or the monitor/loader coded on the STM32. Hex loaders were design to work efficiently on 8-bit processors, implementing them on the Cortex-M3 isn't particularly hard.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
epassoni950
Associate II
Posted on May 17, 2011 at 13:48

Hello,

In your first approch, you make a mistake.

If you want to build your project on command line, you must first invoke iccarm.exe for compiling and after you must invoke ilinkarm.exe for linking. It's ilinkarm.exe which output an executable file. Options for ilinkarm.exe can define executable output format : Elf, InteHex, Motorola SREC, ...

After that you can connect to your Stm32 to program executable with Jlink or with serial link using internal RomLoader.

Eric
morpeh89
Associate II
Posted on May 17, 2011 at 13:48

Thanks to All for your answers! I surely start understanding all this bulky system 🙂

I have succeeded to compile all files of my project with iccarm.exe and linked them with ilinkarm.exe. But this tool created some ''.out'' file - which is surely not for final downloading (it takes too much place for my flash memory). I have found, that it's possible to create some binary file from this one using objcopy.exe tool. It seems to be proper downloadable file. Soon I will try to download it to crystal using J-Link tool.

The only thing, that confuses me, is that ''.out'' file, created by ilinkarm.exe, slyghtly differs from other one, created in IAR IDE. The only difference is in header part of this file - and I assume, that I used some wrong options during compilation. But I hope, that program will function properly.
Andrew Neil
Evangelist III
Posted on May 17, 2011 at 13:48

You are talking about specificdetails of the IAR tools here - so you should really be asking IAR about this!

epassoni950
Associate II
Posted on May 17, 2011 at 13:48

Hello,

Files with .out extension generated by ilinkarm.exe are standard Elf file. You can rename with extension .elf and use it with all tools that use Elf files. objcopy.exe is a good tool to convert Elf file to various format. It is include with Iar installation until V5.30 but not after and including 5.40. You can use ielftool.exe from Iar installation to convert Elf file to Motorola SEC, Intel Hex or binary.

Best regards

Eric