29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Connectivity line devices: reset <strong>and</strong> clock control (RCC)<br />

RM0008<br />

7.2.7 Clock security system (CSS)<br />

Clock Security System can be activated by software. In this case, the clock detector is<br />

enabled after the HSE oscillator startup delay, <strong>and</strong> disabled when this oscillator is stopped.<br />

If a failure is detected on the HSE oscillator clock, this oscillator is automatically disabled, a<br />

clock failure event is sent to the break input of the TIM1 Advanced control timer <strong>and</strong> an<br />

interrupt is generated to inform the software about the failure (Clock Security System<br />

Interrupt CSSI), allowing the MCU to perform rescue operations. The CSSI is linked to the<br />

Cortex-M3 NMI (Non-Maskable Interrupt) exception vector.<br />

Note:<br />

Once the CSS is enabled <strong>and</strong> if the HSE clock fails, the CSS interrupt occurs <strong>and</strong> an NMI is<br />

automatically generated. The NMI will be executed indefinitely unless the CSS interrupt<br />

pending bit is cleared. As a consequence, in the NMI ISR user must clear the CSS interrupt<br />

by setting the CSSC bit in the Clock interrupt register (RCC_CIR).<br />

If the HSE oscillator is used directly or indirectly as the system clock (indirectly means: it is<br />

used as PLL input clock directly or through PLL2, <strong>and</strong> the PLL clock is used as system<br />

clock), a detected failure causes a switch of the system clock to the HSI oscillator <strong>and</strong> the<br />

disabling of the external HSE oscillator. If the HSE oscillator clock is the clock entry of the<br />

PLL (directly or through PLL2) used as system clock when the failure occurs, the PLL is<br />

disabled too.<br />

7.2.8 RTC clock<br />

The RTCCLK clock source can be either the HSE/128, LSE or LSI clocks. This is selected<br />

by programming the RTCSEL[1:0] bits in the Backup domain control register (RCC_BDCR).<br />

This selection cannot be modified without resetting the Backup domain.<br />

The LSE clock is in the Backup domain, whereas the HSE <strong>and</strong> LSI clocks are not.<br />

Consequently:<br />

● If LSE is selected as RTC clock:<br />

– The RTC continues to work even if the V DD supply is switched off, provided the<br />

V BAT supply is maintained.<br />

● If LSI is selected as Auto-Wakeup unit (AWU) clock:<br />

– The AWU state is not guaranteed if the V DD supply is powered off. Refer to<br />

Section 7.2.5: LSI clock on page 111 for more details on LSI calibration.<br />

●<br />

7.2.9 Watchdog clock<br />

If the HSE clock divided by 128 is used as RTC clock:<br />

– The RTC state is not guaranteed if the V DD supply is powered off or if the internal<br />

voltage regulator is powered off (removing power from the 1.8 V domain).<br />

– The DPB bit (Disable backup domain write protection) in the Power controller<br />

register must be set to 1 (refer to Section 4.4.1: Power control register<br />

(PWR_CR)).<br />

If the Independent watchdog (IWDG) is started by either hardware option or software<br />

access, the LSI oscillator is forced ON <strong>and</strong> cannot be disabled. After the LSI oscillator<br />

temporization, the clock is provided to the IWDG.<br />

112/995 Doc ID 13902 Rev 9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!