2024-04-02 06:05 AM
Hi,
my post build command produces the following output with 16 Byte per data line:
:020000040802F0
:1000000000000120E9C00008593D0008CD3D00086E
:100010001D3E00081F3E0008213E000800000000B1
arm-atollic-eabi-objcopy.exe -O ihex --gap-fill 0x00 --pad-to 0x08019000 "${BuildArtifactFileBaseName}.elf" "${BuildArtifactFileBaseName}.hex"
I want to have 32 Bytes in a data line e.g.
:020000040802F0
:2000000000000120E9C00008593D0008CD3D00081D3E00081F3E0008213E0008000000002F
What additional flag can I use to change this?
Thanks in advance
Martin
Solved! Go to Solution.
2024-04-02 06:40 AM
@Martin42 Firstly, please note that Atollic has long been deprecated and is no longer supported. However, even the GNU GCC tool arm-none-eabi-objcopy.exe used in the STM32CubeIDE is currently not able to output HEX files with variable record length.
The programme srec_cat.exe from the freeware tool srecord, on the other hand, can output HEX files with variable record length using the switch -Output_Block_Size.
Regards
/Peter
2024-04-02 06:07 AM
@Martin42 wrote:I want to have 32 Bytes in a data line e.g.
Why do you want that?
The 2 forms should be equivalent - why does it matter?
2024-04-02 06:40 AM - edited 2024-04-02 06:40 AM
I transfer the data via Modbus and this makes the transfer a little bit faster.
2024-04-02 06:40 AM
@Martin42 Firstly, please note that Atollic has long been deprecated and is no longer supported. However, even the GNU GCC tool arm-none-eabi-objcopy.exe used in the STM32CubeIDE is currently not able to output HEX files with variable record length.
The programme srec_cat.exe from the freeware tool srecord, on the other hand, can output HEX files with variable record length using the switch -Output_Block_Size.
Regards
/Peter
2024-04-02 06:46 AM - edited 2024-04-02 06:48 AM
sounds like you need a better serialisation method from the Hex file to the Modbus...
:thinking_face:
and, if you're that worried about the transfer speed, why not just send binary?
2024-04-02 07:12 AM
In the meantime it turned out that the PC tool was opening and closing the COM port on every line. The transfer tooks 20 minutes. After fixing that issue it still takes 3 minutes. That is acceptable.
For the srec tool, the command to convert is:
srec_cat.exe my_basis.hex -intel -output new.hex -Intel -line-length=76
Found at: https://mcuoneclipse.com/2019/07/02/generating-intel-hex-files-with-a-given-length-using-srec_cat/