This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Is that bad to call RTT functions if there is no SEGGER connected?

Is that bad to call RTT functions if there is no SEGGER connected?

I mean, if there is no RTT viewer connected, what the RTT library does with the message to transmit? Does it put the message in queue? Does it use some RAM? If I forgot to remove this RTT calls in production mode, is that possible that my application crash due to RTT calls?

Here is an example of RTT function I call every seconds for debug purpose :

SEGGER_RTT_SetTerminal(terminal);
SEGGER_RTT_printf(0,"%s %d\n",prefix,number);
Parents
  • The RTT web page says:

    The developer does not have to create a special debug version and the code can stay in place in a release application.

    Since the RTT routines just copy to a special block in memory they can run without the debugger connected. The final application would have slightly worse performance if it's present (a little slower; more code executed so more power consumption; RAM allocated that isn't needed).

    Just to add a little more to Martijn's response: It uses non-blocking by default. The Q&A section on the RTT page (https://www.segger.com/jlink-rtt.html) mentions:

    SEGGER-RTT uses non-blocking mode per default, which means it does not halt program execution if no debugger is present and J-Link is not even connected. The application program will continue to work

Reply
  • The RTT web page says:

    The developer does not have to create a special debug version and the code can stay in place in a release application.

    Since the RTT routines just copy to a special block in memory they can run without the debugger connected. The final application would have slightly worse performance if it's present (a little slower; more code executed so more power consumption; RAM allocated that isn't needed).

    Just to add a little more to Martijn's response: It uses non-blocking by default. The Q&A section on the RTT page (https://www.segger.com/jlink-rtt.html) mentions:

    SEGGER-RTT uses non-blocking mode per default, which means it does not halt program execution if no debugger is present and J-Link is not even connected. The application program will continue to work

Children
Related