cancel
Showing results for 
Search instead for 
Did you mean: 

Hex file settings in MCUxpresso

Contributor III
0 1 451

Hello everyone, I am working on MCUxpresso and using LPC1769 controller. I am done with Led blinking in MCUxpresso. I have used flash magic to flash the hex file in controller using usb to ttl. But I faced a hex file issue while doing this project. So I thought I should share this with everyone who are facing the same issue. After compiling only .axf was getting created. For creating .hex file ,you need to do following settings:

1)Go to properties---> C/C++ Build --->Settings ---> Build Steps

Now in post build steps :

Change

arm-none-eabi-size "${BuildArtifactFileName}"

# arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin"

# checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin

to

arm-none-eabi-size "${BuildArtifactFileName}"

# arm-none-eabi-objcopy -v -O hex "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.hex"

# checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.hex"

2) After  doing step 1, please check if axf is selected in Artifact extension as shown below:

pastedImage_1.png

3)For creating hex file go to Debug-->.axf file-->Right Click-->Binary Utilities-->Create hex. Now you are ready to flash! 

pastedImage_4.png

Also kindly check this article:MCUXpresso IDE: Creating Binary Files (S-Record, Intel Hex, Binary) 

After doing these settings I got the hex file and finally it worked!!:smileyhappy:

1 Comment
NXP TechSupport
NXP TechSupport

Hi,

I try to add checksum to hex file. But it seems checksum.exe could not support hex file. Command as follow: 

arm-none-eabi-size "${BuildArtifactFileName}"

arm-none-eabi-objcopy -v -O ihex "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.hex"

checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.hex"

The output file will be

pastedImage_1.png

 

You can see checksum add garbled code from the 28th(0x1c) character.  

Did I miss something?

Regards,

Jing