Topic : S-Record Output File Generation

Forum : Ride IDE

Original Post
Post Information Post
December 4, 2008 - 11:51pm
Guest

I see that RIDE 7 for ARM STM32 generates an Intel Hex formatted file with the extension HEX. I cannot find where, or how, this output is specified. In addition to HEX, I also need S19 output.

How, and where, can I set up the project options to also generate an S19 S-Record output file format?

I have been unable to find any way to do this. Any and all help would be appreciated.

Thanks,
Garry.

Replies
Post Information Post
+1
0
-1
December 5, 2008 - 9:51am
Raisonance Support Team

Hi,

You can find the definition of the hex file format on the internet. For example:
http://en.wikipedia.org/wiki/.hex

RIDE will not generate srec files directly. Only elf and hex.
But you can use the objcopy (arm-none-eabi-objcopy) utility, which comes with the gcc toolchain, to convert the hex (or elf) file to srec. (and many other formats)
Run the utility in a DOS prompt without argument and it will display its help.

Best Regards,

Vincent

+1
0
-1
December 5, 2008 - 7:32pm
Guest

Hi Vincent:

Thanks for the lead. Although I could not find any acceptable values for , as hinted by the objcopy help menu, I experimented with OBJCOPY and found the following syntax appears to work:

objcopy -Iihex -Osrec filename.hex filename.s19
objcopy -Isrec -Oihex filename.s19 filename.hex

Can anybody please confirm that the examples I have shown above are indeed correct?

I see the Raisonance Make operation (F9) launches the following command (as one of several commands):

objcopy filename.elf --target=ihex filename.hex

and I am confused as to why the "--target" option is used since said option is supposed to set both input and output formats to "ihex", according to the help menu which is generated by objcopy.

Does anybody know by "--target" has been used in F9 Make, and does anybody know where this call to objcopy is created so I can modify it to generate "srec" not "ihex"?

Thanks for your help.
Garry.

+1
0
-1
December 8, 2008 - 10:45am
Raisonance Support Team

Hi,

I think that the input format that you give to objcopy is not really important, as objcopy automatically detects it by reading the input file if it can. (and with elf files it always can! ;) ) So both syntax, "--target" and "-I... -O...", work. (and probably just "-O..." would work too) You should ask the GCC team if you really need more detailed information on this.

For now there is no clean way to declare external post-link tools in RIDE7. (it is planned for a future release)
So you'll have to call objcopy as a pre-download operation instead, if possible. (in your batch that calls the flash loader, for example)

If that is not possible, the dirty fix is to change the output of RIDE in the linker config file: search for "objcopy" in "\Config\ARM\LD.config". That will show you the line that tells RIDE to generate the hex file. Then, duplicate the line and modify the copy for generating a srec file instead of hex. Keep the hex file generation, as RIDE might need it. But you must be aware that if you modify this internal RIDE file, then we cannot guarantee the correct operation of RIDE anymore. So you should at least save the file before modifying it, and make as few modifications as possible. And of course you'll have to do it again if you reinstall RIDE.

I hope it helps.

Best Regards,

Vincent