2023-08-26 10:22 AM
I use:
STM32Cube_FW_F4_V1.27.1
and CubeMx 6.9.0
I have a problem with the function HAL_RTCEx_GetTimeStamp(&hrtc, &RtcTimeTimeStamp, &RtcDateTimeStamp,RTC_FORMAT_BIN); it always returns the value 0 for the year, the other values are correct.
In the function I find:
/* Fill the Date structure fields with the read parameters */
sTimeStampDate->Year = 0U;
sTimeStampDate->Month = (uint8_t)((tmpdate & (RTC_TSDR_MT | RTC_TSDR_MU)) >> RTC_TSDR_MU_Pos);
Solved! Go to Solution.
2023-08-26 11:31 AM
The HAL_RTCEx_GetTimeStamp function reads the TSDR register as part of the time stamp feature. The TSDR register doesn't have a field for the year.
This is different functionality than simply reading the date, which you can do with HAL_RTC_GetDate.
2023-08-26 11:31 AM
The HAL_RTCEx_GetTimeStamp function reads the TSDR register as part of the time stamp feature. The TSDR register doesn't have a field for the year.
This is different functionality than simply reading the date, which you can do with HAL_RTC_GetDate.
2023-08-26 12:42 PM
THANKS