cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103 RTC + VBAT date resets after power off

rokko
Associate II
Posted on February 28, 2017 at 12:35

Im using STM32F103C8T6 and have issues with RTC and VBAT. Project generated in CubeMX 4.19.0 for Keil, I commented date and time setup in MX_RTC_Init() and time restores fine after reset/power off, but date becomes 1-1-2000, how can I restore date?

#date #rtc #vbat
13 REPLIES 13
Andreas Fecht
Associate II
Posted on July 27, 2017 at 18:44

Hello,

sorry this was a missunderstanding.

I don't want to built my own calender, I must use the HAL functions.

With the STM32F303 it works fine with HAL.

In my case this type is cheaper than the STM32F103, so the decision was easy.

But whats about this comment in the examples at the cube library?

@note On STM32F1 families, as there are restrictions on the RTC version V1, date

      will be lost in all the cases.

Best regards

Andreas

Posted on July 27, 2017 at 19:08

 ,

 ,

Hi!

this comment is true.

Inside the stm32f1xx_hal_rtc.c Line 55 is writen ' ♯ ♯ ♯ ♯ ♯ WARNING: Drivers Restrictions , ♯ ♯ ♯ ♯ ♯ '

It concerns the 'software aproach' operation of rtc, not the hardware.

There is no any hardware issue in errata sheet about this

Best Regards!

vf

Mohammad A
Senior
Posted on October 26, 2017 at 23:13

Maybe too late for you, but may be useful for googlers

https://community.st.com/0D50X00009XkW1nSAF

Posted on November 24, 2017 at 22:18

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6tD&d=%2Fa%2F0X0000000bxP%2FPGCh_8QlpMkCk5KMRTnQhfp_b9pgbFuLWBSGOfzBltE&asPdf=false