cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103VC - RTC Issue

jwormsley
Associate III
Posted on May 08, 2012 at 16:24

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,

  Jeff
4 REPLIES 4
alok472
Associate II
Posted on May 09, 2012 at 03:12

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 help

jwormsley
Associate III
Posted on May 10, 2012 at 15:48

> 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.

ColdWeather
Senior
Posted on May 11, 2012 at 16:50

Try to completely remove the load caps at the crystal pins.

Posted on May 11, 2012 at 19:18

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 */

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..