Why HSE is not getting ready?
Hi guys,
I am using an stm32L552ZE with an NX2016SA-24MHZ-EXS00A-CS10820 oscilattor. Everithing runs as expected until i get to HSERDY waiting. I get a timeout at this part. For startup I am not running a cutom code and the HSE on code is:
SET_BIT(RCC->AHB2ENR,RCC_AHB2ENR_GPIOCEN);
SET_BIT(RCC->AHB2ENR,RCC_AHB2ENR_GPIOHEN);
SET_BIT(RCC->CR, RCC_CR_HSEON);
tickstart = GetTick_ms();
while (READ_BIT(RCC->CR, RCC_CR_HSERDY) == 0U)
{
if ((GetTick_ms() - tickstart) > HSE_TIMEOUT_VALUE)
{
/*This is done to turn on a led when i get a timeout*/
SET_BIT(RCC->AHB2ENR,RCC_AHB2ENR_GPIOEEN);
MODIFY_REG(GPIOE->OTYPER, (0x01<<7), 0x00000000);
MODIFY_REG(GPIOE->PUPDR, (GPIO_PUPDR_PUPD0 << (POSITION_VAL((0x01<<7)) * 2U)), ((0x2UL) << (POSITION_VAL((0x01<<7)) * 2U)));
return 1;
}
}
I have even waited 10 seconds and still the HSE dose not start. What am I missing?!