Specialist Supplier of Crystals & Frequency Control Componentssales@mecxtal.com.cn0755-26500570
MERLIN home / Rednote / System Validation and Replacement

What evidence does the STM32F407 retain if an 8 MHz crystal stops in operation?

An STM32F407 board stops logging but the debugger still connects. If it uses an 8 MHz passive crystal and the clock security system CSS is enabled, start with the non-maskable interrupt. CSS monitors the external high-speed clock HSE once it is running. If the system uses HSE directly or a PLL driven by HSE, failure causes a switch to the internal HSI. The processor may continue while a UART configured for the former PLL frequency can no longer transmit at the expected rate.

What to save before restarting

In the diagnostic firmware's non-maskable interrupt handler, read CSSF in the clock interrupt register and save the SWS system clock status. Store both values and an interrupt count in debugger-readable memory instead of relying on a UART whose clock may be wrong. After confirming CSS caused the interrupt, clear the pending condition with the documented CSSC bit. Otherwise repeated entry can make the program look completely stalled. Retain separate handling for other non-maskable interrupt sources.

If advanced timers drive PWM, check TIM1 and TIM8 break events and actual output states. A clock fault also reaches these timer break inputs, so motor outputs can stop while the microcontroller remains accessible to the debugger. On a prototype without an actuated load, compare a normal startup with a captured fault. Record the clock configuration before the fault, the source after switching and timer state before deciding how to reinitialize peripherals.

This diagnosis applies to an HSE that started and was monitored. If the board never sees readiness at power-on, log a startup timeout separately. Check whether the event occurred during startup or operation before replacing the crystal, since the two cases leave different evidence.ST RM0090, clock security system and RCC interrupt register

Send us a part number or your requirements

Brand, frequency, quantity and delivery target — a useful place to start.

WeChat

MERLIN · TIMING COMPONENTS

Scan with WeChat to contact Sales

Add our WeCom contacts from your usual WeChat app.

On desktop, scan with your phone. On mobile, save the QR image and select it from your album in WeChat Scan.