Skip to main content
Graduate II
April 2, 2024
Solved

HEX file with 32 Byte data line

  • April 2, 2024
  • 2 replies
  • 2170 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

    2 replies

    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?

    Martin42Author
    Graduate II
    April 2, 2024

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

    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?

    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