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

nRF52832 + nrfjprog: need to program twice

Our custom board has an nRF52832. In our custom build system the application HEX and SoftDevice HEX are merged together into a single HEX file, this is achieved by Nordic's mergehex tool. nrfjprog is used to program the device's flash. Here's the command:

nrfjprog \
		-s 269400451 \
		--jdll $(TOOL_DIR)/opt/JLink_Linux/libjlinkarm.so \
		-f NRF52 \
		--clockspeed 4000 \
		--program complete.hex \
		--sectorerase \
		--reset

Executes without a problem. The weird thing is that if I change the source code, recompile the program and issue the command above, the MCU fails to start, but after the second call of this command the MCU starts with the new binary.

It's quite annoying to always burn the same new flash content two times. Have you got any idea what can this be?

Thanks,

Related