I'm trying to debug embedded software using the method described here https://devzone.nordicsemi.com/question/83524/how-to-use-rtt-viewer-or-similar-on-gnulinux/
What the debugger does is setup a localhost server that provides all the printf like messages from the embedded device under test. Essentially I get the debug output when using the command telnet localhost 19021
What I would like is to print one, the system time and two, the time elapsed from the previous message along with the debug message received. This will help me know the exact time in debug messages in milliseconds (or even microseconds?). How can I easily do this? Thanks.
With Python the data from a server can be received using
socket
. The following snippet does the job of receiving the data from the socket and print the time it was received.For the specific case of the debugging the embedded application based on nRF5 SoCs like the link in the question, the complete script can be found here https://github.com/Appiko/nrf5x-firmware/blob/master/utils/rtt_logger.py