Converting S19 Files into Binary Files with GNU objcopy

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?

Converting S19 to BIN

Converting S19 to BIN

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 🙂

One thought on “Converting S19 Files into Binary Files with GNU objcopy

  1. Pingback: Executing Multiple Commands as Post-Build Steps in Eclipse | MCU on Eclipse

What do you think?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s