This tutorial was extracted from Erich Styger blog http://mcuoneclipse.wordpress.com with his agreement.
With my Freescale Freedom FRDM-KL25Z board, I’m using the GNU/gcc build tools and Eclipse/CodeWarrior. When I wanted to create an S19 file of my application using the GNU tools, this was not that easy to find out. So here are the steps to do this:
I open the project setting using the menu Project > Properties and go to C/C++ Build > Settings > Additional Tools and enable’Create Flash Image‘:
Additional Tools gcc Settings
Now I need to press the Apply button:
Apply Button
Pressing the Apply button will show up an additional ‘Create Flash Image’ group. Many other formats are available in the drop down as shown in the screenshot.
Create Flash Image Option
Now I can specify S-Record/S19 as output format:
Settings to create S-Record
Pressing OK, and building my project again will show up the S19 file together with the application file:
S19 File Generated
After dealing with S19 file generation, let see how get a simple decoder of the file format.
The good thing is that such a decoder is provided with CodeWarrior for MCU10.x
That capability is built into the Decoder.exe which is delivered with the Freescale S08 (or S12) tool chain, and is located inside the MCU\prog folder:
Decoder.exe inside MCU prog Folder
That Decoder is usually used to disassemble Freescale S08 object or absolute files. But as S19/S-Records files are very generic, that decoder can even decode ARM Cortex S-Record files: it just cannot understand the assembly code, but this does not matter for my use case.
The decoder comes with a command line interface. But I can use it with a GUI (Graphical User Interface) if I launch it without any arguments (or start it from the Windows Explorer):
Decoder Application Window
The simplest way to decode files is: simply drag&drop the file into that window
Drag and Drop of S19 file into decoder
This creates the .lst listing which I can open in a text editor:
Decoded S19 File
Now I can easily inspect each S-Record line with type, length, address, data and checksum