Hello,
I've been evaluating the speed of nrfjprog vs JLinkExe to flash multiple devices and found out that i could use JLinkExe with .jlink scripts to save roughly 50% of the time spent on flashing. It makes a huge difference for me since I'll be flashing quite a few of devices in series. Now everything seems fine and flashed devices seem to be working but I would like to ask if there is something which nrfjprog does which is not so obvious and if I skip it I'll potentially have some issues? My .hex file is already merged with bootloader and softdevice so it is self contained.
I'm pasting the .jlink scripts and a bash on to control the process which I'm using as a replacement to the following commands:
nrfjprog --recover nrfjprog -e nrfjprog --program fw_merged_with_BL_SD_AP.hex nrfjprog -r nrfjprog --rbp ALL
Flash.jlink
r h loadfile fw_merged_with_BL_SD_AP.hex sleep 100 r g exit
erase.jlink
h w4 4001e504 2 w4 4001e50c 1 sleep 100 r exit
Then just the bash function which I call which does the job and enables RBP which I yet haven't found how to do via JLinkExe
function flash_jlink(){ JLINK="JLinkExe -device nrf52832_XXAA -if swd -speed 4000" $JLINK erase.jlink $JLINK flash.jlink nrfjprog --rbp ALL }