<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic IMXRT1166 RTC does not keep its datetime after power cycle in i.MX RT Crossover MCUs</title>
    <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1635936#M24685</link>
    <description>&lt;P&gt;I have imxrt1166 eval board and trying to understand RTC. Although SNVS portion is powered by a seperate LDO regulator, It resets its counter whenever I press reset button. During reset, VDD_SNVS_IN input stays at 3.3V. It works as expected. I observed with oscilloscope.&lt;/P&gt;&lt;P&gt;The counter starts running from the date 2023.12.31 and time 23.58.00 after every reset/power cycle. These values are my initial config values.&lt;/P&gt;&lt;P&gt;I am studying "evkmimxrt1160_snvs_hp_rtc_cm7" example in SDK. How can I fix it and keeps retaining its date/time values in case unexpected crash happens?&lt;/P&gt;&lt;P&gt;P.S : I searched if anyone has encountered similar problem. I saw that one must say to save LPGPR register while GPR_Z_DIS bit enabled. I did it as the following;&lt;/P&gt;&lt;P&gt;status_t SNVS_HP_RTC_SetDatetime(SNVS_Type *base, const snvs_hp_rtc_datetime_t *datetime)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;base-&amp;gt;LPCR |= SNVS_LPCR_GPR_Z_DIS_MASK;&lt;BR /&gt;base-&amp;gt;LPGPR[0] = (uint32_t)(1U);&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Before the entry into the main loop, I added below lines;&lt;/P&gt;&lt;P&gt;rtcDate.year = 2023;&lt;BR /&gt;rtcDate.month = 12;&lt;BR /&gt;rtcDate.day = 31;&lt;BR /&gt;rtcDate.hour = 23;&lt;BR /&gt;rtcDate.minute = 58;&lt;BR /&gt;rtcDate.second = 0;&lt;/P&gt;&lt;P&gt;if ( SNVS-&amp;gt;LPGPR[0] != 1U)&lt;BR /&gt;{&lt;BR /&gt;SNVS_HP_RTC_GetDefaultConfig(&amp;amp;snvsRtcConfig);&lt;BR /&gt;SNVS_HP_RTC_Init(SNVS, &amp;amp;snvsRtcConfig);&lt;BR /&gt;SNVS_HP_RTC_SetDatetime(SNVS, &amp;amp;rtcDate);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;SNVS_HP_RTC_StartTimer(SNVS);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;while (true)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;I can now set the LPGPR register value. But this time when I reset the board, it counts starting from 1970-01-01 00:00:00&lt;/P&gt;&lt;P&gt;Do I have to save current date and time infos to LPGPR registers every time? If yes, when an unpected crash occurs, it will not show the exact time after reset. I need the RTC&amp;nbsp;working similar to in STM32 series.&lt;/P&gt;</description>
    <pubDate>Wed, 19 Apr 2023 11:37:13 GMT</pubDate>
    <dc:creator>burhanhagi</dc:creator>
    <dc:date>2023-04-19T11:37:13Z</dc:date>
    <item>
      <title>IMXRT1166 RTC does not keep its datetime after power cycle</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1635936#M24685</link>
      <description>&lt;P&gt;I have imxrt1166 eval board and trying to understand RTC. Although SNVS portion is powered by a seperate LDO regulator, It resets its counter whenever I press reset button. During reset, VDD_SNVS_IN input stays at 3.3V. It works as expected. I observed with oscilloscope.&lt;/P&gt;&lt;P&gt;The counter starts running from the date 2023.12.31 and time 23.58.00 after every reset/power cycle. These values are my initial config values.&lt;/P&gt;&lt;P&gt;I am studying "evkmimxrt1160_snvs_hp_rtc_cm7" example in SDK. How can I fix it and keeps retaining its date/time values in case unexpected crash happens?&lt;/P&gt;&lt;P&gt;P.S : I searched if anyone has encountered similar problem. I saw that one must say to save LPGPR register while GPR_Z_DIS bit enabled. I did it as the following;&lt;/P&gt;&lt;P&gt;status_t SNVS_HP_RTC_SetDatetime(SNVS_Type *base, const snvs_hp_rtc_datetime_t *datetime)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;base-&amp;gt;LPCR |= SNVS_LPCR_GPR_Z_DIS_MASK;&lt;BR /&gt;base-&amp;gt;LPGPR[0] = (uint32_t)(1U);&lt;/P&gt;&lt;P&gt;.......&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;Before the entry into the main loop, I added below lines;&lt;/P&gt;&lt;P&gt;rtcDate.year = 2023;&lt;BR /&gt;rtcDate.month = 12;&lt;BR /&gt;rtcDate.day = 31;&lt;BR /&gt;rtcDate.hour = 23;&lt;BR /&gt;rtcDate.minute = 58;&lt;BR /&gt;rtcDate.second = 0;&lt;/P&gt;&lt;P&gt;if ( SNVS-&amp;gt;LPGPR[0] != 1U)&lt;BR /&gt;{&lt;BR /&gt;SNVS_HP_RTC_GetDefaultConfig(&amp;amp;snvsRtcConfig);&lt;BR /&gt;SNVS_HP_RTC_Init(SNVS, &amp;amp;snvsRtcConfig);&lt;BR /&gt;SNVS_HP_RTC_SetDatetime(SNVS, &amp;amp;rtcDate);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;SNVS_HP_RTC_StartTimer(SNVS);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;while (true)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;......&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;I can now set the LPGPR register value. But this time when I reset the board, it counts starting from 1970-01-01 00:00:00&lt;/P&gt;&lt;P&gt;Do I have to save current date and time infos to LPGPR registers every time? If yes, when an unpected crash occurs, it will not show the exact time after reset. I need the RTC&amp;nbsp;working similar to in STM32 series.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2023 11:37:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1635936#M24685</guid>
      <dc:creator>burhanhagi</dc:creator>
      <dc:date>2023-04-19T11:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: IMXRT1166 RTC does not keep its datetime after power cycle</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1637642#M24727</link>
      <description>&lt;P&gt;Hello, my name is Pavel, and I will be supporting your case, let me get into your case and when I have more information, I will contact you.&lt;/P&gt;
&lt;P&gt;Best regards,&lt;BR /&gt;Pavel&lt;/P&gt;</description>
      <pubDate>Fri, 21 Apr 2023 03:08:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1637642#M24727</guid>
      <dc:creator>Pavel_Hernandez</dc:creator>
      <dc:date>2023-04-21T03:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: IMXRT1166 RTC does not keep its datetime after power cycle</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1638758#M24769</link>
      <description>&lt;P&gt;&lt;A href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196430" target="_blank" rel="noopener"&gt;@Pavel_Hernandez&lt;/A&gt;, I have also one custom board with imxrt1170. The difference between my custom board with imxrt1170 and imxrt1160 eval board is that imxrt1160-EVK has no capacitors on Y5(RTC 32.768KHz crystal) capacitors on both legs. However in my imxrt1170 custom board, I have&amp;nbsp;RTC 32.768KHz with both capacitors populated. When I reset the board, external RTC crytsal keeps running, but main crystal 24MHz takes reset as expected in my board.&lt;/P&gt;&lt;P&gt;I think the problem is that SDK example uses main external crystal 24MHz for SNVS peripheral. I quick searched but not find. How can I enable OSC32.768Khz RTC crystal and mux SNVS example in SDK to use this RTC clock instead of 24MHz one?&lt;/P&gt;&lt;P&gt;Actually&amp;nbsp;fsl_snvs_hp.c NXP driver file does not include any definition with clock options!? See the below.Not found "SNVS_HP_Clocks" in index.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="burhanh_0-1682326195710.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/220510iDDEB19AD4E72150E/image-size/medium?v=v2&amp;amp;px=400" role="button" title="burhanh_0-1682326195710.png" alt="burhanh_0-1682326195710.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 08:54:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1638758#M24769</guid>
      <dc:creator>burhanhagi</dc:creator>
      <dc:date>2023-04-24T08:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: IMXRT1166 RTC does not keep its datetime after power cycle</title>
      <link>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1638993#M24779</link>
      <description>&lt;P&gt;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/196430"&gt;@Pavel_Hernandez&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.nxp.com/t5/MCUXpresso-SDK/RT1050-keeping-RTC-across-power-cycles/m-p/914748" target="_blank" rel="noopener"&gt;https://community.nxp.com/t5/MCUXpresso-SDK/RT1050-keeping-RTC-across-power-cycles/m-p/914748&lt;/A&gt;&amp;nbsp;link solved my problem. LP one in SDK examples must be followed for internal RTC with battery backup aided. Both eval and my custom boards are keeping time well now.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Apr 2023 06:15:53 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-RT-Crossover-MCUs/IMXRT1166-RTC-does-not-keep-its-datetime-after-power-cycle/m-p/1638993#M24779</guid>
      <dc:creator>burhanhagi</dc:creator>
      <dc:date>2023-04-26T06:15:53Z</dc:date>
    </item>
  </channel>
</rss>

