cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo64 STM32F030R8

Posted on January 29, 2018 at 20:12

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

2 REPLIES 2
Posted on January 29, 2018 at 23:30

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.

Imen.D
ST Employee
Posted on January 31, 2018 at 13:08

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.

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen