2020-04-26 03:21 PM
I am using STM32CubeIDE, version 1.2.0.
I want to convert the elf file into an srec file with a particular format.
I have tried editing the command line in the Post-build steps to read:
arm-none-eabi-objcopy.exe -O srec —srec-len=28 —srec-forceS3 “$(BuildArtifactBaseName).elf�? “$(BuildArtifactBaseName).s19�?
A file is generated with the .s19 extension but the file contents are in the Intel hex format.
I have also tried to select the box in Tool Settings/ MCU Post build outputs window labeled “Convert to Motorola S-record�? and I get the same result. The generated file has the .srec extension but the format of the file is Intel hex.
Has anyone figured out the correct way to do this?
Thanks
2020-04-26 03:49 PM
@objcopy is part of the binutils project, so you perhaps might want to raise a complaint there... But I don't believe that is a viable path.
You might try some of the ARM-built GNU binaries.
Also, are you sure CubeIDE executes your command line? Also, do the double-dash options start with double-dash? Here I see something different, but that may be the idiotic salesforce autocorrecting editor, too: ( --test) Try to run that command normally in command line.
It may be better to simply convert intelhex to srec using srecord.
JW
2020-04-26 03:57 PM
Back when the Atollic demo didn't generate hex files properly I posted a tool called FIXELF that exported in Intel and Motorola forms
2020-04-26 05:49 PM
Those really are double dashes.
Thank you both! I will try both suggestions.
2020-04-27 02:06 PM
Again, thank you both for your suggestions. They reminded me that I have access to IAR's ielftool which I have been using for years for an NXP processor. So I used that and it worked as expected.
I do suspect something wrong with the way STM32CubeIDE is handling the post build command though. While it does parse the command line (and return an error when the syntax isn't correct) it is odd that it consistently converts the elf file to intelhex format no matter what the command line reads.