how to align the address in hex file by arm-none-eabi-objcopy.exe

Asked by fiona

When I'm using arm-none-eabi-objcopy.exe to create a HEX file from ELF file. There is just one problem : somewhere in the middle of the HEX file one of the packets size takes just 4/8 bytes, and then the addresses of the rest of the file now is starting from a XXX8 and XXXC address which is not aligned anymore.

My bootloader requires the the data is 16 byte aligned, but some hex data is not aligned, as below:

:10080000FAE770470023C25C0133002AFBD1581E6F
:1008100070470000FEE7C04641540000430000005E
:1008200000F0FF1FF8B5C046F8BC08BC9E467047F4
:0C083000F8B5C046F8BC08BC9E467047F6
:08083C0034FCFF7F0100000005
:040844003904000073
:040848001104000097

What is the solution for this situation? is there a simple way to enforce the arm-none-eabi-objcopy.exe to create a 16 bytes aligned HEX file ?

Question information

Language:
English Edit question
Status:
Answered
For:
GNU Arm Embedded Toolchain Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Uwe Bonnes (bon) said :
#1

You need to modify the linker script ans add ALIGN(16) at the relevant places.

Can you help with this problem?

Provide an answer of your own, or ask fiona for more information if necessary.

To post a message you must log in.