Skip to main content
Explorer
July 15, 2025
Solved

STM32F412 not work at cold start, work after manual reset (potential LSE issue)

  • July 15, 2025
  • 5 replies
  • 1022 views

Hello,

The problem is that we have made 50 customized boards using STM32F412RET6TR, 2 of them has the same issue. It does not run the code (forzen) at cold start up, but will work after a manual reset or power unstable.

One Device was fixed by replacing the MCU, another was remaining for investigating the issue.

Initially, I thought it is the problem of start up reset was released to early, so an RC mod was added to the reset line, but it does not work. Probe on the reset signal and VDD was normal. And later debug shows that the program hit the Reset_Handler and failed in SystemClock_Config section.

Here's some log:

  1. #77, find the program can hit reset_handler, and go to error handler, Use several way to debug and make sure error happens in Systemclock_config.
  2. Adding Delay 50ms/several seconds at start up not help, later found that LSE_STARTUP_TIMEOUT is 5000ms, so the LSE will not recover over time
  3. By removing the LSE in systemclock_config, it will pass systemclock_config and get into next step
  4. Try to probe the 32kHz Crystal OSC32 OUT, and some other tests, then #77 always get into fault_handler, manual reset will not make it working. So LSE is completely broken
  5. By removing the LSE init and RTC_init, the program worked. so the fault happen in LSE
  6. According 2 and 4, the broken part is LSE
  7. Replace the 32Hz Crystal and 18pF cap, ECU still failed.
  8. Try use LSI/HSE as rtc clock source, work
  9. Conclusion: LSE is partially broken initially or has a marginal design, it is completely broken? now

Attached crystal layout and both cap are 18pF, Crystal is 728-1073-2-ND

Can you help me with this issue?

    This topic has been closed for replies.
    Best answer by waclawek.jan

    Will it start if you increase the timeout say to 15 seconds?

    LSE startup longer than 5 seconds may be normal.

    How is VBAT connected?

    JW

    5 replies

    Leo_YeAuthor
    Explorer
    July 15, 2025

    Thanks a lot if anyone could help!

    Super User
    July 15, 2025

    Will it start if you increase the timeout say to 15 seconds?

    LSE startup longer than 5 seconds may be normal.

    How is VBAT connected?

    JW

    Leo_YeAuthor
    Explorer
    July 15, 2025

    Currently it does not work when I increase the timeout to 15 seconds. And the board currently do not run after manual reset. 

     

    VBAT is directly connected to my VDD

    Super User
    July 15, 2025

    Let's start with this:

    > VBAT is directly connected to my VDD

    In that case make sure you perform an explicit backup-domain reset after program startup, due to the "backup-domain brownout" erratum.

    If that still won't help at that particular board, I'd suspect damaged crystal.

    You are surely aware of AN2867 and the crystal choice and layout recommendations therein.

    JW

    Super User
    July 15, 2025

    How is VBAT connected? Do things change if you connect VBAT to GND?

    Jan beat me to it.

    Super User
    July 15, 2025

    Hi@TDK ,

    Sorry, but I don't quite understand your comment. Did you mean, connecting VBAT to GND during powerdown, to make sure the backup domain gets reset?

    Jan

    Explorer
    July 15, 2025

    > Try to probe the 32kHz Crystal OSC32 OUT, and some other tests, then #77 always get into fault_handler, manual reset will not make it working. So LSE is completely broken

    Those crystals are very high impedance, probing and measuring without interference is far from trivial.

    And if I remember correctly, LSE quartz devices work in a less favourable mechanical oscillation mode, and are thus far mor susceptable to environmental influences than "usual" devices in the lower MHz-range.
    As a test, you could try to warm up the "critical" devices to about 35...45°C, and see if startup behavior improves.

    Leo_YeAuthor
    Explorer
    July 15, 2025

    Hi Ozone,

     

    Yes, you are right. I barely able to get the measurement of the clock waveform.

     

    I tried heat the Crystal a bit using hot air. But it didnt seems help.

     

    Thanks,

    Leo

    Leo_YeAuthor
    Explorer
    September 17, 2025

    Issue closed:

    One New device repeats the same issue "frimware not running at power up", so increase the LSE_STARTUP_TIMEOUT from 500ms to 1500ms solve the issue on this device.