HEX file creation

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

HEX file creation

1,573 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by eddiemallon on Fri Jan 29 09:08:12 MST 2016
In the past I have used the KEIL IDE to compile code and create a hex file which I have downloaded to a number of 2129 boards via the RS232 port without any problems. I now want to use the LPCExpresso IDE to develop and compile new code. I have added the line 'arm-non-eabi-objcopy -0 ihex ${BuildArtifactFileName}${BuildArtifactFileBaseName}.hex' to the post build steps and changed the artefact extension to HEX. The BUILD creates a HEX file but in trying to download it to my 2129 target board using the Philips Flash Utility, an message appears stating that it is invalid or unsupported HEX type.

Any ideas please?
0 Kudos
8 Replies

766 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Mon Feb 01 13:44:06 MST 2016
Do you need to use also a post build command to set the vectors checksum?
Or is this done automatically by Keil (which I do not use)?
Or by the download and flash tool?

Cheers, Mike.
0 Kudos

766 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by eddiemallon on Mon Feb 01 12:37:29 MST 2016
Hi Guys

thanks for info, The IDE is now creating a hex file which is downloadable.

Unfortunately, code not executing so will have to look further into this,

At least I am a stage further.
0 Kudos

766 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Sun Jan 31 12:36:26 MST 2016

Quote: eddiemallon
Hi

the build console contains the following:

12:03:08 **** Incremental Build of configuration Release for project test ****
make -r all
Building target: test.hex
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -Xlinker -Map="test.map" -Xlinker --gc-sections -mcpu=arm7tdmi -T "test_Release.ld" -o "test.hex"  ./src/cr_startup_lpc21.o ./src/crp.o ./src/main.o  
Finished building target: test.hex

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size "test.hex" ; #arm-none-eabi-objcopy -v -O binary "test.hex" "test.bin" ; #checksum -p LPC2129 -d "test.bin" ; arm-non-eabi-objcopy -O hex "test.hex" "test.hex"
   text   data    bss    dec    hexfilename
    440      0      0    440    1b8test.hex


12:03:09 Build Finished (took 690ms)

the hex file is identical to the axf file.

The text in the post build is:

arm-none-eabi-size "${BuildArtifactFileName}"
#arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin"
#checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"
arm-non-eabi-objcopy -O hex "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.hex"




:quest: 

Default post build is:

arm-none-eabi-size "${BuildArtifactFileName}"
[color=#f00]#[/color]arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin"
[color=#f00]#[/color]checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"


Just change it to [color=#f00]Intel[/color] Hex:

arm-none-eabi-size "${BuildArtifactFileName}"
arm-none-eabi-objcopy -v -O [color=#f00]ihex[/color] "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}[color=#f00].hex[/color]"

0 Kudos

766 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by eddiemallon on Sun Jan 31 08:25:39 MST 2016
Hi

the build console contains the following:

12:03:08 **** Incremental Build of configuration Release for project test ****
make -r all
Building target: test.hex
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -Xlinker -Map="test.map" -Xlinker --gc-sections -mcpu=arm7tdmi -T "test_Release.ld" -o "test.hex"  ./src/cr_startup_lpc21.o ./src/crp.o ./src/main.o  
Finished building target: test.hex

make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size "test.hex" ; #arm-none-eabi-objcopy -v -O binary "test.hex" "test.bin" ; #checksum -p LPC2129 -d "test.bin" ; arm-non-eabi-objcopy -O hex "test.hex" "test.hex"
   text   data    bss    dec    hexfilename
    440      0      0    440    1b8test.hex


12:03:09 Build Finished (took 690ms)

the hex file is identical to the axf file.

The text in the post build is:

arm-none-eabi-size "${BuildArtifactFileName}"
#arm-none-eabi-objcopy -v -O binary "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.bin"
#checksum -p ${TargetChip} -d "${BuildArtifactFileBaseName}.bin"
arm-non-eabi-objcopy -O hex "${BuildArtifactFileName}" "${BuildArtifactFileBaseName}.hex"

0 Kudos

765 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Sat Jan 30 03:39:16 MST 2016
In addition to the comments above from mysepp, I suggest also checking the build log contents and showing us the actual link and objcopy commands that got run, and any messages displayed...

https://www.lpcware.com/content/faq/lpcxpresso/build-console

Regards,
LPCXpresso Support
0 Kudos

766 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mysepp on Fri Jan 29 11:38:18 MST 2016
arm-non-eabi-objcopy -0 ihex ${BuildArtifactFileName}${BuildArtifactFileBaseName}.hex

Is this really the line you used? Is this -0 or -O? Spaces between parameters?
How big is output file? Have you opened it with a text editor? Is the content correct?
0 Kudos

766 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by eddiemallon on Fri Jan 29 10:18:28 MST 2016
Hi and thanks for quick response.

have tried Flashmagic. Same error message, invalid hex file.

With both utilities stating invalid hex file, this would suggest the hex file generation within LPCExpresso IDE.

The code has been compiled on Keil and works OK.
0 Kudos

766 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by vtw.433e on Fri Jan 29 09:21:53 MST 2016
1. Use Flash Magic (http://www.flashmagic.com)
2. Use the command line flash programmer (https://www.lpcware.com/content/faq/lpcxpresso/command-line-flash-programming)
0 Kudos