<?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>Zephyr RTC build issue.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123875/zephyr-rtc-build-issue</link><description>Greetings, 
 In the process of adding the RTC driver to the project I am encountering a build error when I try to setup a device pointer. The offending line is: 
 const struct device *rtc_ptr = DEVICE_DT_GET(DT_NODELABEL(rtc0)); 
 In prj.conf I have added</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Nov 2025 21:51:18 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123875/zephyr-rtc-build-issue" /><item><title>RE: Zephyr RTC build issue.</title><link>https://devzone.nordicsemi.com/thread/553230?ContentTypeID=1</link><pubDate>Mon, 03 Nov 2025 21:51:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88d240c7-2ed5-46d8-905e-1e58ef09c2a8</guid><dc:creator>Mark P Clark</dc:creator><description>&lt;p style="font-weight:400;"&gt;Greetings,&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Thanks for following up! I have had limited success using the RTC APIs. I created 2 rtc_time structs:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&amp;nbsp;// 2:15:10, August 20, 2025, Wed, 232nd day, DST = unknown, nanosecs = 0 (unknown)&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;struct rtc_time Set_clock_time = {10, 15, 2, 20, 8, 125, 3, 232, -1, 0};&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;struct rtc_time Get_clock_time = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Calling int&amp;nbsp;Set_TM_ret =&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;strong&gt;rtc_set_time&lt;/strong&gt;(rtc_ptr, &amp;amp;Set_clock_time); returns success (0) and appears to start the RTC. I can see the NRF_RTC_Type*&amp;nbsp;regs-&amp;gt;COUNTER value increasing at the 32.768 kHz clock rate.&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Calling int Get_TM_ret =&amp;nbsp;&lt;strong&gt;rtc_get_time&lt;/strong&gt;(rtc_ptr, &amp;amp;Get_clock_time); returns success (0) however the Get_Clock_time struct is not changed - any thoughts on why that might be happening?&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;For our application we would like to set the pre-scaler&amp;nbsp;to 1 mS (value = 32). It seems that I have to stop the RTC to set the pre-scaler&amp;nbsp;-&amp;gt; regs-&amp;gt;TASKS_STOP =&amp;nbsp;RTC_TASKS_STOP_TASKS_STOP_Trigger&amp;nbsp;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;After that I can see the counter advancing at the 1 mS rate. When I do this it appears to cause issues with the radio. The peripheral is advertising OK and connects briefly and then disconnects. I captured a trace using the Bluetooth Low Energy App and it is showing this repeatedly:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;00&amp;gt; [00:06:05.920,959] &amp;lt;wrn&amp;gt; bt_conn: conn 0x20002488 failed to establish. RF noise?&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;00&amp;gt; [00:06:05.921,447] &amp;lt;inf&amp;gt; HnB_NUS_module: Disconnected: 73:36:87:1F:7A:91 (random), reason 0x3e&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Taking out the RTC init the peripheral is able to connect with the central and read device info OK. Any thoughts on how the RTC initialization could be affecting the radio?&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&amp;nbsp;I am using rtc0 for my testing and we don&amp;#39;t have a 32.768 kHz crystal on our PCB so in prj.conf, I am setting:&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y in prj.conf to force RC oscillator for LFCLK.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&amp;nbsp;I appreciate your feedback on these issues with the RTC on the NRF52832.&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Best Regards,&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;&lt;/p&gt;
&lt;p style="font-weight:400;"&gt;Mark&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr RTC build issue.</title><link>https://devzone.nordicsemi.com/thread/552916?ContentTypeID=1</link><pubDate>Thu, 30 Oct 2025 14:11:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6faf9a29-6b7d-4467-989f-4f9d0baab105</guid><dc:creator>Dhivin John</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I wanted to clarify &amp;mdash; were you actually able to use any Zephyr RTC API functions (like rtc_get_time() or rtc_set_time()) with that rtc_ptr, or did the code just compile successfully only?&lt;br /&gt;&lt;br /&gt;Just wanted to confirm if the RTC hardware is functionally working under Zephyr&amp;rsquo;s RTC API, or if it&amp;rsquo;s just a build-time symbol resolution fix.&lt;br /&gt;&lt;br /&gt;Thanks,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr RTC build issue.</title><link>https://devzone.nordicsemi.com/thread/546672?ContentTypeID=1</link><pubDate>Mon, 25 Aug 2025 20:00:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fd6f1cf-4227-4526-9c48-b8faa473d4a2</guid><dc:creator>Mark P Clark</dc:creator><description>&lt;p&gt;Greetings and thanks for the additional input!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Initially I tried changing the&amp;nbsp;nrf52dk_nrf52832.overlay file which gave me the same build error. Revisiting the l3_e2 tutorial; I used the DeviceTree Visual Editor and under SOC I could see that the rtc0/1/2 were not enabled. after enabling rtc0 it updated app.overlay file at the same level as the /src directory. This added:&lt;/p&gt;
&lt;p&gt;&amp;amp;rtc0 {&lt;br /&gt; status = &amp;quot;okay&amp;quot;;&lt;br /&gt;};&lt;/p&gt;
&lt;p&gt;&amp;nbsp;After that I am able to build successfully and setup the device pointer as follows:&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;device&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;rtc_ptr&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;=&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;DEVICE_DT_GET&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;DT_NODELABEL&lt;/span&gt;&lt;span&gt;(rtc0));&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;I would have expected the overlay file in /boards to have the same effect, evidently the app.overlay file takes precedence.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp;Thanks much for your help with this issue!&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;Mark&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr RTC build issue.</title><link>https://devzone.nordicsemi.com/thread/546537?ContentTypeID=1</link><pubDate>Sat, 23 Aug 2025 22:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:caffee8e-5f6b-48a9-bdf2-22506e368119</guid><dc:creator>deiwo</dc:creator><description>&lt;p&gt;I suggest adding this to the overlay instead what you have:&lt;br /&gt;&amp;amp;rtc0 {&lt;br /&gt;&amp;nbsp; &amp;nbsp; status = &amp;quot;okay&amp;quot;;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;And I would not comment out the offending line, it should work if the rtc is enabled properly.&lt;/p&gt;
&lt;p&gt;I recommend reading the tutorial on how to use the devicetree here:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-2-reading-buttons-and-controlling-leds/topic/devicetree/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-2-reading-buttons-and-controlling-leds/topic/devicetree/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;and here is the tutorial for the overlays:&amp;nbsp;&lt;a href="https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-3-elements-of-an-nrf-connect-sdk-application/topic/configuration-files/"&gt;https://academy.nordicsemi.com/courses/nrf-connect-sdk-fundamentals/lessons/lesson-3-elements-of-an-nrf-connect-sdk-application/topic/configuration-files/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;What you should do is similar to what they did in the tutorial for overlays with spi, but in your case it should be rtc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr RTC build issue.</title><link>https://devzone.nordicsemi.com/thread/546509?ContentTypeID=1</link><pubDate>Fri, 22 Aug 2025 19:24:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0184eab8-6428-4496-a9ee-0b001205a3a7</guid><dc:creator>Mark P Clark</dc:creator><description>&lt;p&gt;Greetings and thanks for the input!&lt;/p&gt;
&lt;p&gt;I modified the &lt;strong&gt;nrf52dk_nrf52832.overlay&lt;/strong&gt; file to add this:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;/ {&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; chosen {&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nordic,nrf-rtc = &amp;amp;rtc0;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;};&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In \zephyr\zephyr.dts - RTC is included as follows:&lt;/p&gt;
&lt;p&gt;rtc0: rtc@4000b000 {&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;compatible = &amp;quot;nordic,nrf-rtc&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;reg = &amp;lt; 0x4000b000 0x1000 &amp;gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;cc-num = &amp;lt; 0x3 &amp;gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; interrupts = &amp;lt; 0xb 0x1 &amp;gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; status = &amp;quot;disabled&amp;quot;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; clock-frequency = &amp;lt; 0x8000 &amp;gt;;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; prescaler = &amp;lt; 0x1 &amp;gt;;&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;p&gt;Building with the line offending line commented: //&amp;nbsp;&lt;span&gt;const struct device *rtc_ptr = DEVICE_DT_GET(DT_NODELABEL(rtc0));&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and the .overlay change above results in a similar error:&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;C:/ncs/v2.9.0/zephyr/include/zephyr/device.h:92:41: error: &amp;#39;__device_dts_ord_DT_CHOSEN_nordic_nus_uart_ORD&amp;#39; undeclared here (not in a function)&lt;br /&gt; 92 | #define DEVICE_NAME_GET(dev_id) _CONCAT(__device_, dev_id)&lt;/p&gt;
&lt;p&gt;Perhaps, there is a better way to enable RTC in the board definition?&lt;/p&gt;
&lt;p&gt;Thanks and Best regards,&lt;/p&gt;
&lt;p&gt;Mark&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Zephyr RTC build issue.</title><link>https://devzone.nordicsemi.com/thread/546430?ContentTypeID=1</link><pubDate>Fri, 22 Aug 2025 09:32:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46937255-66f2-4abc-bee2-08339009b374</guid><dc:creator>deiwo</dc:creator><description>&lt;p&gt;Hi, this usually happens when the RTC module is disabled in the board definition. Do you have it enabled?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>