LSE clock not starting - STM32F373
Hi!
I have a STM32F373VBT MCU and I have issues with LSE.
First I have selected this crystal.
Because STM32 documention recomended it for my processor.
Also I notice that I need to have high drive for my crystal because it has a 12.5 pF load capacitance.

I enable high drive mode in CubeMX.
Here is the layout where I placed the crystal and its capacitors. Each capacitor is 15 pF.
Here is the problem. I get stuck here in the code. Under the comment Set the new LSE configuration
/*------------------------------ LSE Configuration -------------------------*/
if(((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSE) == RCC_OSCILLATORTYPE_LSE)
{
FlagStatus pwrclkchanged = RESET;
/* Check the parameters */
assert_param(IS_RCC_LSE(RCC_OscInitStruct->LSEState));
/* Update LSE configuration in Backup Domain control register */
/* Requires to enable write access to Backup Domain of necessary */
if(__HAL_RCC_PWR_IS_CLK_DISABLED())
{
__HAL_RCC_PWR_CLK_ENABLE();
pwrclkchanged = SET;
}
if(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP))
{
/* Enable write access to Backup domain */
SET_BIT(PWR->CR, PWR_CR_DBP);
/* Wait for Backup domain Write protection disable */
tickstart = HAL_GetTick();
while(HAL_IS_BIT_CLR(PWR->CR, PWR_CR_DBP))
{
if((HAL_GetTick() - tickstart) > RCC_DBP_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}
}
/* Set the new LSE configuration -----------------------------------------*/
__HAL_RCC_LSE_CONFIG(RCC_OscInitStruct->LSEState);
/* Check the LSE State */
if(RCC_OscInitStruct->LSEState != RCC_LSE_OFF)
{
/* Get Start Tick */
tickstart = HAL_GetTick();
/* Wait till LSE is ready */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) == RESET)
{
if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT; <---------------------------------------------Here .
}
}
}
else
{
/* Get Start Tick */
tickstart = HAL_GetTick();
/* Wait till LSE is disabled */
while(__HAL_RCC_GET_FLAG(RCC_FLAG_LSERDY) != RESET)
{
if((HAL_GetTick() - tickstart ) > RCC_LSE_TIMEOUT_VALUE)
{
return HAL_TIMEOUT;
}
}
}I have tried different type of capacitors:
- 4.7 pF - Did not work
- 15 pF - Did not work
- 22 pF - Did not work
I have also measure the voltage:
Vcc: 0 V
Voltage before LSE (PC15): 1080-1083 mV
Voltage after LSE (PC14): 568-569 mV
VBAT: 3.02 V
Vcc: 3.19 V
Voltage before LSE (PC15: 1252-1253 mV
Voltage after LSE (PC14): 721-722 mV
VBAT: 3.02 VQuestion:
Why does my LSE crystal clock not start in CubeMX? I still get TIME OUT, even if the TIME OUT limit is 10 seconds.
