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 🙂