S32K328 RTC FAIL AFTER WAKEUP Hello NXP Team, I have previously developed RTC functionality on the S32K314, and after sleep wake-up it can continue counting time normally. Now I am porting the project to the S32K328. However, while porting the RTC function, I encountered an issue: After wake-up, the date (year/month/day) is reset to the default value 1970/1/1. In addition, the time (hours/minutes/seconds) does not preserve the originally configured value, but instead reflects only the elapsed time counted from the RTC start point. For example, I initialize the RTC to 2026/05/08 05:06:07. After 1 minute of operation, when the MCU wakes up and I read back the RTC time, the date has reverted to 1970/01/01, and the time shows 00:01:00 instead of the expected 05:07:07. This issue did not occur on the S32K314. What could be the possible causes of this problem? Thank you. Re: S32K328 RTC FAIL AFTER WAKEUP Hi Julián, Thanks for your reponse. Regarding clock source, I select SXOSC which same as our project in S32K314. Please see below picture for you ref. Regarding init, I only do rtc_app_init() when WAKEUP_REASON != MCU_WAKEUP_REASON which same as our project in S32K314. Please see below picture for you ref. I believe the counter continues counting during sleep mode, but the date and time are reset. You can refer to my test results below. At the first power-on, after rtc_app_init() is completed, the system starts counting from 2026/05/08, 5 hours, 6 minutes, and 7 seconds. This is transmitted via CAN message 0x521. BYTE 0: Year BYTE 1: Month BYTE 2: Day BYTE 3: Hour BYTE 4: Minute BYTE 5: Second BYTE 7: RESET REASON After waking up from sleep for five minutes, the counter (CNT) continues counting. However, the year, month, day, hour, minute, and second all start counting from 1970/01/01 00:00:00, instead of continuing from the time set during initialization. For 0x263, BYTE 2 to BYTE 5 represent the time extracted using Rtc_Ip_ConvertTimeDateToSeconds(). Please check the differences between the S32K328 and S32K314. Why does the RTC on the S32K328 not retain the previously configured date and time, even though the same settings work correctly on the S32K314? Re: S32K328 RTC FAIL AFTER WAKEUP Hello @Wade0905,
Have you checked RTC clock source? Confirm if SIRC and "Enabled in Standby" options are selected:
Also, keep in mind that RTC counter value will not be reset after wake-up, but it will reset by calling RTC initialization code in main.c. I can see you initialize RTC only after wake-up event. You can try reading reset reason to see if any other type of reset is being issued, and thus, clearing RTC value by mistake.
There is a community post you can refer to: S32K312: RTC- Preserving RTC counter value from getting resets once after every wakeup.
Please compare it to your configuration.
Best regards, Julián
View full article