Skip to main content
albertr
Associate II
February 25, 2020
Solved

RTC backup 3VDC battery wiring on stm32mp157c-dk2 board?

  • February 25, 2020
  • 4 replies
  • 3268 views

I have seen some stm32mp157 boards from third parties do have a backup 3VDC battery attached to their RTCs, so it won't lose the time when powered off. Is there any way to connect a backup battery to the RTC circuit on the stm32mp157c-dk2 board?

-albertr

This topic has been closed for replies.
Best answer by albertr

Looking at stm32mp157c-dk2 board schematics, I see that there's CN3 connector available, and its pin #1 is connected directly to Vbat.

The stm32mp157 manual says:

The VBAT pin can be connected to the external battery (1.2 V < VBAT < 3.6 V). If no external battery is used, it is mandatory to connect this pin to VDD.

I will try to find a CN3 connector on my board and test it out.

-albertr

4 replies

albertr
albertrAuthorAnswer
Associate II
February 25, 2020

Looking at stm32mp157c-dk2 board schematics, I see that there's CN3 connector available, and its pin #1 is connected directly to Vbat.

The stm32mp157 manual says:

The VBAT pin can be connected to the external battery (1.2 V < VBAT < 3.6 V). If no external battery is used, it is mandatory to connect this pin to VDD.

I will try to find a CN3 connector on my board and test it out.

-albertr

mleo
Visitor II
February 26, 2020

Hi Albertr,

I confirm your statements.

You can find the connector here: https://wiki.st.com/stm32mpu/wiki/MB1272#Battery

Milan

albertr
albertrAuthor
Associate II
February 27, 2020

Hi Milan,

I have connected a 3V coin battery to CN3 connector and now RTC keeps running when external power is disconnected, so it's all good.

Thanks,

--

Albert Rybalkin

PatrickF
Technical Moderator
March 2, 2020

For information, on DK2, CN3 could be used to connect a CR2032 lithium battery, wired on a Molex Picoblade 2 circuits pitch 1.25mm type 51021-0200 (1-VBAT, 2-GND).

Ready made battery with connector are easily available if you search for Thinkpad 02K6541, 02K6572, 02K7075, 02K7087, 08K8050, 92P0986, 92P0991 models or equivalent.

Notice that by default in starter package software, RETRAM and BKPSRAM enabled, which will could drain a small CR2032 200mAh battery in few weeks. With only RTC and BKPSRAM enabled, it could last more than half a year. With only RTC, it could last few years.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent, see here
albertr
albertrAuthor
Associate II
March 4, 2020

Thanks for clarification, @PatrickF​ !

-albertr

albertr
albertrAuthor
Associate II
March 2, 2020

Thank you, @PatrickF​ 

Can you explain what is RETRAM and why do we want to try to preserve its content? Also, how I can disable backing up RETRAM with a battery (should I chose to do so to extend the battery life)?

Also, I've noticed that I'm getting some strange message from u-boot about detecting a 1.5mA power supply, please see below... Could it be related to RTC backup battery?

U-Boot 2018.11-stm32mp-r4 (Mar 01 2020 - 16:43:08 -0500)

CPU: STM32MP157CAC Rev.B

Model: STMicroelectronics STM32MP157C-DK2 Discovery Board

Board: stm32mp1 in basic mode (st,stm32mp157c-dk2)

Board: MB1272 Var2 Rev.C-01

DRAM: 512 MiB

Clocks:

- MPU : 650 MHz

- MCU : 208.878 MHz

- AXI : 266.500 MHz

- PER : 24 MHz

- DDR : 533 MHz

****************************************************

*      WARNING 1.5mA power supply detected       *

*    Current too low, use a 3A power supply!     *

****************************************************

NAND: 0 MiB

MMC:  STM32 SDMMC2: 0, STM32 SDMMC2: 1

Loading Environment from EXT4... OK

-albertr

albertr
albertrAuthor
Associate II
March 2, 2020

Just to clarify, I don't need to put CPU into low power sleep modes in my application. AndI would rather prefer to not keep replacing the RTC backup battery every couple of weeks. Can I disable BKPSRAM and/or RETRAM backup voltage? And if so, how can it be done? Any side effects I need to be aware of? Are there any documentation explaining what BKPSRAM and RETRAM are used for?

-albertr

PatrickF
Technical Moderator
March 3, 2020

RETRAM is usually used to store Cortex-M4 code and could be retained to allow faster M4 wake up after STANDBY (where VDDCORE is removed).

If you don't use STANDBY, no issue to disable RETRAM retention.

BKPSRAM is usally used to store some secrets (e.g. keys) or some secure context (e.g. on wake up from STANDBY)

If you don't use such features, BKPSRAM retention could be disabled.

Retention is controled using RREN abd BREN bit in PWR_CR2. I have to check how this is controlled in SW (likely in device tree)

Note that whenever VDD is present, consumption in VBAT is 0 (as in that case, RETRAM and BKPSRAM are supplied by VDDCORE, and RTC/TAMP are supplied by VDD). See "Power supply overview" in STM32MP15x Reference Manual.

Regarding the 1.5mA message, I think it is a typo in uBoot, it should be 1.5A (detected using CC lines as per USB Type-C standard). This message is Just to highlight that to get full capabilities of DK2 board, you need 3A (only to allow 500mA supply on each USB Type-A connectors). 1.5A is far enough if you don't use much power on USB Type-A connectors.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.Tip of the day: Try Sidekick STM32 AI agent, see here