<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27857/right-way-to-log-segger-rtt-output-into-file</link><description>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, &amp;quot;%d;%d;%d;%d;%d;%d;%d;%d;%d\n&amp;quot;,
 x_raw_acc, y_raw_acc, z_raw_acc,
 x_raw_ger,</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 15 May 2018 20:02:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27857/right-way-to-log-segger-rtt-output-into-file" /><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/132142?ContentTypeID=1</link><pubDate>Tue, 15 May 2018 20:02:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9b57c28-ee7c-4582-953a-c3ae22e4d293</guid><dc:creator>Collin</dc:creator><description>&lt;p&gt;Sorry to necro, but for any future readers, I use J-link RTT Viewer and hit F5 (Logging&amp;gt;Start Terminal Logging). It has never lost data, and puts a nice header at the top of the log file. Also, RTT viewer allows you to see ~40 lines of text as it comes through. This seems to be best&amp;nbsp;solution for viewing, logging, and sending commands.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/127354?ContentTypeID=1</link><pubDate>Mon, 09 Apr 2018 08:11:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd2bcbec-3275-48e3-9add-97d623185154</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Calling&amp;nbsp;NRF_LOG_FLUSH() after every line makes no sense, then you might as well &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/nrf_log.html?cp=4_0_1_3_25_0#nrf_log_processing"&gt;turn off deferred logging&lt;/a&gt;. You should consider increasing the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group__nrf__log__config.html#ga22afeab30e44d3279b09d59b4e690891"&gt;buffer size&lt;/a&gt;, and changing the config&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.2.0/group__nrf__log__config.html#gaf74fbd7ab681853e83f9b18029208e8e"&gt;NRF_LOG_ALLOW_OVERFLOW&lt;/a&gt;, to make sure the buffer is not overwritten.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/127262?ContentTypeID=1</link><pubDate>Fri, 06 Apr 2018 16:43:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1216a289-b18d-49df-a237-24597eb8129e</guid><dc:creator>MattFL</dc:creator><description>&lt;p&gt;It seems that if the data comes&amp;nbsp;faster than it can be dumped to the console, then NRF_LOG_INFO() will skip it.&amp;nbsp; The fix for me was the NRF_LOG_FLUSH() after every line.&amp;nbsp; This makes it much slower, but nothing is lost.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109779?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 06:33:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a48d977d-ebac-42a3-9844-63baaf24e2c2</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Just a comment to discussion.&lt;/p&gt;
&lt;p&gt;It is possible to use PuTTY and not loose any data but RTT session must be started by JLink.exe not by JLink Viewer.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109778?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 22:41:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f571aa56-8aa1-4b28-9aa5-b597c94ff43c</guid><dc:creator>pmeilleur</dc:creator><description>&lt;p&gt;I wanted to share the most reliable and efficient method I found, which also allows using the excellent Log Viewer Log4View. Simply create and launch 2 distinct batch files, open Log4view and start debugging!&lt;/p&gt;
&lt;p&gt;The first batch file starts the JLINK Commander that reliably connects (and reconnects) to a target, buffers and make log output available through telnet. Rename as &amp;quot;jlinkcommander.bat&amp;quot; and start it once only;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;REM this is to start JLINK Commander, that collects log stuff and make it available through telnet port 19021
&amp;quot;C:\Program Files (x86)\SEGGER\JLink_V510d\JLink.exe&amp;quot; -device NRF52832_XXAA -if SWD -speed 4000 -autoconnect 1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then the 2nd batch file can be killed and restarted as desired to &amp;quot;cut&amp;quot; the log file, and store the previous log as an archive, which can be usefull for later reference. I called it &amp;quot;jlink_startlog.bat&amp;quot; :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;REM this script renames current log file, if any, to date-time format
REM then move all logs to subfolder archive
REM then starts a telnet receiver to localhost + stores output to a local file
REM this file can then be read through Log4View (file receiver, log format = pattern, %m (dump all directly)
REM Log4View could also be configured to track formatting like  UniversalTime (runtime in ms) log source, etc..
@echo off
echo wscript.echo year(date) ^&amp;amp; &amp;quot;-&amp;quot; ^&amp;amp; right(100+month(date),2) ^&amp;amp; &amp;quot;-&amp;quot; ^&amp;amp; right(100+day(date),2)^&amp;amp; &amp;quot;@&amp;quot; ^&amp;amp; right(100+hour(time),2) ^&amp;amp; &amp;quot;-&amp;quot; ^&amp;amp; right(100+minute(time),2) &amp;gt; &amp;quot;%temp%\dateparts.vbs&amp;quot;
for /f &amp;quot;tokens=1 delims=&amp;quot; %%a in (&amp;#39;cscript //nologo &amp;quot;%temp%\dateparts.vbs&amp;quot;&amp;#39;) do set yyyymmddhhmm=%%a
echo Now you can use this in your filename: %yyyymmddhhmm%
@echo on

if EXIST rtt_debug.log (
REN rtt_debug.log &amp;quot;%yyyymmddhhmm% - rtt_debug.log&amp;quot;
)

move %~dp0\*.log %~dp0\archive

telnet localhost 19021 -f rtt_debug.log
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally I recommend viewing the log output using Log4View. Simply configure a File Receiver, using the pattern %s to output the whole file content. You can also standardize the output format of all your NRF_LOG to feed the uptime in millisecond, the log source, the severity, etc.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;[31761132] RFN0 &amp;gt;&amp;gt; [ForcedRxLoad] ignore (mode_site)
[31761134] RFN0 &amp;gt;&amp;gt; [RxProcessRun] &amp;lt;&amp;lt;&amp;lt; scan &amp;gt;&amp;gt;&amp;gt; FreqBandIsmRxDefaultOverride
[31770625] MODEM&amp;gt;&amp;gt; RX (12)
[31770626] MODEM&amp;gt;&amp;gt; 0000: C3 00 00 06 6B 17 01 00 00 00 7D EE -- -- -- -- 
[31770627] MODEM&amp;gt;&amp;gt; [ATRspProcess] app -&amp;gt; h_OnIpTunnelDataReceived (12)
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109774?ContentTypeID=1</link><pubDate>Tue, 15 Nov 2016 12:22:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d5c36ba5-6b5f-440f-a108-1b42c8cc9160</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;From your code you log using &lt;code&gt;SEGGER_RTT_WriteString(0,buffer);&lt;/code&gt;, but in your RTT output window, you have selected index 1. You should select index 0 to use the RTT logger.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109773?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2016 09:55:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c341af7b-67d2-4787-bcf9-531c9dfc0061</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;should I use &lt;code&gt;SEGGER_RTT&lt;/code&gt; or &lt;code&gt;nrf_log&lt;/code&gt; to log into file with jlink?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109772?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2016 09:38:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ffe7631-dd2f-4ba5-9b15-d1972c5d3538</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;I really couldn&amp;#39;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&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109776?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 14:46:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b97b765a-c51f-4f93-b31e-927761b956f5</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;To be honest, I don&amp;#39;t now. But I also find PuTTy a bit slow. I would advise you to try other telnet client&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109777?ContentTypeID=1</link><pubDate>Tue, 08 Nov 2016 14:38:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32b17cf9-6205-46cf-801c-8c0e9444dc15</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;@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&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109770?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 15:32:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:730aa013-6cfd-4607-9fc5-81c77af1bca8</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;On my Windows 7 system, the log-file was stored in &lt;code&gt;%LOCALAPPDATA%\VirtualStore\Program Files (x86)\SEGGER\JLink_Vxxxx\&lt;/code&gt;. Just search for the name you specified for the file, to locate it. I used &lt;code&gt;SEGGER_RTT_WriteString(0, &amp;quot;Hello World!\n&amp;quot;)&lt;/code&gt;, an this worked well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109771?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 15:11:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f18b85a8-c1e1-44a5-8519-372043587031</guid><dc:creator>makouda</dc:creator><description>&lt;p&gt;I used  &lt;code&gt;SEGGER_RTT_printf(1, &amp;quot;%d \n&amp;quot;, x_raw);&lt;/code&gt; to send data on channel1. but where can I find the output file? I cant find it anywhere on jlink path&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109775?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 14:29:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d82ae6a-2558-40a5-9938-4ee9a4e5ad7d</guid><dc:creator>Wojtek</dc:creator><description>&lt;p&gt;Open RTT viewer, next open PuTTY (or another preffered telnet client), select telnet, localhost:19021, and log as you would normally do in putty.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109769?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 14:26:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:491f1e82-5435-427c-a3e6-1d731576dc31</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;You can use &lt;a href="https://www.segger.com/jlink-rtt.html"&gt;J-Link RTT Logger&lt;/a&gt; to store data from Up-Channel 1 to a file. RTT Logger is part of the &lt;a href="https://www.segger.com/j-link-software.html"&gt;J-Link Software and Documentation Pack&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: right way to log SEGGER RTT output into file</title><link>https://devzone.nordicsemi.com/thread/109768?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 14:04:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63cd34ab-3e40-44be-89c7-a7b304fffca3</guid><dc:creator>Alex</dc:creator><description>&lt;p&gt;One of the options, although a bit expensive, is to buy &lt;a href="https://www.segger.com/jlink-sdk.html"&gt;J-Link SDK&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>