Skip to main content
Explorer
November 7, 2023
Question

STM32F4 RTC ISSUE WHEN COINCELL [VBAT] IS REMOVED

  • November 7, 2023
  • 5 replies
  • 3541 views

Hi community,

I'm having a STM32F407VET6 PCB board where VBAT is connected to a 10 uF decoupling capacitor [Instead of recommended 100 nF capacitor].
in order to achieve some backup time when both the coin cell and 3.3V are not connected.

My RTC is working fine when a coin-cell or 3.3V supply is available in VBAT. But when I remove the coin cell while performing a power cycle, I'm facing some issues, as listed below.

[Note: RTC is initialized properly with the time 2023-11-07T08:31:20Z [YYYY-MM-DDTHH:MM:SSZ]]

[Note: Coin cell is removed from the board]

 

CasePower cycle durationVoltage level in VBAT Decoupling CapacitorResult Observation

1

7 Seconds3.16V to 0.86VWorking fineRTC Accumulated entire power cycle duration properly
28 Seconds3.15V to 0.77VRTC Init failed - goes to error handler modeRTC Accumulated entire power cycle duration properly
330 Seconds3.16V to 0.46VRTC Init failed - goes to error handler modeRTC Accumulated only first 12 Seconds of the power cycle
45 minutes3.16V to 0.15VRTC Init failed - goes to error handler modeRTC Accumulated only first 12 Seconds of the power cycle
56 minutes3.16V to 0.10VRTC de-initializedRTC de-initialized doesn't goes to error handler mode


The issue is RTC is working fine till 7 seconds with the backup of decoupling capacitor, after that it goes to error handler mode but still accumulating time for first 12 seconds of power cycle [8 Seconds to 5 minutes].

After 6 minutes it de-initialized RTC and doesn't goes to error handler mode. I wanted to de-initialize RTC after the RTC accumulates the first 12 seconds of power cycle in order to avoid error handler mode.

Anyone please explain does the decoupling capacitor affects this behavior in hardware perspective or should I need to use any register to tackle this issue in software perspective.

    This topic has been closed for replies.

    5 replies

    Graduate II
    November 7, 2023

    10 µF just isn't a real battery, as you can see from your own tests.

    Try at least 100 µF (6V3) if you want to keep standard caps, otherwise try a supercap.

    DhanooshAuthor
    Explorer
    November 7, 2023

    Hi LCE,

    Thanks for the response. I also wanted to know why the RTC goes to error handler mode after a particular power cycle duration [7 seconds]. Does increasing the capacitance fix the error handling issue?

    Graduate II
    November 7, 2023

    I don't know. What does the datasheet say about the minimum required voltage? 0.86 V is quite low.

    DhanooshAuthor
    Explorer
    November 7, 2023

    The datasheet describes the voltage level in Vbat as ranging from 1.65 to 3.6 volts. Let me change the capacitor as suggested and update the findings.

    Super User
    November 7, 2023

    You are probably hitting VBAT brownout, ie. incomplete/faulty reset.

    Software ends up in error handler probably due to bug in software, which does not anticipate this state. If you are using Cube or similar "library", you may want to avoid it and write your own.

    JW

    DhanooshAuthor
    Explorer
    November 7, 2023

    Gotcha, Thanks Evangelist!

    Graduate II
    November 7, 2023

    Vbat as ranging from 1.65 to 3.6 V

    Well, looks like 0.86 V is much too low.

    I guess even the 100 µF will not be enough for more than a few seconds.

    Super User
    December 9, 2023

    This is probably just a consequence, and you need to devise a check for the brownout and reset backup domain explicitly before attempting to set anything in it, including LSE clock.

    I don't use Cube/HAL, and I don't use a capacitor on VBAT, so don't have personal experience with this particular issue.

    JW