cancel
Showing results for 
Search instead for 
Did you mean: 

RTC isn't updating time in free running mode

Rushali
Associate III

Hi All,

I am facing problem with RTC in STM32.i have written function in my code where i am updating display function for time every 1 min. But whenever i am trying to  see the updated time in free running mode i am unable to see that. But it works fine in debugging mode or at power on or when i program microcontroller.

Please suggest what can be done to resolve this issue? Thanking you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

from HAL lib:

@note You must call HAL_RTC_GetDate() after HAL_RTC_GetTime() to unlock the values

-- but call date first.... 🙂

+

on which cpu ?  (Maybe problem with cache...?)

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

8 REPLIES 8
Sarra.S
ST Employee

Hello @Rushali

This seems to be related to the shadow registers update, to be sure, you can enable the bypass shadow (RTC_CR_BYPADHAD) in your main function, to see if the issue is fixed.

Also, please specify the stm32 product you are using! 

Thank you!

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Dear @Sarra.S 

I have checked with 

HAL_RTCEx_EnableBypassShadow(&hrtc1); by using this command still not able to see the updated time on screen

Rushali
Associate III

Dear All,

Can anybody help me with above problem????????.............

Hello @Rushali, sorry for the delayed answer 

>>But whenever i am trying to  see the updated time in free running mode i am unable to see that.

Can please elaborate more on your problem so we can help you! 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Rushali
Associate III

I have attached file along with this post for you to get a better idea about the code .

Rushali
Associate III

Dear @Sarra.S 

I have attached file along with this post for you to get a better idea about the code .

Hi,

from HAL lib:

@note You must call HAL_RTC_GetDate() after HAL_RTC_GetTime() to unlock the values

-- but call date first.... 🙂

+

on which cpu ?  (Maybe problem with cache...?)

If you feel a post has answered your question, please click "Accept as Solution".
Rushali
Associate III

hey hii @AScha.3 

It works fine after calling rtc_get_time first and rtc_get_date later. Thank you.