2158185_en-US

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

2158185_en-US

2158185_en-US

Does the S32K328 internal RTC not support the reboot save time function?

After tracing the source code below, I found that the parameters " counterValue " and " startTime " are zeroed out during initialization; wouldn't the MCU lose time every time it reboots?

Rtc_Ip_GetTimeDate Rtc_Ip_GetTimeDate (uint8 instance instance
Rtc_Ip_TimedateType *Rtc_Ip_TimedateType timeDate timeDate )
{
uint32 counterValue =counterValue 0U uint32 counterValue = 0U
uint32 secondsPassed =uint32 secondsPassed 0U uint32 secondsPassed = 0U

#if RTC_IP_DEV_ERROR_DETECT == STD_ON
DevAssert (NULL_PTR ! = timeDate );
DevAssert (RTC_INSTANCE_COUNT > instance ).
#endif

/* Get the current counter value in ticks */
counterValue = Rtc_Ip_GetCounterRegister ( instance );
/* Compute the number of the seconds passed since setting the time and date */
secondsPassed = Rtc_Ip_TicksToSeconds ( instance counterValue counterValue );
/* Add the start time to the calculated value */
secondsPassed += Rtc_Ip_u32ChState [ instance instance ]. startTime startTime
/* Convert the seconds into time/date format */
Rtc_Ip_ConvertSecondsToTimeDate (& secondsPassed timeDate timeDate ).
}
 
I also tried the following without executing the initialization code after a reboot and found that the RTC time just fails to be obtained
回复: S32K328内部的RTC是不是不支持重启保存时间功能啊

Hi @dujunqiu 

You can refer to the following example code. It may serve as a helpful reference for your implementation.

S32K312: RTC- Preserving RTC counter value from getting resets once after every wakeup

回复: S32K328内部的RTC是不是不支持重启保存时间功能啊if change mode, from standby to run;
the standby mode "counterValue" and "startTime", how to save it?
回复: S32K328内部的RTC是不是不支持重启保存时间功能啊

Hi @dujunqiu 

Please correct me if I misunderstood your question, but the RTC can actually operate in standby mode. You just need to ensure that the SIRC (Slow Internal RC oscillator) is properly configured to remain enabled during standby.

回复: S32K328内部的RTC是不是不支持重启保存时间功能啊

this sample can't deal my question;

chip on RTC can't runing in standby mode, it need by nvm storage time

Re: S32K328内部的RTC是不是不支持重启保存时间功能啊

Hi @dujunqiu 

As indicated in the S32K3xx Reference Manual, Rev. 11, the chip supports RTC operation across functional resets when using the clock sources SIRC or SXOSC.

Additionally, the GPT Standby Wakeup Support ensures that the driver does not clear the interrupt flag, the interrupt enable bit, or disable the counter during initialization.

For further details, please refer to the following threads:

S32k324 Rtc time keep up

S32K324 RTC value not preserved after sleep


BR, VaneB

标记 (1)
无评分
版本历史
最后更新:
‎11-21-2025 07:15 AM
更新人: