2017-05-03 02:26 PM
Hi all,
I have 3 boards with 3 different MCUs, one with STM32L053R8T6, one with STM32L152RCT6, and one with STM32L443RCT6.
All use same 32,768Khz LSE crystal and 12pF caps. But only STM32L053 works fine when LSE is turned on ...
other two MCUs jump to Error handler function. i used STM32Cube for all 3 MCUs. a simple program to turn on LED for example ...
I even changed the crystal with another type, or increased LSE Timeout Value in STM32Cube to 10000 but still no result.
I checked in Debug, the LSERDY flag is not activated and it leads to Timeout and jump to Error Handler function.
What can be the problem ?!
#lse-startupSolved! Go to Solution.
2017-05-14 10:42 PM
The problem is found !
Thank you all for your helps, all problems were because of CSS (Clock security system) enabled in my MCU !It stops OSC if a small failure occurs and won't start again until power restart (not even hardware reset). when running normally, if i touch crystal pins, CSS disables 32Khz OSC but CPU continues to run code. I've written a small code to turn on LCD clocked from 32Khz LSE, so when it stops, LCD also stops and i couldn't see if he cpu is working or not !I used Keil debugger to monitor where the code is, if i've touched OSC before entering debugger, when debugger starts, it first resets the MCU but CSS bit is not cleared this way, so in new code running in debugger mode, i just saw that LSE doesn't start and CPU jumped to Error Handler().in other hard environment (like -10c Temp) CSS just stops LSE after startup and the flag remains even if reset MCU. it prevents LSE start again.2017-05-03 03:24 PM
>>What can be the problem ?!
Component choices, layout?
What is the part number/specification of the 32.768KHz crystal? Did you follow the app note selecting the crystal and capacitors?
2017-05-04 03:21 AM
Hi
fallah.omid
,As it is said by Jan try to refer to
Application notethat show how to determine the different external components and provide guidelines for a good PCB for the oscillator.-Nesrine-
2017-05-04 03:43 AM
I saw AN2867 after this problem.
at first paragraph:
'In practice, most designers do not even really pay attention to the oscillator design until they realize the oscillator does not operate properly (usually when it is already being produced).'
I didn't pay attention too but a reason was because i didn't have this problem before. when working with AVR and AVR Xmega series MCUs.
2017-05-04 04:58 AM
Here is the Layout:
The bottom polygon is connected to GND too.
C13 and C14 are crystal Caps, first i used 12pF caps, no result.
I changed it to 10pF and now it works !
Crystal is:
Epson MC-406 32.768K-A3
Crystals 32.768KHz 12.5pF -40C +85C
I worry for later working ... after i checked forum, i saw many others have same problem, the oscillator is too sensitive, i can't trust on it for long time working !
Is there anyway to get sure the OSC works fine later too ?!!
2017-05-04 05:04 AM
See AN2867.
JW
2017-05-04 10:52 AM
These 32.768 KHz crystals are usually available in several standard load capacitance flavours, typically around 6, 9 or 12pF
The drive characteristics of the STM32 has generally favoured the 6-7pF variety, although newer families have become more tolerant.
A lot of the DISCO/NUCLEO-64 board use this part (often not placed but in the BOM as an option), I've used these to add RTC functionality in STANDBY
32.768KHz 6pF 20ppm -40C +85C
MC-306 32.768K-E3:ROHS
https://www.digikey.com/product-detail/en/MC-306%2032.768K-E3:ROHS/SER2417CT-ND/1532560
Obviously you'll need the MC-406 variety, and I would expect 6.8pF capacitors.
2017-05-04 05:22 PM
Thanks, I have MC-406 which is marked:
32.768K
E 60XMA
I couldn't find this code in datasheet, how should i find how much is the crystal CL ?! (according to datasheet it can be 6pF and more ..., somewhere said standard 12.5pF)
I don't know how but today all the time LSE worked fine ! even when i removed both Caps ! or used 10pF or 12pF or 22pF !
I know it me be not stable.
2017-05-04 08:20 PM
The datasheet doesn't have a good decoder-wheel for the part♯ variants. Use Mouser or DigiKey, and figure out what the suffix mean
One of the things to measure is the start time. Other STM32 parts you can benchmark the LSE against the HSE or PLL using a TIM
2017-05-05 01:13 AM
As i checked Mouser, seems part♯ starting with E are 6pF.
But i'm not sure that E is the first character in second line of crystal marking !
because the shop i bought crystal from says model is : MC-406 32.768K A3
but mark on crystal is:
32.768K
E 60XMA
i don't know if the first character in second line means the series or not ? i saw E marking on all datasheet of MC-406 as a fixed character.
according to AN2867, we should consider Cs too. i sent my PCB Layout, how much Cs you estimate for it ?!
I cleaned PCB by ultrasonic cleaner and almost the surface of PCB is clean. only capacitance between tracks and pcb remains ...