Showing results for 
Search instead for 
Did you mean: 

Replace RTC Crystal with RTC Oscillator ?

Associate II

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?



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

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