<?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>Reset RTC time and date showing some strange behaviour</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37140/reset-rtc-time-and-date-showing-some-strange-behaviour</link><description>Dear Nordic 
 I have facing some issues in RTC side. In my application RTC and BLE works same time . First installation and set time using function nrf_cal_set_time() works fine both(RTC and BLE). 
 Again i try to reset the time and date its show strange</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 07 Aug 2018 05:45:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37140/reset-rtc-time-and-date-showing-some-strange-behaviour" /><item><title>RE: Reset RTC time and date showing some strange behaviour</title><link>https://devzone.nordicsemi.com/thread/143121?ContentTypeID=1</link><pubDate>Tue, 07 Aug 2018 05:45:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b09e3ee3-831a-4a07-ac6a-e6cc37d67b7c</guid><dc:creator>Alan Ajit</dc:creator><description>&lt;p&gt;Thank you sigurd for your support hope its work fine not test fully. I will update status soon&lt;/p&gt;
&lt;p&gt;anyway thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset RTC time and date showing some strange behaviour</title><link>https://devzone.nordicsemi.com/thread/142946?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 07:44:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d6874a3-6ee8-407e-8282-ce84098db025</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;&lt;span&gt;If you are setting a completely new and different time, e.g. adjust the new time with several days or years, it seems like the calibration will not work as intended.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Try to remove the calibration offset, and see if that solves your issue. The &lt;/span&gt;nrf_cal_set_time() function will then look like this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void nrf_cal_set_time(uint32_t year, uint32_t month, uint32_t day, uint32_t hour, uint32_t minute, uint32_t second)
{
    static time_t uncal_difftime, difftime, newtime;
    time_struct.tm_year = year - 1900;
    time_struct.tm_mon = month;
    time_struct.tm_mday = day;
    time_struct.tm_hour = hour;
    time_struct.tm_min = minute;
    time_struct.tm_sec = second;   
    newtime = mktime(&amp;amp;time_struct);
    CAL_RTC-&amp;gt;TASKS_CLEAR = 1;  
    
	/* Commented out
	
    // Calculate the calibration offset 
    if(m_last_calibrate_time != 0)
    {
        difftime = newtime - m_last_calibrate_time;
        uncal_difftime = m_time - m_last_calibrate_time;
        m_calibrate_factor = (float)difftime / (float)uncal_difftime;
    }
	
	*/
    
    // Assign the new time to the local time variables
    m_time = m_last_calibrate_time = newtime;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset RTC time and date showing some strange behaviour</title><link>https://devzone.nordicsemi.com/thread/142900?ContentTypeID=1</link><pubDate>Sat, 04 Aug 2018 05:24:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f19dd01-fa12-4b66-b321-8951bc0380f6</guid><dc:creator>Alan Ajit</dc:creator><description>&lt;p&gt;Thank you sigurd for your reply RTC in RTC2&amp;nbsp; its work fine first time but when i reset the time and date its its not working&lt;/p&gt;
&lt;p&gt;my cofiguration&amp;nbsp;&lt;/p&gt;
&lt;p&gt;#define CAL_RTC NRF_&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RTC2&lt;br /&gt;#define CAL_RTC_IRQn&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;RTC2_IRQn&lt;br /&gt;#define CAL_RTC_IRQHandler&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; RTC2_IRQHandler&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;procedure:&lt;/p&gt;
&lt;p&gt;RTC Init and set with time&lt;/p&gt;
&lt;p&gt;BLe Init&lt;/p&gt;
&lt;p&gt;every thing works fine(get time and date properly and BLE works fine)&lt;/p&gt;
&lt;p&gt;when i start to reset the time and date using&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;span&gt;nrf_cal_set_time() its show strange behavior(time changing continuously) . i don&amp;#39;t know what happen to RTC when i try to reset time again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;observation:-&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;i can set time once if i try to reset the time RTC fails&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;can you help me to solve this issue?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Reset RTC time and date showing some strange behaviour</title><link>https://devzone.nordicsemi.com/thread/142850?ContentTypeID=1</link><pubDate>Fri, 03 Aug 2018 13:40:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e30d334d-3b84-4bec-a82a-9d8eba274f31</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Since you are using this with BLE/SoftDevice, please make sure that the&amp;nbsp;calendar uses RTC2. I.e. you need to change these defines &lt;a href="https://github.com/NordicPlayground/nrf5-calendar-example/blob/master/nrf_calendar.h#L21"&gt;here&lt;/a&gt;.(Change to&amp;nbsp;&lt;span&gt;NRF_RTC2,RTC2_IRQn and RTC2_IRQHandler instead&amp;nbsp;&lt;/span&gt;) (SoftDevice uses RTC0, and app_timer uses RTC1).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>