segger j-link loadbin vs loadfile

Using the segger J-Link to directly upload firmware using SWD to micro-controllers has always been a bit cumbersome. One of the problems is that it required a binary file with just the raw binary data and you had to explicitly give the location the binary data has to be written to as an argument.

loadbin <filename>, <addr>

Newer versions of the JLink tool allow uploading of various file formats which eases this a bit.

loadfile <filename> [<addr>]

An easy way to use this is convert the object file of your firmware to an intel hex file and just upload it with loadfile. For example the following Makefile rule does the conversion to intel hex:

%.hex: %.elf
    $(OBJCOPY) $^ -O ihex $@


The hex file can then just be uploaded with loadfile.

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *