Generate binary artifact with LPCXpresso

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Generate binary artifact with LPCXpresso

2,082 Views
alexrebega
Contributor I

Hello. I am using LPCXpresso to develop software for LPC11C12. 

The generated build-artifact has the .axf extension. I would like to generate a binary file from that so I am using the following command: 

arm-none-eabi-objcopy --reverse-bytes=4 -v -O binary "myArtifact.axf" "myArtifact.bin"

I am getting this error:

arm-none-eabi-objcopy.exe: cannot reverse bytes: length of section .debug_info must be evenly divisible by 4

A .bin file is generated but when I write it to the flash memory it does not work (it works when I write the axf file to flash). If I inspect the axf and bin files using a hex-editor the bytes order is reversed.

Can anyone suggest a solution, maybe a way to add a padding to debug_info to make it divisible by 4? I would prefer not to reverse the bytes order manually as I want to use the .bin file in production.

0 Kudos
2 Replies

1,762 Views
soledad
NXP Employee
NXP Employee

Hi,

Please check the below threads. 

I hope this helps.

files 

IDE: Creating Binary Files (S-Record, Intel Hex, Binary) 

Have a great day,
Sol

 

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

1,762 Views
converse
Senior Contributor V

Why are you using "reverse-bytes"? It is not needed when converting an AXF file into a binary. In fact (as you have discovered) it will reverse the byte order, thus breaking your binary!

See chapter 16.11 "Creating bin hex or S-Record files" in the MCUXpresso User Guide for more information.