1
\$\begingroup\$

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!

| improve this question | | | | |
\$\endgroup\$
1
\$\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.

| improve this answer | | | | |
\$\endgroup\$
  • \$\begingroup\$ @sernaj, I cannot use IAR to build or load the .out file. I will need to use another type of loader. We have an ST-Link, a J-Link and an R-Link (Raisonance). The J-Link is much more supported. \$\endgroup\$ – JeffV Oct 7 '10 at 0:23
  • \$\begingroup\$ You can use the GNU utility [objcopy][1] to convert from elf to another format (e.g. binary or Intel-hex"). [1]: gnu.org/software/binutils \$\endgroup\$ – semaj Oct 7 '10 at 15:49
1
\$\begingroup\$

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:

$ jrt@linux: file myfile.elf
ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, not stripped

But, not raw ARM binaries

$ jrt@linux: file myfile.bin 
myfile.out: data

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).

$ xxd myfile.out | head

0000000: 7037 0020 fd52 0300 6553 0300 6d53 0300  p7. .R..eS..mS..
0000010: 8553 0300 7953 0300 8553 0300 0000 0000  .S..yS...S......
0000020: 0000 0000 0000 0000 0000 0000 8553 0300  .............S..

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.

| improve this answer | | | | |
\$\endgroup\$
  • \$\begingroup\$ objdump gives me an unrecognized format error. Even nm cannot recognize it. I am using the arm-none-eabi-xxx bin tools from my Code Sourcery toolchain for these attempts. I'm not sure if that would matter though. My guess is that IAR is doing something proprietary. \$\endgroup\$ – JeffV Oct 7 '10 at 11:46
  • \$\begingroup\$ @JeffV it might be this format supp.iar.com/FilesPublic/UPDINFO/005173/simple_code.htm \$\endgroup\$ – Toby Jaffey Oct 7 '10 at 12:27
  • \$\begingroup\$ Thanks, @Joby Taffey, I will check the binary for the magic number in the morning. \$\endgroup\$ – JeffV Oct 8 '10 at 0:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.