2017-08-28 04:22 AM
Solved! Go to Solution.
2017-08-30 05:37 AM
get the time, then get the date, too. does the behavior change?
2017-08-28 04:38 AM
what happens when you get the time, then get the date?
RTC_TimeTypeDef RTC_Time;
RTC_DateTypeDef RTC_Date;
HAL_RTC_GetTime(&hrtc,&RTC_Time,RTC_FORMAT_BCD);
HAL_RTC_GetDate(&hrtc, &RTC_Date, RTC_FORMAT_BCD);�?�?�?�?�?
2017-08-29 12:13 AM
Please explain I didn't get what you mean to say.
2017-08-29 07:51 AM
Hi,
Some boards comes with no X2 crystal, did you check yours? if it don't have, you must to change the rtc reference to the LSI RC or solder one crystal.
2017-08-30 12:24 AM
I have tried that option also.I have given clock to RTC by LSI even though the problem is same.
2017-08-30 04:08 AM
From the documentation:
You must call HAL_RTC_GetDate() after HAL_RTC_GetTime() to unlock the values in the higher-order calendar shadow registers to ensure consistency between the time and date values.
Reading RTC current time locks the values in calendar shadow registers until Current date is read to ensure consistency between the time and date values.As
doe.john.016
already suggested, any time you are reading the time you should also read the date.2017-08-30 05:37 AM
get the time, then get the date, too. does the behavior change?
2017-08-30 06:54 AM
Thanks It worked and solved my problem.