HAL RCC How to Use

group RCC_How_To_Use

This file provides firmware functions to manage the following functionalities of the Reset and Clock Control (RCC) peripheral:

  • Configuration and reset functions

  • Oscillators and Peripherals Control functions

  • Bus configuration functions

Main APIs are not allowed to perform any other actions that their main objectif (for instance, it is not allowed to disable a PLL or an oscillator inside an enable function).

For performance reasons, few functionalities are not supported by the HAL driver but these functionalities are covered by the LL driver (for instance, interrupt management).

The driver is responsible of the update of SystemCoreClock variable (used by CMSIS) and System tick.

RCC specific features

After exiting from standby or reset, the device is running from Multiple Speed Internal System (MSIS) oscillator (by default to 4MHz but set to another value if MSIS Range after standby or reset has been modified).

  • There is no prescaler on High speed (AHBs) and Low speed (APBs) busses: all peripherals mapped on these busses are running at sysclk frequency.

  • The clock for all peripherals is switched off, except the SRAM and FLASH.

Once the device started from reset, the user application could:

  • Configure the clock source to be used to drive the System clock (if the application needs higher frequency/performance)

  • Configure the System clock frequency and Flash settings

  • Configure the AHB and APB busses prescalers

  • Enable the clock for the peripheral(s) to be used

  • Configure the clock source(s) for peripherals which clocks receive an independent kernel clocks.

  • Configure peripherals supporting the autonomous mode (These peripherals are able to generate a kernel clock request and a AHB/APB bus clock request when they need, in order to operate and update their status register even in Stop mode).