STM32L and LSE
Posted: Thu Dec 29, 2011 10:50 pm
Guys, I doubt it have anything to do with Chibi but... I have 32khz crystal on PC14/OSC32_IN, PC15/OSC32_OUT that I should activate to drive RTC and some ADC. This is supposed to be LSE and according to docs - should not be working by default. I enable the LSE in mcuconfig, but detect nothing on the pins. The weird thing is that is already activated AND running according to RCC->CSR, pin 8 and 9 are 1 after reset and the init goes through the code in hal_lld without even poking inside the if statement:
I'm 120% sure I'm missing something very obvious, just can't think of it... even replaced the crystal to be sure it is not damaged... any idea?
Code: Select all
#if STM32_LSE_ENABLED
/* LSE activation, have to unlock the register.*/
if ((RCC->CSR & RCC_CSR_LSEON) == 0) {
PWR->CR |= PWR_CR_DBP;
RCC->CSR |= RCC_CSR_LSEON;
PWR->CR &= ~PWR_CR_DBP;
}
while ((RCC->CSR & RCC_CSR_LSERDY) == 0)
; /* Waits until LSE is stable. */
#endif
I'm 120% sure I'm missing something very obvious, just can't think of it... even replaced the crystal to be sure it is not damaged... any idea?