Skip to main content
farouk majdoub
Associate II
Mar 7, 2017 6:09 AM UTC
Solved

STM32F051 RTC Vbat

Posted on March 07, 2017 at 07:09

Hello

i have created my project with STM32 CubeMX and everything works like a charm, But i am stuck with the clock, i want to configure a RTC clock with Vbat pin to keep time running even if VDD power loss, apparently CubeMX configue only RTC, and doesn't configure Vbat pin or the register backup and ST doesn't provide any example for this.

Target MPU : STM32F051R8

I succeeded to get the RTC work with LSE but the time get lost when i remove the main power (VDD),

An example for RTC with register backup (vbat) for STM32F0 will be appreciated.  

Thanks

    This topic has been closed for replies.
    Nesrine M_O
    Nesrine M_OBest answer
    Associate
    Mar 7, 2017 11:06 AM UTC
    Posted on March 07, 2017 at 12:06

    Hi

    majdoub.omar

    ,

    Please refer to RTC example under the STM32F0 firmware package:

    STM32Cube_FW_F0_V1.7.0\Projects\STM32091C_EVAL\Examples\RTC\RTC_Calendar

    -Nesrine-

    3 replies

    Nesrine M_O
    Nesrine M_OBest answer
    Associate
    Mar 7, 2017 11:06 AM UTC
    Posted on March 07, 2017 at 12:06

    Hi

    majdoub.omar

    ,

    Please refer to RTC example under the STM32F0 firmware package:

    STM32Cube_FW_F0_V1.7.0\Projects\STM32091C_EVAL\Examples\RTC\RTC_Calendar

    -Nesrine-

    farouk majdoub
    Associate II
    Mar 7, 2017 2:00 PM UTC
    Posted on March 07, 2017 at 15:00

    Perfect,after a little modification in the code, the clock works like expected.

    Thank you

    ELMHIRI.Syrine

    ,great help !

    Nesrine M_O
    Associate
    Mar 7, 2017 3:35 PM UTC
    Posted on March 07, 2017 at 15:35

    It is good to hear that it was solved.

    If my suggest answers your question, please mark it as correct.