I've a STM32F407 board, it has a 3.3V battery on VBat, the LSE crystal is a 32.768 kHz.
In halconf.h I enabled RTC, and in mcuconf.h I configured it:
Code: Select all
#define STM32_RTCSEL STM32_RTCSEL_LSE
#define STM32_RTCPRE_VALUE 8
Also in halconf.h I enabled RTC
The RTC works when the power is on, but on power off it doesn't advance, keeping the old values. I've substitute it with other board, and also disconnected both power and Vbat to force a backup domain reset, without success. In hal_lld.c I see that RCC_BDCR has LSEON, LSERDY, RTCSEL is 01 (LSE), and RTCEN