2020-02-25 09:00 AM
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
Solved! Go to Solution.
2020-02-25 09:13 AM
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
2020-02-25 09:13 AM
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
2020-02-26 06:40 AM
Hi Albertr,
I confirm your statements.
You can find the connector here: https://wiki.st.com/stm32mpu/wiki/MB1272#Battery
Milan
2020-02-26 05:43 PM
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
2020-03-02 12:52 AM
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.
2020-03-02 07:42 AM
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
2020-03-02 12:17 PM
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
2020-03-03 12:04 AM
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.
2020-03-03 06:06 AM
Thanks again, @PatrickF ! Let me know how to disable this retention (for both RETRAM and BKPSRAM).
I'm using a Dell Laptop 45W power adapter, it should be capable of producing much more than 1.5A. I'll try a different power adapter to see if it's adapter related.
-albertr
2020-03-03 07:05 AM
If your adapter is able to provide enough power @5V (should be mentioned on it), you could simply ignore the message (45W is likely at 15V/3A, but reach only with USB PowerDelivery management, which we don't need and not support for DK2 board).
We have seen that there is still many Type-C supplies which are not always fully compliant on some aspects of the standard (some cheap supplies are even completely not compliant).
You could refer to section 5 of TA0357 for an overview of CC lines we use to detect power adapter characteristics per USB standard.