This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to flash bootloader with JLink / gcc ?

Hi ; Following my question how-to-flash-with-jlink-command-line which was successful, I can flash Soft Device and my app on my nRF51822 board (mac os x + gcc)

Now I would like to flash the bootloader

if SWD
speed 4000
device nrf51
w4 4001e504 2
w4 4001e50c 1
sleep 100
r
# OK - this works for SD + app only / no bootloader
loadfile s110_nrf51822_7.0.0_softdevice.hex
loadfile app.hex

# FAIL - this does not work for bootloader + SD + app
loadfile bootloader_dgs_V0_AA.hex
loadfile s110_nrf51822_7.0.0_softdevice.hex
loadfile app.hex

sleep 100
r
g
exit

Any help ? Thanks

Parents
  • I can't think of any reason this wouldn't work. Really all the bootloader is is a hex file just like a softdevice or an application.

    So try to flash your bootloader on its own. If that works then try to flash the bootloader and then the application. If that works I have a feeling that your bootloader and softdevice overlap (they both try to store some data in the same address) and this will fail because in our device you can only write to flash that is erased (you can't write a bit in flash that is 0 to 1 without erasing).

    So double check that the two aren't overlapping. You can probably fix this really quick by checking the linker scripts for the bootloader and softdevice and making sure their ROM memory doesn;t overlap.

Reply
  • I can't think of any reason this wouldn't work. Really all the bootloader is is a hex file just like a softdevice or an application.

    So try to flash your bootloader on its own. If that works then try to flash the bootloader and then the application. If that works I have a feeling that your bootloader and softdevice overlap (they both try to store some data in the same address) and this will fail because in our device you can only write to flash that is erased (you can't write a bit in flash that is 0 to 1 without erasing).

    So double check that the two aren't overlapping. You can probably fix this really quick by checking the linker scripts for the bootloader and softdevice and making sure their ROM memory doesn;t overlap.

Children
No Data
Related