cancel
Showing results for 
Search instead for 
Did you mean: 

RTC not configuring after power loss when using Supercapacitor (STM32L-series).

Sourabh
Visitor

We are facing an issue with the RTC on our STM32L-series microcontroller board. Below are the actions we tried and their outcomes:

Main issue:

  • When the battery is connected to the supercapacitor for the first time, the RTC initializes correctly.

  • But when we simulate a power loss by manually removing the main power and reconnecting it, the RTC clock fails to configure on the second initialization.

Tests performed:

  • Removed the supercapacitor and replaced it with a coin cell and an RPS → the clock still fails to configure.

  • When the system is configured without any backup power source, the system clock initializes and works normally.

  • Referred to this article: https://mischianti.org/stm32-internal-rtc-clock-and-battery-backup-vbat/ and tested the small noise-suppression circuit, but it did not resolve the issue.

  • Tried fully resetting the RCC using:__HAL_RCC_BACKUPRESET_FORCE();
    __HAL_RCC_BACKUPRESET_RELEASE();

  • This allows the clock to reinitialize, but the stored RTC time/date are lost.
  • Please provide any suggestions or guidance to help resolve this issue. I will continue debugging and update this thread with new findings.
1 REPLY 1

The L1 series had a latch-up issue as I recall. Also didn't have an independent VBAT pin.

Might need specific procedures to remove power source and then reconfigure and pull current time/date from host system, say via (S)NTP.

Might also need to look at how power loss is handled / managed, and put into STANDBY, and flagging of power-up mode, standby and tamper type events.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..