After the MCU is powered off, the 'RTC' stops approximately 3-10 minutes later.

Working libraries, libraries being ported and related hardware
Post Reply
myksj1105
Posts: 96
Joined: Sun Jun 18, 2023 11:35 am
Answers: 2

After the MCU is powered off, the 'RTC' stops approximately 3-10 minutes later.

Post by myksj1105 »

1. RTC library related
#include <STM32RTC.h>
2. Store the time using the RTC library.

Code: Select all

void setup()
{
Serial.begin(115200);
rtc.begin(); // Initialize RTC 24H format
rtc.setClockSource(STM32RTC::LSE_CLOCK);
// Set the time(1time)
// rtc.setHours(hours);
// rtc.setMinutes(minutes);
// rtc.setSeconds(seconds);
// rtc.setWeekDay(weekDay);
// rtc.setDay(day);
// rtc.setMonth(month);
// rtc.setYear(year);

}
3. MCU: STM32F401RCT6
- A 3.2V battery is connected to VBAT.

4.
1) When the MCU is powered, the RTC operates properly.
2) After the MCU is powered off, the 'RTC' stops approximately 3-10 minutes later.
3) Instead of resetting the time value, the time stops.

When using the same circuit, the STM32F1 works fine.
However, the STM32F4 freezes. Please help.




Is there a solution?
Post Reply

Return to “Libraries & Hardware”