nrf9160 RTT reconnect after flashing

Hi,

I do have Zephyr's logging configured using RTT for debugging messages and in general this works.

Sadly when reflashing (via SWD) the RTT stops working and I have to restart (disconnect/reconnect) RTT to get it up working again.

To dig into this I started a JLink Commander instance with logging enabled (-Log <file>) and connected an RTTViewer to it. The output is fine.
After Flashing via west flash (runner either Jlink or nrfjprog) the JLinkCommander instance logs it's unsuccessful search for the RTT control block.
It only finds it after restarting the JLink Commander.

I at least checked what the JLink runner is doing (not sure what nrfjprog is doing) and found out that it's the 'writeDP 1 0', 'readDP 1' commands it issues that somehow prevents the
running JLink instance from finding the RTT control block (same happens when I issues these commands in a JLink Commander script).
Manually running a JLink Commander script  that flashes (loadfile) and resets the nrf9160 without the 'writeDP 1 0', 'readDP 1' allows the other running instance to
successfully find the RTT control block after the flashing.

Is that behavior known? It's really annoying this way as every flashing requires an RTT restart. Anything to fix it without modifying the runners (and not really knowing what
the intention is behind resetting the debug port)

ncs version 2.1.2
JLink V7.82
Linux (Ubuntu 20.04)

Regards,

Clemens

Related