2012-05-08 07:24 AM
I'm bringing up a new board using the STM32F103VC, and I cannot get the RTC to function properly. In the RTC initialization code, it always stops in the while loop waiting for the RCC_GetFlagStatus(RCC_FLAG_LSERDY) to go from RESET to SET. Looking at the crystal with a scope, instead of the 32.768 kHz I see on the STM3210E_EVAL board, I see a steady 3.3V on one side. Thinking perhaps I had the wrong type crystal, I swapped the one from my board with the eval board, and the eval board still works and my board still does not. I copied the circuit directly from the eval board schematic, so I have the same 10pF caps and 0 ohm resistors as used there.
Any ideas what could be wrong? Anyone seen anything similar bringing up their own boards? Thanks, Jeff2012-05-08 06:12 PM
i havnt used it but just a pointer... Did you enable the LSE ? Ref.. RCC_LSEConfig() in Std Periph lib.
What is the bypass Capa needed by yr XTAL ? Did you check it's in 10pF range ? Maybe removing these capacitor and trying agaian can help2012-05-10 06:48 AM
> i havnt used it but just a pointer... Did you enable the LSE ? Ref.. RCC_LSEConfig() in Std Periph lib.
Yes, the same code runs properly on the STM3210E eval board. > What is the bypass Capa needed by yr XTAL ? Did you check it's in 10pF range ? Yes, they are both 10pF. > Maybe removing these capacitor and trying agaian can help I can give this a try, but if it does make a difference I'll be at a loss as to why. Jeff.2012-05-11 07:50 AM
Try to completely remove the load caps at the crystal pins.
2012-05-11 10:18 AM
RCC_APB1PeriphClockCmd(RCC_APB1Periph_PWR | RCC_APB1Periph_BKP, ENABLE); /* Enable PWR and BKP clocks */
PWR_BackupAccessCmd(ENABLE); /* Allow access to BKP Domain */
RCC_LSEConfig(RCC_LSE_ON); /* Enable LSE */
while(RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET); /* Wait till LSE is ready */
RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE); /* Select LSE as RTC Clock Source */