Get the latest tech news
J-Link RTT for the Masses using Semihosting on ARM
How to do bidirectional logging over SWD on ARM.
The selling point is that you just include their library, and you get non-blocking bidirectional communication with your microcontroller over the SWD lines (SWDIO and SWCLK) at an incredible bandwidth. When you add the RTT library to your code, it creates a couple of ring buffers in memory with a header that can be easily found like 0xF0CACCIA or 0x1234ABCD. What the J-Link Viewer software does, is scan the contents of RAM for that header, then it can just read from and write to the ring buffer structure.
Or read this on Hacker News