cancel
Showing results for 
Search instead for 
Did you mean: 

HEX file with 32 Byte data line

Martin42
Associate III

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

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

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

View solution in original post

5 REPLIES 5
Andrew Neil
Evangelist III

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

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

Peter BENSCH
ST Employee

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

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?

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/