Further to [SOLVED] J-Link freeze in multiply parallel environment, having resolved that problem in a multiply parallel environment we seem to be left with a residual issue, which is that on some occasions (around the 1 in 10 times mark again) a J-Link session opened for RTT logging fails to emit any logging whatsoever from the target.
On these occasions it seems that J-Link, or whatever underlies it, is confused about the process it is serving.
In detail: we run Nordic nrfjprog to download to the NRF52 platform (details of the command-line below). This is driven from a Python script as a sub-process, non-shell, as described in the post concerning the previous problem, and runs perfectly normally, exiting all by itself having completed the download, no forced exit or anything of that nature.
We then start J-Link to do RTT logging and, in the fail case, rather than indicating that the process is jlink.exe, J-Link prints out that the process is nrfjprog.exe, which terminated a second or two earlier. Find below a success case and a fail case for comparison.
Do you have any suggestions as to how we might prevent this confusion from occurring? It is worth remembering that, as indicated, we are running multiple of these in parallel, our assumption being that by including the debugger serial number in the command-line that the processes are utterly separate. Is that a safe assumption or might there be "danger times" when that is not true? If so, what such situations should we avoid?
Here's a success case with timestamps shown on the left:
Display All
...and after that RTT logging flows from telnet port 19021.
Here's a fail case, again with timestamps:
Display All
...and after that no RTT logging whatsoever is emitted from telnet port 19021.
On these occasions it seems that J-Link, or whatever underlies it, is confused about the process it is serving.
In detail: we run Nordic nrfjprog to download to the NRF52 platform (details of the command-line below). This is driven from a Python script as a sub-process, non-shell, as described in the post concerning the previous problem, and runs perfectly normally, exiting all by itself having completed the download, no forced exit or anything of that nature.
We then start J-Link to do RTT logging and, in the fail case, rather than indicating that the process is jlink.exe, J-Link prints out that the process is nrfjprog.exe, which terminated a second or two earlier. Find below a success case and a fail case for comparison.
Do you have any suggestions as to how we might prevent this confusion from occurring? It is worth remembering that, as indicated, we are running multiple of these in parallel, our assumption being that by including the debugger serial number in the command-line that the processes are utterly separate. Is that a safe assumption or might there be "danger times" when that is not true? If so, what such situations should we avoid?
Here's a success case with timestamps shown on the left:
Source Code
- 2020-11-23_10:08:18 nrfjprog -f nrf52 --program u_pca10056.hex --chiperase --verify -r -s 683253856
- 2020-11-23_10:08:21 Parsing hex file.
- 2020-11-23_10:08:22 Erasing user available code and UICR flash areas.
- 2020-11-23_10:08:23 Applying system reset.
- 2020-11-23_10:08:24 Checking that the area to write is not protected.
- 2020-11-23_10:08:24 Programming device.
- 2020-11-23_10:08:33 Verifying programming.
- 2020-11-23_10:08:42 Verified OK.
- 2020-11-23_10:08:42 Applying system reset.
- 2020-11-23_10:08:43 Run.
- 2020-11-23_10:08:45 [nrfjprog, pid 3840 ended with return value 0].
- 2020-11-23_10:08:46 jlink.exe -Device NRF52840_XXAA -If SWD -Speed 4000 -Autoconnect 1 -ExitOnError 1 -RTTTelnetPort 19021 -USB 683253856...
- 2020-11-23_10:08:49 SEGGER J-Link V6.86g - Real time terminal output
- 2020-11-23_10:08:49 J-Link OB-SAM3U128-V2-NordicSemi compiled Mar 17 2020 14:43:00 V1.0, SN=683253856
- 2020-11-23_10:08:49 Process: jlink.exe
Here's a fail case, again with timestamps:
Source Code
- 2020-11-23_14:33:57 nrfjprog -f nrf52 --program u_pca10056.hex --chiperase --verify -r -s 683253856
- 2020-11-23_14:34:00 Parsing hex file.
- 2020-11-23_14:34:01 Erasing user available code and UICR flash areas.
- 2020-11-23_14:34:01 Applying system reset.
- 2020-11-23_14:34:02 Checking that the area to write is not protected.
- 2020-11-23_14:34:02 Programming device.
- 2020-11-23_14:34:11 Verifying programming.
- 2020-11-23_14:34:20 Verified OK.
- 2020-11-23_14:34:20 Applying system reset.
- 2020-11-23_14:34:21 Run.
- 2020-11-23_14:34:23 [nrfjprog, pid 9544 ended with return value 0].
- 2020-11-23_14:34:24 jlink.exe -Device NRF52840_XXAA -If SWD -Speed 4000 -Autoconnect 1 -ExitOnError 1 -RTTTelnetPort 19021 -USB 683253856...
- 2020-11-23_14:34:27 SEGGER J-Link V6.86g - Real time terminal output
- 2020-11-23_14:34:27 J-Link OB-K22-NordicSemi compiled Jan 21 2020 17:33:01 V1.0, SN=960115898
- 2020-11-23_14:34:27 Process: nrfjprog.exe <-- in the fail case J-Link always prints that the process is nrfjprog.exe and not jlink.exe