Battery Backup for RTC Clock & Registers on STM32 Nucleos

The Nucleo range now seems to be fitted with an LSE crystal for accurate RTC usage. In order to allow the clock to run in power-off state, & additional backup registers to be non-volatile, you must add a coin cell battery.

I salvaged a battery holder for CR2025/2032 cells from an old PC motherboard. It can be mounted conveniently on the underside of the board, pins poking through the slots which separate the ST-Link part from the main board: /media/uploads/gregeric/img_20160330_103620.jpg The -ve side of the battery can be connected to ground at the blue user switch. A solid wire is soldered to the +ve pin and taken back through the slot to the underside of the board. Those wires are sufficient to hold it in place, but the holder could be further fixed with glue if needed.

The +ve wire must be connected to VBAT on the underside: /media/uploads/gregeric/img_20160330_103636.jpg The 0-Ohm resister at SB45 must be removed, and the +3V from the coin cell taken to the right hand pad. (I re-soldered the resistor to the left hand pad in case I needed it in future).

That's all that is required; switching between VBAT & +3V3 is done automatically by the STM32.


4 comments on Battery Backup for RTC Clock & Registers on STM32 Nucleos:

20 Apr 2016

I did this same thing, it works well. Love how the switchover is integrated into the chip so you don't really need anything else. I am curious if anyone has recommendations if additional components are needed for a commercial product. For example adding a schottky diode to protect against accidental reverse battery insertion. Maybe adding a small resistor to limit current in case of a fault. I suppose the ESR of the battery is already quite high.

09 Jul 2016

Hi,

I have a nucleo F401RE and have connected the battery as you explain but the time is not saved on power of. Could you please paste the code that is working? For testing i just used this code https://developer.mbed.org/handbook/Time?action=view&revision=11592 but the time is not saved. Thanks

30 Sep 2018

I have STM32L4, I did the same thing which is explained above and it is working fine. Thank you so much for sharing this article.

04 Dec 2018

I am also working on the nucleol433 board. please help me how backup RTC registers by using 3v powersupply? I am new to the this environment. When I am Implemented above connection ( 3v battery between VABT (SB45) and ground) . I am not able see anything on serialport [ in my code i add sample blink led it is also not working]. i am not understanding where is the problem? I am implementing Calendar and Time Activity on this board which is will work when there is no power supply

Please help me Thanks in Advance

Please log in to post comments.