cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L1 and STM32L4 Series LSE 32,768Khz Startup Problem

green_om_2006
Associate III
Posted on May 03, 2017 at 23:26

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-startup
1 ACCEPTED SOLUTION

Accepted Solutions
green_om_2006
Associate III
Posted on May 15, 2017 at 07:42

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.

View solution in original post

11 REPLIES 11
Posted on May 04, 2017 at 00:24

>>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?

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Nesrine M_O
Lead II
Posted on May 04, 2017 at 12:21

Hi

fallah.omid

,

As it is said by Jan try to refer to

http://www.st.com/content/ccc/resource/technical/document/application_note/c6/eb/5e/11/e3/69/43/eb/CD002216pdf/files/CD002216pdf/jcr:content/translations/en.CD002216pdf

Application notethat show how to determine the different external components and provide guidelines for a good PCB for the oscillator.

-Nesrine-

green_om_2006
Associate III
Posted on May 04, 2017 at 12:43

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.

Posted on May 04, 2017 at 11:58

Here is the Layout:

0690X00000606vbQAA.png

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 ?!!

Posted on May 04, 2017 at 12:04

See AN2867.

JW

Posted on May 04, 2017 at 17:52

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

http://www.mouser.com/ProductDetail/Epson-Timing/MC-306-32768K-E3ROHS/?qs=sGAEpiMZZMu1CxYMhM6ijysxOz5Zol2S

 

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.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 05, 2017 at 00:22

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.

Posted on May 05, 2017 at 03:20

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Posted on May 05, 2017 at 08:13

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 ...