Skip to content

RTC does not survive power cycle #8628

Closed
@LaurentLouf

Description

@LaurentLouf

Description

Steps to reproduce are pretty easy :

  1. Read time and display it
  2. Set time using the set_time function
  3. Read time and display it
  4. Power cycle the target

On my target, it gives me the following output :

[V] ******* Welcome ! ********
[V] Entering state BOOT
[V] Current time before RTC set : 56997
[V] Current time after RTC set : 1541173796
[V] Exiting previous state
[V] ******* Welcome ! ********
[V] Entering state BOOT
[V] Current time before RTC set : 56997
[V] Current time after RTC set : 1541173796

I have checked the electrical part and everything seems correct : the Vbat pin has a tension around 3V and oscillators are in place. I have been googling and found that it seems to be a known issue. Someone has even created a patch for it here https://os.mbed.com/users/maxxir/code/Nucleo_F103RB_RTC_battery_bkup_pwr_off_o/ but based on pretty old version of mbed (around 1 year ago). I have taken a look at the code and try to figure out what are the important differences between this version and the one in mbed-os repository, but so far haven't found anything. Biggest difference found so far is direct manipulation of registers, but IMHO, that does not seem to be the problem since I can write and read time without problem, it just doesn't survive a power cycle. Any thoughts ?

Issue request type

[ ] Question
[ ] Enhancement
[X] Bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions