#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);
}- 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?