cancel
Showing results for 
Search instead for 
Did you mean: 

stm32l152c-discovery board 32.768KHZ RTC crystal not working

yuqian
Associate
Posted on February 15, 2016 at 07:19

Hi,

I am trying the RTC function on the STM32L152C-discovery board, i have enabled LSE in the CubeMX (i did same for the HSE, it is working good), but i never got the RTC crystal working, i have tried to use scope to watch its wave, but nothing in there. 

does anyone who have such issue for the RTC?

Thanks.

#no-hablo-hal #!stm32-!cubemx-!rtc
3 REPLIES 3
Posted on February 15, 2016 at 12:39

does anyone who have such issue for the RTC?

I don't know, it worked on my L1-DISCO using the SPL.

Sticking a probe directly in the circuit will change the characteristics. Does the status indicate is the LSE started or not? Can you feed the clock to an MCO pin or timer?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
yuqian
Associate
Posted on February 15, 2016 at 13:54

Hi Clive1,

Thanks for your reply.

I tested with my logic analyzer for the 8MHZ, i can watch it and measure it without any problem, does that RTC crystal is that sensitive? 

What is the status can indicate the RTC clock is working, can you point it to me :)

i did not try to route the clock to MCO pin (is it PA08 pin?), will try it

Thank you.

Posted on February 15, 2016 at 16:34

I'm not sure if the RTC clock routes to MCO (PA8) or TAMPER on your part, you'd need to review the Reference Manual.

The SPL initializes and waits for the LSE clock like this

void RTC_Configuration(void)
{

/* Allow access to the RTC */

PWR_RTCAccessCmd(ENABLE);
/* Reset Backup Domain */
RCC_RTCResetCmd(ENABLE);
RCC_RTCResetCmd(DISABLE);
/* LSE Enable */
RCC_LSEConfig(RCC_LSE_ON);
/* Wait till LSE is ready */
while (RCC_GetFlagStatus(RCC_FLAG_LSERDY) == RESET)
{}
RCC_RTCCLKCmd(ENABLE);
/* LCD Clock Source Selection -- Note: RTC clock is used to clock the LCD*/
RCC_RTCCLKConfig(RCC_RTCCLKSource_LSE);
}

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