I create a RTC backup circuit for a STM32L412CBT6. Circuit work but not as long as I estimate during design.

Here is the schematic (VBKP go directly to STM32 VBAT pin):

Super capacitor RTC circuit
SC1 capacity is 0.33F

enter image description here

Here is my estimation :

Tc = RcxC
Tc = 100 * 0.33
Tc = 33 s
To fully charge the super capacitor at 5xTc I theoretically need 165 s (2 min 45 s)
I do measurement and It's OK, my super capacitor from 0V take about 2 min 30 to go to 3.2V.

To get the Rd, the internal resistance of the VBAT circuit of STM32, I see in datasheet RTC theoretically need 300nA at 3V, but when I take voltage across R17 during discharge I got 5mV, so current is 50µA (166 times more but it's an other problem so let's take 50µA)
Rd=3 / 0.00005
Rd = 60000 ohms (60 kohms)
Td = Rd x C
Td = 60000 x 0.33
Td = 19800 s
To fully discharge the super capacitor at 5xTd I theoretically need 99000 s (27 h 30 min)
To discharge super capacitor at 0.7xTd (50% is about VBAT min for RTC) I theoretically need 13860 s (3 h 51 min)

I do measurement and I'm totally out :

HOUR    SC1 Voltage [V]
22:00   3,21
22:12   2,62
22:22   2,44
22:33   2,29
22:49   2,10
22:59   2,00
23:12   1,86
23:24   1,74
23:34   1,64
23:47   1,52
0:15    1,25
0:24    1,16
0:42    0,99
0:55    0,86
1:26    0,58
1:35    0,51
1:53    0,37
2:34    0,18
2:56    0,14
3:03    0,13

Super capacitor discharge measurement

I take about 5H to discharge the super capacitor (far away from 27H)


  • I think my estimation problem is from Rd (internal VBAT circuit resistance of STM32) determination, but why I'm so far of my estimation ? Can you help me to find my error ?
  • If someone got an idea for why my RTC sink 50µA instead of 300nA, let me known (Voltage measurement device error ?)
  • If someone got an idea to connect (without regulator) the 3V3 of this circuit to a LiPo (3.7V) battery (charge at 4.2V), let me known.

Thanks in advance

EDIT 1 :

  • \$\begingroup\$ I see no big deal here. Somewhere in the drawer I have 20yrs old PLC with a goldcap, external 64kB CMOS RAM and Dallas RTC, when new, it could hold data and time for about two weeks. I can't believe that in yr 2020 you don't have more than few hours autonomy even without the CMOS RAM. \$\endgroup\$ Commented Jul 1, 2020 at 11:20
  • 1
    \$\begingroup\$ Have you seen this: community.st.com/s/question/0D50X00009XkdqpSAB/… \$\endgroup\$ Commented Jul 1, 2020 at 11:37
  • \$\begingroup\$ Well really interesting post about leakage, thank you Marko \$\endgroup\$
    – rom1nux
    Commented Jul 1, 2020 at 11:47

2 Answers 2


You should calculate the discharge time based on the voltage across the capacitor decaying to the minimum value that the RTC can survive on. That voltage might be (for a guess) 1 volt. If your charged voltage is 3 volts then you can say this: -

$$dv = \text{2 volts}$$

You also know the current (50 uA) and using this well-know capacitor formula: -

$$I = C\cdot \dfrac{dv}{dt}$$

You can rearrange for dt: -

$$dt = C\cdot\dfrac{dv}{I} = \text{13,200 seconds or 3 hours and 40 minutes}$$

This is based on a 0.33 F supercapacitor.

If someone got an idea for why my RTC sink 50µA instead of 300nA

It's most probably the DFLS130L-7 schottky diode. Take a look at this graph in the data sheet: -

enter image description here

With power removed, the anode will be at 0 volts and the capacitor diode will be reverse biased at around 1 to 3 volts. At 2.5 volts reverse, you would expect to see 50 uA discharge current flowing in the diode.

Choose a different diode is my advice.

  • \$\begingroup\$ Many thanks Andy for correcting my point of view. Your method is simple and obvious for me now. An other big thanks for the DFLS130L-7 reverse current. It's a big miss, I think I need holiday....You save me a lot of time, your are really kind. \$\endgroup\$
    – rom1nux
    Commented Jul 1, 2020 at 11:35

Just something to think about:

1.) From what I remember the STM32L4 can charge a capacitor directly from the Vbat pin, so you don't really need to charge it from the 3.3V rail over the diode.

2.) If I remember correctly the STM32L4 Vbat pin needs 1.8V, and you are charging your cap up to about 3.1V since you are charging it via diode, so you will be using probably quite a bit less then 50% of the caps capacity.

3.) Supercaps tend to have a very high self-discharge rate, have you considered this aswell?

  • \$\begingroup\$ Thank you Matej for your help and remark. 1] I need to backup a GPS too on this board, and I'm at the limit of the VBAT output current. 2] Yes I know, but when I put the question I don't understand why my estimation is not good (I use "tau" method, with 5x"tau" fully discharge this seemed to me simpler to demonstrate my issue). 3] Good remark, I dont take it in account at all. The datashhet of my supercapacitor dont say anithing about it elna.co.jp/en/capacitor/double_layer/catalog/pdf/ds_e.pdf Many thanks to take time for me. \$\endgroup\$
    – rom1nux
    Commented Jul 1, 2020 at 11:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.