cancel
Showing results for 
Search instead for 
Did you mean: 

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?

User1655833706281357277
Associate III
 
1 ACCEPTED SOLUTION

Accepted Solutions

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.

View solution in original post

7 REPLIES 7
Bob S
Principal

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

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

SSher.3
Associate III

My wild guess - might be thermal calibration/stabilization?

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​

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.

there we go. thank you

The reason i get like this is that there is so much inane comment noise in the ST source, and then things like this get swept under the rug. A simple comment there about what's going in would be far more helpful.