Skip to main content
MAhme.4
Associate II
June 29, 2021
Question

Replace RTC Crystal with RTC Oscillator ?

  • June 29, 2021
  • 1 reply
  • 1161 views

We are working on a custom board based on STM32L476RGT6, and we are facing 32.768Khz crystal startup issue. Board stucks at the startup in following piece of code :

HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)

and it fails while waiting for RCC_LSE_TIMEOUT_VALUE.

So after disabling this crystal, STM32 boots up fine.

We are using same crystal as in the NUCELO-L476RG board.

We need a solution to this problem, as this issue occasionally occurs in the nucelo board as well, which is very alarming. We have a target to ship 1k - 10k units to customer in an year and if we face these kind of issues, it will be impossible to debug these issues.

So my question is can i use a proper oscillator instead of this crystal ? If yes then what should be the specifications for that oscillator?

Thanks

This topic has been closed for replies.

1 reply

Tesla DeLorean
Guru
June 29, 2021

Perhaps you should determine what time is required for the clock to be started properly, and add some margin, so the timeout isn't too short. Check also the drive settings on STM32 that allow you to configure that.

You should evaluate the components and circuitry as built. Crystal circuits are very sensitive, to layout and structure as well as component values, so you'll likely want to read the application notes and design something rather than copy a schematic.

The data sheet should call out the expectations. You could use a TCXO, or whatever, but most people use the crystal due to the low power requirements.

STM32 Crystal Application Note

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

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