Skip to main content
FGava.1
Associate
August 1, 2022
Question

STM32WB55 - How to use RTC under backup battery.

  • August 1, 2022
  • 6 replies
  • 4199 views

I work around a project based on STM32WB55.

In this project it is necessary to keep a clock / calendar when the card is off.

We usually use external real time clock / calendar such as PCF85063A.

I work with the core board and try to use the WB55 RTC, with the VBat pin connected to an supercap cell,

The VBat is enabled with 1.5K resistor and load correctly the supercap.

If i do an software reset is all ok.

When take out the power and restart it, the VBAT pin stay to 3V for long time, but my RTC will go back to 0 to all register calendar and time.

You can help me?

Thank you

This topic has been closed for replies.

6 replies

MM..1
Super User
August 1, 2022

Part of AN5071

To retain both the content of the Backup registers and supply the RTC function when VDD is turned off, the VBAT pin must be connected to an optional backup voltage supplied by a battery or by another source: VBAT must be between 1.55 to 3.6 V VBAT is the power supply for the RTC, the external clock 32 kHz LSE oscillator and the backup registers (through power switch) when VDD is not present. When VDD is present these peripherals (RTC, LSE) are automatically supplied by VDD, and it is then possible to charge the external battery on VBAT through an internal resistance. 

FGava.1
FGava.1Author
Associate
August 1, 2022

it is exactly what I expect!

Thanks for the info. Now I read the document and try again ...

MM..1
Super User
August 1, 2022

Simply your LSE must continue working from battery, and in code you need activate backup registers (through power switch)

Examples \Users\YUO\STM32Cube\Repository\STM32Cube_FW_WB_V1.12.1\Projects\P-NUCLEO-WB55.Nucleo\

waclawek.jan
Super User
August 1, 2022

Isn't it your code (including any Cube stuff you're calling) which resets the RTC?

Check RTC registers' content in debugger at the start of main(), before calling any Cube function.

JW

FGava.1
FGava.1Author
Associate
August 1, 2022

Unfortunately no!

I need the updated date and clock time after an (long) period without power supply.

Normally we use an external RTC chip with button-cell battery, connected via I2C.

In this case we have to save on costs and space.

I try to check register at the first step in main().

Tankyou for your help