cancel
Showing results for 
Search instead for 
Did you mean: 

Why HSE is not getting ready?

CDan.1
Associate II

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?!

1 ACCEPTED SOLUTION

Accepted Solutions
CDan.1
Associate II

Thank you all for your support, after reading the post from TDK I have done a complete hardware verification and I notice that the capacitor I was using were 6.8pF in stead of 6pF. After changing the capacitor everything worked fine.

Thank you again for your answers.

View solution in original post

4 REPLIES 4

Presumably because your clock doesn't oscillate.

For a TCXO type source use BYPASS mode.

Provide a clickable link for clock specifications, easier than trying to Google on a phone.​

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

Could also be a hardware layout issue, or the crystal is not compatible for the STM32. I don't think BYPASS mode is correct here.

https://www.st.com/resource/en/application_note/cd00221665-oscillator-design-guide-for-stm8afals-stm32-mcus-and-mpus-stmicroelectronics.pdf

If you feel a post has answered your question, please click "Accept as Solution".
CDan.1
Associate II

Thank you all for your support, after reading the post from TDK I have done a complete hardware verification and I notice that the capacitor I was using were 6.8pF in stead of 6pF. After changing the capacitor everything worked fine.

Thank you again for your answers.

Capacitors typically have a pretty high tolerance value. I'm very surprised 6pF worked while 6.8pF did not. Regardless, glad you got it fixed.

If you feel a post has answered your question, please click "Accept as Solution".