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

right way to log SEGGER RTT output into file

how can I store outputs sent from JLINK SEGGER_RTT to a file?

how can I send data on RTT channel 1, is there any instruction for that?

/** loop */
sprintf (buffer, "%d;%d;%d;%d;%d;%d;%d;%d;%d\n",
            x_raw_acc, y_raw_acc, z_raw_acc,
            x_raw_ger, y_raw_ger, z_raw_ger,
            x_raw_mag, y_raw_mag, z_raw_mag);
SEGGER_RTT_WriteString(0,buffer);
nrf_delay_ms(100);

RTT Logger output

image description

  • @Wojtek I tried your solution and it seems to work, but I miss data (lot of data), not all data are forwarded to puyy, RTT viewer still print some data (data which is missed by putty) and this is a great issue. what kind of configurations should I perform to be sure that all data are forwarded to Putty

  • To be honest, I don't now. But I also find PuTTy a bit slow. I would advise you to try other telnet client

  • I really couldn't log into file, do you open RTT Viewer or RTT logger. when I use RTT Viewer, it print eveytthing on screeen but when I use RTT loger I receive nothing, as you can see in the question above

  • should I use SEGGER_RTT or nrf_log to log into file with jlink?

  • From your code you log using SEGGER_RTT_WriteString(0,buffer);, but in your RTT output window, you have selected index 1. You should select index 0 to use the RTT logger.

1 2 3