Skip to main content
Associate III
April 2, 2024
Solved

HEX file with 32 Byte data line

  • April 2, 2024
  • 5 replies
  • 2236 views

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

This topic has been closed for replies.
Best answer by Peter BENSCH

@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

5 replies

Andrew Neil
Super User
April 2, 2024

@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?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Martin42Author
Associate III
April 2, 2024

I transfer the data via Modbus and this makes the transfer a little bit faster.

Andrew Neil
Super User
April 2, 2024

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?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Peter BENSCH
Peter BENSCHBest answer
ST Technical Moderator
April 2, 2024

@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

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.