DAVE TIP of the day: How to use SEGGER J-Link to download .hex file into XMC devices

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Sometimes you may not have the DAVE project but have .hex file only.
With SEGGER J-Link/J-Link Lite, you are able to use "loadbin" command to download binary file into the target. In this case, debugging is not possible.

Here is an example:
1) Convert .hex to .bin file
Go to: C:\Program Files\SEGGER\JLinkARM_V474 --> Run JFlashARM.exe --> Open "test.hex" data file --> Save as "test.bin" file under c:\temp
2) Download and run
Go to: C:\Program Files\SEGGER\JLinkARM_V474 --> Run JLink.exe. --> Type the following commands:
J-Link>device XMC4500-1024
J-Link>loadbin c:\temp\test.bin, 0x0C000000
J-Link>r
J-Link>g

392.attach
0 Likes
3 Replies
User7457
Level 2
Level 2
First like received
Hi,
I can generate a bin file starting from an hex or elf file using objcopy. But the resulting bin file is sligthly different from the bin file obtained with the method you exposed.
In particular the differ in the section .rel.dyn ( as checked into map file 😞 with the method you exposed I found there eight FF bytes while using objcopy there are eight 0 bytes.
All other bytes are equal.
What about this difference?

Thanks
Frank
0 Likes
Not applicable
Hi Frank,

The rel.dyn is only applicable in the case of dynamic linking and loading.
The DAVE project image is 100% a statically linked image with all references resolved. Hence, this section is irrelevant.

Best regards,
Sophia
0 Likes
Not applicable
For those who are tired of typing: You can put the commands to the Jlink into a file and start JLink.exe (or JLinkExe on Linux/OSX) with this file as argument.
0 Likes