Problem with LSE on stm32l562xx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-31 9:09 AM
Hello. I've a problem regarding LSE On stm32l562xx mcu. Sometimes it boots, sometimes it doesn't "90 % of time it generates timeout Error" . and it takes too much time to boot up to 4 seconds. I've tried all your sdk initializations, also tried setting lse drive to all 4 modes but nothing changes. Same behaviour and same time. Below is my initialization code and attached how we connect LSE on our board. Regards
- Labels:
-
STM32L5 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-31 9:23 AM
Hi @as0 ,
Your configuration seems good, 110 MHz with the PLL_ON based on the MSI clock at 4 MHz.
Can you tell me where is the issue and which function fails?
Thank you
Aime
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-10-31 9:24 AM
>>I've tried all your sdk initializations..
Perhaps it's the hardware?
Component choices, circuit topology, etc.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-01 9:24 AM
This part fails on timeout : "stm32l5xx_hal_rcc.c" line 724
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-01 9:25 AM
I've attached an image of how i connect it. It doesn't seem that big deal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-02 1:51 AM
Hi @as0 ,
The failing section that you shared comes from the HAL_RCC_OscConfig() function and it seems not related to the LSE anymore.
I think that there is a miss part that you forget to mention in the code, because based on how the HAL is written you can not access to this section unless you wanted to active the LSI clock somewhere.
The line 699 check that you ask to change the LSI configuration.
/*------------------------------ LSI Configuration -------------------------*/
if (((RCC_OscInitStruct->OscillatorType) & RCC_OSCILLATORTYPE_LSI) == RCC_OSCILLATORTYPE_LSI)
{
At the line 705 the HAL check that you want to activate the LSI
/* Check the LSI State */
if (RCC_OscInitStruct->LSIState != RCC_LSI_OFF)
{
Can you confirm it?
Thanks
Aime
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-03 12:20 PM
ah sorry i copied a wrong section i made a new debug session and here is the right section: Line 823
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-03 1:38 PM
Yet it fails to start consistently. The component values are overlaid and unreadable. The trace lengths and load capacitance of the crystal will impact this.
What type of 32.768 KHz crystal? 6, 9 or 12pF ? What value of the capacitors?
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-06 6:33 AM
it's 16 pf
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-08 1:52 AM
Hi @as0 ,
The 16pF value seems a bit higher, to choose a load capacitance value you have to take into account the trace lengths which will increase the capacitance value. There is an application note which register by Microcontroller series all the recommended crystals and load capacitance values, at the table 7. Recommended crystal / MEMS resonators for the LSE oscillator in STM32 products
Please make sure that you are inline with the PCB design guidelines for improving oscillator stability.
- Avoid high values of stray capacitance and inductances, as they can lead to uncontrollable oscillation (the oscillator can resonate at overtones or harmonics frequencies). Reducing the stray capacitance also decreases startup time and improves oscillation frequency stability.
- To reduce high frequency noise propagation across the board, the MCU/MPU must have a stable power supply source, to ensure noiseless crystal oscillations. This means that well-sized decoupling capacitor must be used for powering the device.
- Mount the crystal as close as possible to the MCU/MPU, to keep tracks short, and to reduce inductive and capacitive effects. A guard ring around these connections, connected to the ground, is essential to avoid capturing unwanted noise, which can affect oscillation stability
- Leakage current can increase startup time and even prevent the oscillator start. If the device operates in a severe environment (high moisture/humidity ratio) an external coating is recommended.
Thanks
Aime
