2018-01-29 11:12 AM
Hello
I am trying to get RTC but just subsecond is changing
I already actived Alarm Calendar and interrupt and format binary
in main
I defined sTimeStructure as RTC_TimeTypeDef
and in While HAL_RTC_GetTime(&hrtc, &sTimeStructure,RTC_FORMAT_BIN) and HAL_Delay(500)
Watching sTimeStructure just see subsecond changing and keeping fixed value thye seconds, minutes and hour.
The seconds must to increment by 1 but I dont know why its not working
Thank you in advance
2018-01-29 02:30 PM
I dont know if it is a bug or not. I just included HAL_RTC_GetDate(&hrtc, &sDateStructure,RTC_FORMAT_BIN); and know is working fine.
2018-01-31 04:08 AM
Hello
Levinspuhl_Jr.Marcel
,This is not a bug.You have to call
HAL_RTC_GetDate() function to update the time.
This is mentionedin thestm32f0xx_hal_rtc.c file:
'You must call HAL_RTC_GetDate() after HAL_RTC_GetTime() to unlock the values'.Best Regards
Imen.