STM32L452 LSE not starting
I have an STM32L452 rigged to use an external clock so we can keep the RTC running. Schematic attached.
X2 is a clock from SiTime, programmed to be 32.768kHz. C36 is a supercap acting as battery backup. I used STMCube to generate the startup code to feed into HAL_RCC_OscConfig. When I debug into this function, the LSE never becomes ready (RCC_BDCR_LSERDY bit always zero), and so the code returns HAL_TIMEOUT.
Do I have the correct circuit? Have I set the clock config correctly? It's the same if I run on a Nucleo board.
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI|RCC_OSCILLATORTYPE_LSE;
RCC_OscInitStruct.LSEState = RCC_LSE_ON;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI;
RCC_OscInitStruct.PLL.PLLM = 2;
RCC_OscInitStruct.PLL.PLLN = 36;
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV7;
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV4;
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV4;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
