<?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>Timestamp problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18707/timestamp-problem</link><description>Hi team, 
 I am using sdk 12.1.0 and ble_app_hrs_c example.I enabled #define NRF_LOG_USES_TIMESTAMP 0 to 1 and iam usng nrf51822 dongle.my program gets hanged.I need to print the timestamp.I am unable to view the data from serial.please tell me what</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Jun 2017 13:06:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18707/timestamp-problem" /><item><title>RE: Timestamp problem</title><link>https://devzone.nordicsemi.com/thread/72242?ContentTypeID=1</link><pubDate>Wed, 07 Jun 2017 13:06:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4266fc02-be72-4623-a588-02beab8b589d</guid><dc:creator>jcormier</dc:creator><description>&lt;p&gt;DavidC, Like Sigurd mentioned. The above snippet tells you all the files you need to change.  It is a snippet from diff, each &amp;quot;--- a/main.c&amp;quot; line tells you what files are being modified.
&lt;a href="https://www.gnu.org/software/diffutils/manual/html_node/Detailed-Unified.html#Detailed-Unified"&gt;www.gnu.org/.../Detailed-Unified.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timestamp problem</title><link>https://devzone.nordicsemi.com/thread/72241?ContentTypeID=1</link><pubDate>Wed, 07 Jun 2017 12:59:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a38d84ba-a493-4207-b3a9-b51970c82962</guid><dc:creator>DavidC</dc:creator><description>&lt;p&gt;Hallo Sigurd,&lt;/p&gt;
&lt;p&gt;When I change the value of NRF_LOG_USES_TIMESTAMP  to 1 in my sdk-config.h, I have problem when i initialize the NRF_LOG_INIT.&lt;/p&gt;
&lt;p&gt;Should i need to change the value in the main code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timestamp problem</title><link>https://devzone.nordicsemi.com/thread/72244?ContentTypeID=1</link><pubDate>Wed, 07 Jun 2017 11:16:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9713bc2d-5aa8-48fc-9df4-6bca8a314842</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi DavidC,&lt;/p&gt;
&lt;p&gt;Q: this modifications that I need to do it in the makefile or in the main code?&lt;/p&gt;
&lt;p&gt;A: If you are using a makefile(you are in fact usign armgcc), you need to apply changes in both main code and in the makefile. All changes needed is covered in the patch snippet above.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timestamp problem</title><link>https://devzone.nordicsemi.com/thread/72243?ContentTypeID=1</link><pubDate>Wed, 07 Jun 2017 09:53:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0aede38d-3e78-4090-ac00-f726cf88fb54</guid><dc:creator>DavidC</dc:creator><description>&lt;p&gt;Hallo, this modifications that I need to do it in the makefile or in the main code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timestamp problem</title><link>https://devzone.nordicsemi.com/thread/72240?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 21:49:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03a413f8-48fa-4c92-81aa-71d0a049cad6</guid><dc:creator>jcormier</dc:creator><description>&lt;p&gt;Note counters.c is setup to count in 10ms intervals.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timestamp problem</title><link>https://devzone.nordicsemi.com/thread/72239?ContentTypeID=1</link><pubDate>Wed, 12 Apr 2017 21:48:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79f01c22-c665-469d-a799-b5329a03c7bc</guid><dc:creator>jcormier</dc:creator><description>&lt;p&gt;A quick and probably dirty way to get timestamps working.&lt;/p&gt;
&lt;p&gt;Copy counters.c and counter.h from examples/ble_central_and_peripheral/experimental/ble_app_att_mtu_throughput/ into your project.&lt;/p&gt;
&lt;p&gt;Then make the following code changes. Assumes using pca10040 and armgcc. But should be similar for other setups.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;--- a/main.c
+++ b/main.c
@@ -45,6 +45,8 @@
 #include &amp;quot;bsp.h&amp;quot;
 #include &amp;quot;bsp_btn_ble.h&amp;quot;
+#include &amp;quot;counter.h&amp;quot;
+
@@ -773,7 +775,12 @@ int main(void)
     uint32_t err_code;
     bool erase_bonds;

-    err_code = NRF_LOG_INIT(NULL);
+#if NRF_LOG_USES_TIMESTAMP==1
+    counter_init();
+    counter_start();
+#endif
+
+    err_code = NRF_LOG_INIT(counter_get);
     APP_ERROR_CHECK(err_code);
--- /pca10040/s132/armgcc/Makefile
+++ /pca10040/s132/armgcc/Makefile
@@ -29,6 +29,7 @@ SRC_FILES += \
   $(SDK_ROOT)/components/drivers_nrf/common/nrf_drv_common.c \
   $(SDK_ROOT)/components/drivers_nrf/gpiote/nrf_drv_gpiote.c \
   $(SDK_ROOT)/components/drivers_nrf/uart/nrf_drv_uart.c \
+  $(SDK_ROOT)/components/drivers_nrf/rtc/nrf_drv_rtc.c \
   $(SDK_ROOT)/components/libraries/bsp/bsp.c \
   $(SDK_ROOT)/components/libraries/bsp/bsp_btn_ble.c \
   $(SDK_ROOT)/components/libraries/bsp/bsp_nfc.c \
@@ -122,6 +123,7 @@ INC_FOLDERS += \
   $(SDK_ROOT)/components/drivers_nrf/timer \
   $(SDK_ROOT)/components/libraries/util \
   $(SDK_ROOT)/components/drivers_nrf/pwm \
+  $(SDK_ROOT)/components/drivers_nrf/rtc \
   ../config \
   $(SDK_ROOT)/components/libraries/usbd/class/cdc \
   $(SDK_ROOT)/components/libraries/csense \

--- a/pca10040/s132/config/sdk_config.h
+++ b/pca10040/s132/config/sdk_config.h
@@ -3658,7 +3658,7 @@
 // &amp;lt;i&amp;gt; Function for getting the timestamp is provided by the user

 #ifndef NRF_LOG_USES_TIMESTAMP
-#define NRF_LOG_USES_TIMESTAMP 0
+#define NRF_LOG_USES_TIMESTAMP 1
 #endif

--- a/pca10040/s132/armgcc/Makefile
+++ b/pca10040/s132/armgcc/Makefile
@@ -36,6 +36,7 @@ SRC_FILES += \
+  $(PROJ_DIR)/counter.c \
   $(SDK_ROOT)/external/segger_rtt/RTT_Syscalls_GCC.c \
   $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT.c \
   $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \

--- a/pca10040/s132/config/sdk_config.h
+++ b/pca10040/s132/config/sdk_config.h
@@ -1835,7 +1835,7 @@


 #ifndef RTC2_ENABLED
-#define RTC2_ENABLED 0
+#define RTC2_ENABLED 1
 #endif
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Timestamp problem</title><link>https://devzone.nordicsemi.com/thread/72238?ContentTypeID=1</link><pubDate>Mon, 02 Jan 2017 14:27:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93e92e31-2274-4f2a-8874-1c0c7791de76</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;With the &lt;code&gt;NRF_LOG_USES_TIMESTAMP&lt;/code&gt; functionality the user can create his own timestamp function. If you have enabled &lt;code&gt;NRF_LOG_USES_TIMESTAMP&lt;/code&gt;, and have not provided the timestamp-function, initialization will fail with error &lt;code&gt;NRF_ERROR_INVALID_PARAM&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note:&lt;/em&gt; Most terminal programs have their own timestamp-functionality you can enable to get timestamps. In e.g. Termite you can enable timestamp in “Settings” -&amp;gt; Plug-ins.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>