Skip to main content
User1655833706281357277
Associate III
November 9, 2022
Solved

Examples in the STM32CubeWB repository set LSE_TIMEOUT_VALUE to five seconds after calling LL_RCC_LSE_Enable(). Why so long? Is this addressed anywhere in any of the hardware documentation?

  • November 9, 2022
  • 7 replies
  • 1711 views

..

This topic has been closed for replies.
Best answer by Bob S

Sheesh. OK, I'll spell it out in more detail. Presuming the STM32WB data sheet specs the LSE startup time the same as the F429, they give only a "typical" startup time at some nominal voltage and temperature. Because "actual" startup time depends on factors that ST has no control over - crystal, caps, PCB routing, voltage, temperature, ambient moisture(!), etc. The 5 second delay in the HAL code is probably a SWAG (simple? wild *** guess) as to what might be "more then enough" time for the oscillator to start under MOST circumstances. It may be possible to design a board and select components where 5 seconds is not sufficient.

7 replies

Bob S
Super User
November 9, 2022

Don't know about the WB series chips, but the F429 data sheet specs LSE startup time at 2 seconds typical (search your data sheet for "LSE oscillator characteristics"), with no "max" given, since that depends on external caps and xtal. The LSE is a very low power oscillator and can take a (relative to the HSI clock) long time to start. 5 seconds does not seem unreasonable as an estimated max time if the WB chips have the same "2 seconds typical" startup spec.

User1655833706281357277
Associate III
November 10, 2022

You didn't answer the question -- why? What's going on that takes two and a half times longer on a stm32wb55?

Bob S
Bob SBest answer
Super User
November 10, 2022

Sheesh. OK, I'll spell it out in more detail. Presuming the STM32WB data sheet specs the LSE startup time the same as the F429, they give only a "typical" startup time at some nominal voltage and temperature. Because "actual" startup time depends on factors that ST has no control over - crystal, caps, PCB routing, voltage, temperature, ambient moisture(!), etc. The 5 second delay in the HAL code is probably a SWAG (simple? wild *** guess) as to what might be "more then enough" time for the oscillator to start under MOST circumstances. It may be possible to design a board and select components where 5 seconds is not sufficient.

User1655833706281357277
Associate III
November 10, 2022

there we go. thank you

SSher.3
Associate II
November 10, 2022

My wild guess - might be thermal calibration/stabilization?

waclawek.jan
Super User
November 10, 2022

Any value in DS may be misleading, as impact of the mcu on oscillator startup is almost negligible, and as Bob said above,depends mostly on crystal itself, its circuitry and, very importantly, physical layout.

​

I​t's like a child swing​, the very small power feedback circuitry adds an extremely small push each cycle to the crystal, which literally mechanically oscillates, so it takes time until oscillations with adequate amplitude build up. Several seconds are entirely normal.

​

JW​