SRTC Running Status

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

SRTC Running Status

724件の閲覧回数
jeffthompson
Contributor V

For the MIMXRT1062, how can I tell whether the SRTC has been started. I want to create a one-time setup and run function that will only initialize the LP SRTC the first time it runs after a product is manufactured. After that, it will be left alone on subsequent reboots. The product can always change the time later, but only when the product gets it from the cloud.

ラベル(1)
タグ(1)
0 件の賞賛
2 返答(返信)

637件の閲覧回数
FelipeGarcia
NXP Employee
NXP Employee

Hello  Jeffery,

 

The only way to know for sure that SRTC has been started is by enabling RTC_EN bit. If you check our SDK drivers you will find SNVS_HP_RTC_StartTimer API that does the following to make sure the RTC was correctly enabled.

/*!
 * @brief Starts the SNVS RTC time counter.
 *
 * @param base SNVS peripheral base address
 */
static inline void SNVS_HP_RTC_StartTimer(SNVS_Type *base)
{
    base->HPCR |= SNVS_HPCR_RTC_EN_MASK;
    while (0U == (base->HPCR & SNVS_HPCR_RTC_EN_MASK))
    {
    }
}‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

Hope it helps!

Best regards,

Felipe

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

0 件の賞賛

637件の閲覧回数
jeffthompson
Contributor V

Thanks, Felipe!

Jeff Thompson | Senior Electrical Engineer-Firmware

+1 704 752 6513 x1394

www.invue.com

0 件の賞賛