Skip to main content
mcjun37
Visitor II
March 12, 2019
Question

Inquries about STM32F4 Clock Security System (CSS)

  • March 12, 2019
  • 3 replies
  • 4738 views

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

This topic has been closed for replies.

3 replies

UraL
Visitor II
October 17, 2019

Hello !

UraL
Visitor II
October 17, 2019

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
May 7, 2020

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