Question
Issues with RTC
Posted on August 03, 2012 at 10:43
Hi gents,
We're using a STM32F217IGH6, in a Silica Xynergy board, and we're experiencing some strange issues with the RTC. The code regarding RTC is:static
void
rtcConfiguration(
void
)
{
// Reset power domain : The only possible way of modifying the RTC clock source !!!
PWR_DeInit();
/* Enable PWR clock */
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR, ENABLE);
/* Allow access to RTC */
PWR_BackupAccessCmd(ENABLE);
/* Enable LSE clock */
RCC_LSEConfig(RCC_LSE_ON);
/* Wait till LSE is ready */
while
(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET);
/* Select LSE as RTC Clock Source */
RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);
/* Enable RTC Clock */
RCC_RTCCLKCmd(ENABLE);
/* Wait for RTC registers synchronization */
RTC_WaitForSynchro();
}
But the RTC doesn't behave as it should... sometimes it just doesn't tick, or it starts ticking, and after a few seconds, it stops.
We are working with an external 768kHz quartz, but changing to internal oscillator does not seem to solve the problem.
Do you have any suggestion of what may be happening here?
Thanks a lot!!
#stm32-rtc