cancel
Showing results for 
Search instead for 
Did you mean: 

Inquries about STM32F4 Clock Security System (CSS)

mcjun37
Associate

Hello.

I am using STM32F407ZG. I would like to use CSS functionality for clock monitoring and switching. I need a help for using CSS.

  1. Can I switch the clock from HSE to HSI without resetting the MCU?
  2. When the CSS is enabled and the HSE clock fails, it calls NMI_Handler. Does the program call other functions as usual or only NMI_Handler calls infinitely?

Thanks in advance​.

3 REPLIES 3
UraL
Associate

Hello !

UraL
Associate

From RM0385 for STM32F74xxx u can read:

  1. If the HSE oscillator is used directly or indirectly as the system clock (indirectly meaning that

it is directly used as PLL input clock, and that PLL clock is the system clock) and a failure is

detected, then the system clock switches to the HSI oscillator and the HSE oscillator is

disabled.

2.

When the CSS is enabled, if the HSE clock happens to fail, the CSS generates an interrupt,

which causes the automatic generation of an NMI. The NMI is executed indefinitely unless

the CSS interrupt pending bit is cleared. As a consequence, the application has to clear the

CSS interrupt in the NMI ISR by setting the CSSC bit in the Clock interrupt register

(RCC_CIR).

Jinlong Shen
Associate II

@Clive Vallance​ 

I have the following situation.

HSI oscillator and HSE/Bypass clock (not the HSE oscillator) are both activated. HSE clock is the source of PLL. PLL clock is the source of SYSCLK.

Clock Security is enabled. NMI will clear the flag as well.

The reference manual about Clock Security System refers to HSE oscillator but not HSE clock.

If HSE clock fails, will the HSI clock take it over?