I use nrfjprog in a CI system (on Windows 10) which has multiple NRF52 boards attached to it. The boards are all run in parallel with the -s parameter to nrfjprog and the -USB parameter to jlink (which is used to obtain RTT logging from the boards) indicating which board is being addressed by each command-line operation. I also apply mutex locks so that nrfjprog is never called at the same time to program two different boards.
About 1 in 10 times my call to nrfjprog just hangs, does nothing. When I terminate it the return value is 15, "The arguments passed do not perform a valid operation", but the parameters are always the same:
nrfjprog -f nrf52 --program nrf52840_xxaa.hex --chiperase --verify -r -s <serialnumber>
Retrying the command doesn't help, nrfjprog just continues to hang. I believe that on the occasions this occurs jlink has just completed a logging session and the board is being programmed for the next thing. Like I say, it doesn't happen all the time, roughly 1 in 10 times, which is enough to cause frequent CI failures.
Any suggestions as to what I might do to work around this?
Version numbers are:
nrfjprog version: 10.6.0JLinkARM.dll version: 6.80a
Update: I think one of the Segger engineers got a bit annoyed at me for not wanting to buy their SDK but he did then give me the information I was after. In case anyone else has this problem:
If you are…
Answering my own question: the workaround is to wait for 5 seconds after jlink has stopped. I was waiting for 1 second, that's obviously not enough, it must take some time to shut-down leaving things safe and happy for nrfjprog to run without problems.EDIT: not sooner do I type that but the failure occurs again, even waiting for 5 seconds doesn't help. Suggestions for workarounds welcomed.
Could you try the latest version of nRF-Command-Line-Tools v10.10? Please let me know it can help or not. Thanks.
Thanks: after updating to v10.10 I've not yet seen a recurrence of the problem (20 runs so far). I will continue pounding it, but initial results are good.
Great to hear that. Cheers.
Unfortunately it does still occur: possibly less frequently but the symptoms are the same. Any other suggestions?