<?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>How to add timestamp in RTT viewer using NRF log module</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/23662/how-to-add-timestamp-in-rtt-viewer-using-nrf-log-module</link><description>Currently developing on NRF52 sdk12 with a terminal 
 In my source code i have nrf_log_init(null), and this allows me to print stuff to the RTT viewer. 
 Now I want to be able to show time stamp minutes:seconds:miliseconds on my RTT viewer, when I print</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 25 Jul 2023 14:50:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/23662/how-to-add-timestamp-in-rtt-viewer-using-nrf-log-module" /><item><title>RE: How to add timestamp in RTT viewer using NRF log module</title><link>https://devzone.nordicsemi.com/thread/438111?ContentTypeID=1</link><pubDate>Tue, 25 Jul 2023 14:50:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbe822da-06b7-4434-a616-d2e25063d5eb</guid><dc:creator>FK42</dc:creator><description>&lt;p&gt;Adding this in case anyone else runs in the same issue I had when implementing this:&lt;/p&gt;
&lt;p&gt;I had the issue that the timestamps wouldn&amp;#39;t increment/ increase after a while.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To fix it, I enabled everything related to the RTC1 counter in sdk_config.h. After which I set the RTC_default_config_frequency to a lower value.&lt;/p&gt;
&lt;p&gt;I guess it has to do with the counter reaching the maximum value.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add timestamp in RTT viewer using NRF log module</title><link>https://devzone.nordicsemi.com/thread/403132?ContentTypeID=1</link><pubDate>Wed, 04 Jan 2023 10:07:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79bccd05-a80a-4352-871e-9ed1cc906e4e</guid><dc:creator>Varun</dc:creator><description>&lt;p&gt;can we trust this timestamp for debugging?&amp;nbsp;&lt;span&gt;curious to know...&lt;br /&gt;thank you&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add timestamp in RTT viewer using NRF log module</title><link>https://devzone.nordicsemi.com/thread/306416?ContentTypeID=1</link><pubDate>Thu, 22 Apr 2021 16:37:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcd34338-1dcc-4514-8b2c-31346ad16de1</guid><dc:creator>N Ashelman</dc:creator><description>&lt;p&gt;Note:&lt;/p&gt;
&lt;p&gt;You will probably also need to change another line in sdk_config.h (line 3 in this excerpt):&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// &amp;lt;o&amp;gt; NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY - Default frequency of the timestamp (in Hz) or 0 to use app_timer frequency. 
#ifndef NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY
#define NRF_LOG_TIMESTAMP_DEFAULT_FREQUENCY 0
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The number 0 should be changed to the correct frequency.&lt;/p&gt;
&lt;p&gt;For example, my code was using LFCLK with PRESCALER = 1.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Per &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.nrf52832.ps.v1.1%2Frtc.html&amp;amp;cp=4_2_0_24_1&amp;amp;anchor=concept_iwc_1mj_sr"&gt;here&lt;/a&gt;, the counter increment frequency is&amp;nbsp;32768 / (PRESCALER + 1 ), so I set the number to 0x8000 / (1+1) = 0x4000&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add timestamp in RTT viewer using NRF log module</title><link>https://devzone.nordicsemi.com/thread/256083?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2020 06:15:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f8c0e4f-70bd-474b-80d1-c2fe2cc5a213</guid><dc:creator>Srinivas V</dc:creator><description>&lt;p&gt;Hi Team,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What is the resolution of this time stamp, like&amp;nbsp;&lt;span&gt;[00:00:30.905,548] , like&amp;nbsp; [ H&lt;strong&gt;r:Min:Sec:Msec ].&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;Regards,&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;strong&gt;Srinivas.V&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add timestamp in RTT viewer using NRF log module</title><link>https://devzone.nordicsemi.com/thread/181960?ContentTypeID=1</link><pubDate>Sun, 14 Apr 2019 12:09:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b92f2c9c-687b-41ad-aa98-53642f9ff836</guid><dc:creator>kobyfr</dc:creator><description>&lt;p&gt;terminal time stamp added by windows will not suffice in some cases, since windows threading granularity will not allow a finer resolutio as fine as 1 msec, but rather a resolution only as low as 10-15 msec. This will group several log lines to have the same time-tag, even though they were sent&amp;nbsp;several msec apart.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add timestamp in RTT viewer using NRF log module</title><link>https://devzone.nordicsemi.com/thread/181959?ContentTypeID=1</link><pubDate>Sun, 14 Apr 2019 12:06:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0441f26-14c9-4de9-8e98-edbef1df4e64</guid><dc:creator>kobyfr</dc:creator><description>&lt;p&gt;This will achieve adding time-stamps to NRF logs, in some of the nRF example applications.&lt;/p&gt;
&lt;p&gt;1. Add this to main .c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t get_rtc_counter(void)
{
    return NRF_RTC1-&amp;gt;COUNTER;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;2. Change this in main.c&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t err_code = NRF_LOG_INIT();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t err_code = NRF_LOG_INIT(get_rtc_counter);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;3. Change sdk_config.h&lt;/p&gt;
&lt;p&gt;from this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define NRF_LOG_USES_TIMESTAMP 0&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to this&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define NRF_LOG_USES_TIMESTAMP 1&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The result will be to change logs from this:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;&amp;lt;info&amp;gt; app: Setting vector table to bootloader: 0x000F1000&lt;br /&gt;&amp;lt;info&amp;gt; app: Setting vector table to main app: 0x00026000&lt;br /&gt;&lt;/span&gt;&amp;lt;info&amp;gt; app: Buttonless DFU Application started.&lt;br /&gt;&amp;lt;info&amp;gt; app: RTC 8211&lt;br /&gt;&amp;lt;info&amp;gt; app: Received indication state 1&lt;br /&gt;&amp;lt;info&amp;gt; app: Received indication state 0&lt;/p&gt;
&lt;p&gt;to this:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;&lt;/span&gt;&lt;br /&gt;[00:00:00.000,000] &amp;lt;info&amp;gt; app: Setting vector table to bootloader: 0x000F1000&lt;br /&gt;[00:00:00.000,000] &amp;lt;info&amp;gt; app: Setting vector table to main app: 0x00026000&lt;br /&gt;[00:00:00.440,002] &amp;lt;info&amp;gt; app: Buttonless DFU Application started.&lt;br /&gt;[00:00:00.440,032] &amp;lt;info&amp;gt; app: RTC 14419&lt;br /&gt;[00:00:22.580,566] &amp;lt;info&amp;gt; app: Received indication state 1&lt;br /&gt;[00:00:30.905,548] &amp;lt;info&amp;gt; app: Received indication state 0&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to add timestamp in RTT viewer using NRF log module</title><link>https://devzone.nordicsemi.com/thread/93019?ContentTypeID=1</link><pubDate>Fri, 21 Jul 2017 11:29:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e7320b1-50ad-41dd-a3d0-a82262cc6bc9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Fordy,&lt;/p&gt;
&lt;p&gt;We need to clarify what kind of timestamp you are looking for here.&lt;/p&gt;
&lt;p&gt;Note that on the chip, there is no date time minute second etc. The chip doesn&amp;#39;t know that. If you want to use timestamp_func, you need count your own time with a 32bit counter.&lt;/p&gt;
&lt;p&gt;If you want hour:minute:second in real normal time, then you need to do that on a PC. You record the timestamp when the log arrive. You can use telnet to do that as shown &lt;a href="https://devzone.nordicsemi.com/question/39846/segger-rtt-how-to-increase-maximun-line-count/"&gt;here&lt;/a&gt; and &lt;a href="http://forum.segger.com/index.php?page=Thread&amp;amp;threadID=2228"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>