cancel
Showing results for 
Search instead for 
Did you mean: 

RTC not maintaining the date and time as expected

Ematic
Associate II

I am experiencing issues with the VBAT pin on the STM32H753ZI Nucleo board. Specifically, the VBAT pin is not responding properly. I am using a CR2032 CMOS battery for RTC backup, but it is not maintaining the date and time as expected. When the power supply is off, the RTC does not hold and run correctly, but it resumes running once the power supply is restored. battery positive connected to VBAT and negative to GND. i have removed SB52.

Ematic_0-1753077475445.png

 

I have attached the IOC and main file for your reference.

4 REPLIES 4
waclawek.jan
Super User

> When the power supply is off, the RTC does not hold and run correctly, but it resumes running once the power supply is restored.

What does this mean exactly? Does RTC reset to 1.1.2000, revert to some other particular date, or does it continue but the clock is late? How do you observe that?

JW

######
Senior II

Hello,

I think you are using the internal oscillator?

  RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSI;
  RCC_OscInitStruct.HSIState = RCC_HSI_DIV1;
  RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
  RCC_OscInitStruct.LSIState = RCC_LSI_ON;

 

I'm not sure this is part of the battery backed domain? I seem to remember reading that its only the Low Speed External that is part of the battery domain on some micro's. 

Edit: see https://community.st.com/t5/stm32-mcus-products/rtc-and-lsi-in-vbat-operation/td-p/516998

If this is the case, then the clock would only probably advance once main power is on, but keep its value according to the battery backup?

Cheers.

waclawek.jan
Super User

> I think you are using the internal oscillator? [LSI]

> I'm not sure this is part of the battery backed domain?

Good catch. It is not.

JW

######
Senior II

One more thing to add...

in my experience using the LSI is terrible to accurately drive the RTC due to frequency inaccuracy etc. Much better to have a better external oscillator anyway.

Cheers.