Here are the commands I use to upload a program to the device:
JLinkExe -device nrf51422_xxac -if swd -speed 4000
loadbin filename.bin 0x18000
r
exit
It works like a charm when entered from terminal, but when added to the Makefile, it hangs after printing out last log message:
Loading: _build/nrf51422_xxac_s110.bin
JLinkExe -device nrf51422_xxac -if swd -speed 4000
SEGGER J-Link Commander V5.10g (Compiled Jan 6 2016 13:58:14)
DLL version V5.10g, compiled Jan 6 2016 13:57:56
Connecting to J-Link via USB...O.K.
Firmware: J-Link OB-SAM3U128-V2-NordicSemi compiled Aug 28 2015 19:26:24
Hardware version: V1.00
S/N: 681121013
Emulator has Trace capability
VTref = 3.300V
Type "connect" to establish a target connection, '?' for help
So it looks like it hangs after the first JLinkExe command is executed. What is the cause of this? BTW, I am using Xcode with External Build System target to do that. Program is compiled properly.