Typically I can create with my build the file I usually need (like an S19). See “S-Record Generation with gcc for ARM/Kinetis” how to do this in CodeWarrior, or “Binary Files for the mbed Bootloader with Eclipse and GNU ARM Eclipse Plugins” how this works in Kinetis Design Studio. The basis of all this is the GNU objcopy utility (see “S-Record Manipulation with GNU objcopy and Burner Utility”). So what if I just have an S19 (S-Record) file and need it in a different format, e.g. as .bin (binary) file for the mbed bootloader which only accepts .bin (raw binary) files?
The command line arguments to the GNU objcopy utility are described here.
The syntax to convert a file is this:
objcopy --input-target= --output-target=
The objcopy utility comes with the GNU tools and utilities, and are in the ‘bin’ subfolder of the toolchain.
The following example converts a S19 file (inFile.s19) into a binary file (outFile.bin), using the GNU ARM toolchain:
arm-none-eabi-objcopy.exe --input-target=srec --output-target=binary inFile.s19 outFile.bin
Of course the same way it is possible to convert between different other formats.
Happy objcopying 🙂
Pingback: Executing Multiple Commands as Post-Build Steps in Eclipse | MCU on Eclipse
Is there any Step-by-step Instruction on how to convert S19 File into Bin File.
Yes, have you read https://mcuoneclipse.com/2014/08/03/converting-s19-files-into-binary-files-with-gnu-objcopy/ ?
What I mean is that on how and where to use/put this: objcopy –input-target= –output-target=
and “The objcopy utility comes with the GNU tools and utilities, and are in the ‘bin’ subfolder of the toolchain”. Where is toolchain?
It is part of the GNU Tools for ARM Embedded, e.g. see https://launchpad.net/gcc-arm-embedded
Pingback: Recovering and Updating the NXP OpenSDA Bootloader with P&E Multilink and MCUXpresso IDE | MCU on Eclipse
Pingback: Converting a Raw Binary File into an ELF/Dwarf File for Loading and Debugging | MCU on Eclipse