<?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 RTC with Nordic and Zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90810/how-to-rtc-with-nordic-and-zephyr</link><description>I am using an NRF52840 custom board with a high quality crystal on the low frequency clock. 
 I see that to configure this I should specify the following in the .conf file: 
 CONFIG_CLOCK_CONTROL_NRF_K32SRC_XTAL =y My question is simply, &amp;quot;What is the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 24 Jul 2023 07:09:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90810/how-to-rtc-with-nordic-and-zephyr" /><item><title>RE: How to RTC with Nordic and Zephyr</title><link>https://devzone.nordicsemi.com/thread/437786?ContentTypeID=1</link><pubDate>Mon, 24 Jul 2023 07:09:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:784712df-2ebb-4517-b6e7-360784d00315</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Dominik&lt;/p&gt;
&lt;p&gt;This case is close to one year old now. Please create a new ticket describing your issue in detail and linking to this one if you find it relevant.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to RTC with Nordic and Zephyr</title><link>https://devzone.nordicsemi.com/thread/437761?ContentTypeID=1</link><pubDate>Sun, 23 Jul 2023 12:54:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aec2a75a-882c-4862-b45d-9d68831cd64f</guid><dc:creator>Domi471</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;I have a custom board containing a module from Raytac with a Nordic nRF52840 microcontroller on it. The board also has a 32768kHz oscillator connected to the module to have a more accurate LFCLK. I am using VSCode with the nRF Connect SDK and the Zephyr RTOS and want to make use of Zephyrs RTC (&lt;a href="https://docs.zephyrproject.org/latest/hardware/peripherals/rtc.html#overview"&gt;https://docs.zephyrproject.org/latest/hardware/peripherals/rtc.html#overview&lt;/a&gt;) using the external oscillator to keep track of time, up to the level of months and years. &lt;br /&gt;&lt;br /&gt;Here (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/100933/how-to-enable-nrf52840-rtc-using-zephyr"&gt;How to enable NRF52840 RTC using Zephyr?&lt;/a&gt; ) you recommend to use the kernel timer, but this is not suitable for the handling of months and years.&lt;/p&gt;
&lt;p&gt;I noticed that RTC0 still should be able to use by the user as its stated here: &amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/53519/zephyr-rtc"&gt;Zephyr &amp;amp; RTC&lt;/a&gt;.&amp;nbsp; So I also want to use the RTC0.&lt;/p&gt;
&lt;p&gt;I also came across &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/90810/how-to-rtc-with-nordic-and-zephyr"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/90810/how-to-rtc-with-nordic-and-zephyr&lt;/a&gt;but it does not tell how to use it.&lt;/p&gt;
&lt;p&gt;Also: I do not know if the describtion of the rtc in the device tree is correct. I simply enabled rtc0 in the device tree , resulting in the device tree node:&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;
&lt;div&gt;&lt;span style="color:#d4d4d4;"&gt;&amp;amp;&lt;/span&gt;&lt;span style="color:#4ec9b0;"&gt;rtc0&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; {&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;status&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;&amp;quot;okay&amp;quot;&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;prescaler&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &lt;/span&gt;&lt;span style="color:#d4d4d4;"&gt;=&lt;/span&gt;&lt;span style="color:#cccccc;"&gt; &amp;lt;&lt;/span&gt;&lt;span style="color:#b5cea8;"&gt;4096&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;&amp;gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span style="color:#9cdcfe;"&gt;wakeup-source&lt;/span&gt;&lt;span style="color:#cccccc;"&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span style="color:#cccccc;"&gt;};&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Is the following define and code line the correct way to access the devicetree node and create a device?&lt;/p&gt;
&lt;div style="background-color:#1f1f1f;color:#cccccc;font-family:Consolas, &amp;#39;Courier New&amp;#39;, monospace;font-size:14px;font-weight:normal;line-height:19px;white-space:pre;"&gt;&lt;span style="color:#6a9955;"&gt;#define &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;RTC_TIMER&lt;/span&gt;&lt;span style="color:#6a9955;"&gt; &lt;/span&gt;&lt;span style="color:#569cd6;"&gt;DT_NODELABEL&lt;/span&gt;&lt;span style="color:#6a9955;"&gt;(rtc0)&lt;/span&gt;&lt;/div&gt;
&lt;p&gt;const struct device *timer_dev = DEVICE_DT_GET(RTC_TIMER);&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Dominik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to RTC with Nordic and Zephyr</title><link>https://devzone.nordicsemi.com/thread/380844?ContentTypeID=1</link><pubDate>Tue, 09 Aug 2022 12:59:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:515a84f9-1090-4a8d-afea-a099d88a57ed</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;1. All of the above (kernel functions, RTC, and counter) use the LF clock as the source here I believe, and can be used for different things depending on what you want to do.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. If your goal is to just see the value of the clock, I would think the&amp;nbsp;&lt;span&gt;&lt;strong&gt;k_uptime_get();&lt;/strong&gt; function is best suited which just lets you get the time of how long the LF clock has been up and running.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. The power consumption between these should be neglectable.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;4. As long as the device is put in a system ON mode, you should be able to let the counter/timer run even in low power mode, both with the RTC and the &lt;strong&gt;k_...&lt;/strong&gt; functions.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;5. The kernel will keep counting as long as you don&amp;#39;t put the device to system OFF or specifically disable the LF clock.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;6. I think only the watchdog timer will be able to effect the timer if it is triggered and restarts the device. The BLE stack can interrupt the functions or take priority over them I guess, but won&amp;#39;t restart it as far as I know.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>