9. Reset and clock control (RCC)

9.1 RCC introduction

The reset and clock control (RCC) manages the different resets, and generates the clocks for the bus and peripheral.

9.2 RCC pins and internal signals

The table below lists the RCC inputs and output signals connected to package pins or balls.

Table 64. RCC input/output signals connected to package pins or balls

Signal nameSignal typeDescription
NRSTI/OSystem reset, can be used to provide reset to external devices
OSC32_INI32 kHz oscillator input
OSC32_OUTO32 kHz oscillator output
OSC_INISystem oscillator input
OSC_OUTOSystem oscillator output
MCOOOutput clock for external devices
LSCOOLow-speed output clock for external devices
AUDIOCLKIExternal kernel clock input for I2S1, I2S2, and I2S3

9.3 RCC reset functional description

There are three types of reset:

9.3.1 Power reset

A power reset is generated when one of the following events occurs:

A power-on or power-down reset (POR/PDR) sets all registers to their reset values.

When exiting Standby mode, all registers in the core domain are set to their reset value. Registers outside the core domain (RTC, WKUP, IWDG, and GPIO pull-up/pull-down configuration during Standby and Standby mode exit) are not impacted.

9.3.2 System reset

A system reset sets all registers to their reset values, except the reset flags in RCC_RSR, and the registers in the RTC domain.

A system reset is generated when one of the following events occurs:

The reset source can be identified by checking the reset flags in RCC_RSR.

These sources act on the NRST pin and this pin is always kept low during the delay phase. The reset service routine vector is selected depending on RDP level, on Boot option bytes or on both.

The system reset signal provided to the device is output on the NRST pin. The pulse generator guarantees a minimum reset pulse duration of 20 µs for each internal reset source. In case of an external reset, the reset pulse is generated while the NRST pin is asserted low.

In case of an internal reset, the internal pull-up \(R_{PU}\) is deactivated to save the power consumption through the pull-up resistor.

Figure 24. Simplified diagram of the reset circuit

Simplified diagram of the reset circuit showing the NRST pin, pull-up resistor, Schmitt trigger, filter, pulse generator, and various reset sources (WWDG, IWDG, Software, Low-power manager, POR) leading to the System reset.

The diagram illustrates the reset circuitry. An external reset signal is applied to the NRST pin. The NRST pin is connected to a pull-up resistor \(R_{PU}\) to \(V_{DD}\). The signal from the NRST pin is fed into a Schmitt trigger. The output of the Schmitt trigger is split: one path goes through a filter to an OR gate that produces the 'System reset' signal; the other path goes through an inverter to a 'Pulse generator (min 20 µs)'. The output of the pulse generator is connected to another OR gate that combines signals from 'WWDG reset', 'IWDG reset', 'Software reset', 'Low-power manager reset', and 'POR' to also drive the 'System reset' OR gate.

Simplified diagram of the reset circuit showing the NRST pin, pull-up resistor, Schmitt trigger, filter, pulse generator, and various reset sources (WWDG, IWDG, Software, Low-power manager, POR) leading to the System reset.

MSv67375V2

Software reset

The SYSRESETREQ bit in Cortex-M33 application interrupt and reset control register must be set to force a software reset on the device.

Low-power mode security reset

To avoid that critical applications mistakenly enter a low-power mode, the following low-power mode security resets are available. If enabled in option bytes, the resets are generated in any of the following conditions:

For further information on the user option bytes, refer to Section 6.4: FLASH option bytes.

9.3.3 RTC domain reset

The RTC domain has two specific resets, generated when one of the following events occurs:

An RTC domain reset affects the LSE oscillator, the RTC, the backup registers, and the RCC_RTCCR register.

9.3.4 Reset source identification

The application can identify the reset source by checking the reset flags in the RCC_RSR register.

The software can reset the flags by setting the RMVF bit.

The table below shows how the status bits of the RCC_RSR register behave according to the situation that generated the reset. For example, when an IWDG timeout occurs, if the CPU is reading the RCC_RSR register during the boot phase, both PINRSTF and IWDGRSTF bits are set, indicating that the IWDG also generated a pin reset.

Table 65. Reset source identification (RCC_RSR)(1)

ResetLPWRRSTFWWDGRSTFIWDGRSTFSFTRSTFPORRSTFPINRSTF
1Power-on reset000011
2Pin/pad reset000001
3System reset generated by CPU000101
4WWDG reset010001
5IWDG reset001001
6Illegal stop entry reset100001

1. Gray cells highlight the register bits that are set.

9.4 RCC clocks functional description

Four different clock sources can be used to drive the system clock (SYSCLK):

The HSIDIV3 is used as a the system clock source after startup from reset, at 48 MHz.

Note: If HSE or PSIS with HSE as reference are used as SYSCLK and the HSE CSS detect a failure, HSIDIV3 is automatically set as SYSCLK. Adequate wait state supporting both frequencies must be configured in this case.

The device has the following additional clock sources:

Each clock source can be switched on or off independently when it is not used, to optimize power consumption.

Several prescalers can be used to configure the AHB and APB frequencies. The maximum frequency of the AHB and APB domains is 144 MHz.

The peripheral clocks are derived from their bus clock (HCLK, PCLK1, PCLK2 or PCLK3), except those that receive an independent kernel clock. This kernel clock can be selected by software between several sources thanks to RCC_CCIPRx registers (x = 1 to 3).

Note: All timers (except LPTIM) are clocked by HCLK, independently of their respective PCLK.

In addition, the RTC kernel clock is selected by software in RCC_RTCCR. The IWDG clock is always the LSI 32 kHz clock.

The RCC feeds the Cortex system timer (SysTick) external clock with the AHB clock (HCLK) divided by eight, or LSE or LSI. The SysTick can work either with this clock or directly with the Cortex clock (HCLK), configurable in the SysTick control and status register.

FCLK acts as a Cortex-M33 free-running clock.

Figure 25. Clock tree

Clock tree diagram for RM0522 showing various clock sources (LSI, LSE, HSE, HSI, MCO1, MCO2, AUDIOCLK) and their distribution to system buses (AHB, APB1, APB2, APB3) and peripherals (SPI, USART, I2C, XSPI1, ETH1, ADC, DAC, LPTIM1, LPUART).

The diagram illustrates the clock tree architecture of the RM0522 microcontroller. It shows the following components and connections:

Clock tree diagram for RM0522 showing various clock sources (LSI, LSE, HSE, HSI, MCO1, MCO2, AUDIOCLK) and their distribution to system buses (AHB, APB1, APB2, APB3) and peripherals (SPI, USART, I2C, XSPI1, ETH1, ADC, DAC, LPTIM1, LPUART).

MSv76069V3

9.4.1 HSE clock

The HSE block can generate a clock from an external crystal/ceramic resonator, or from an external clock source.

Figure 26. HSE/ LSE clock sources

Figure 26: HSE/ LSE clock sources. The diagram shows two configurations for the HSE oscillator. The 'External clock configuration' shows an external clock source connected to the OSC_IN pin, with OSC32_IN, OSC32_OUT, OSC_IN, and OSC_OUT pins shown, and a GPIO connection to OSC_OUT. The 'Crystal/ceramic resonators configuration' shows a crystal or ceramic resonator connected between OSC_IN and OSC_OUT, with load capacitors C_L1 and C_L2 connected from each pin to ground. The diagram is labeled MSv39357V2.
Figure 26: HSE/ LSE clock sources. The diagram shows two configurations for the HSE oscillator. The 'External clock configuration' shows an external clock source connected to the OSC_IN pin, with OSC32_IN, OSC32_OUT, OSC_IN, and OSC_OUT pins shown, and a GPIO connection to OSC_OUT. The 'Crystal/ceramic resonators configuration' shows a crystal or ceramic resonator connected between OSC_IN and OSC_OUT, with load capacitors C_L1 and C_L2 connected from each pin to ground. The diagram is labeled MSv39357V2.

External clock source (HSE bypass)

In this mode, an external clock source must be provided to OSC_IN pin. The external clock can be low swing (analog) or digital. If this clock is directly used by a peripheral, the duty cycle requirement is defined by the peripheral and the application (refer to datasheet for more details).

In case of an analog clock (low swing) the HSEBYP and HSEON bits must be set to 1 in RCC_CR1.

In case of a digital clock, the HSEBYP and the HSEEXT bits must be set to 1 followed by setting the HSEON bit to 1 in RCC_CR1.

External crystal/ceramic resonator

The oscillator is enabled by setting the HSEBYP bit to 0 and HSEON bit to 1.

The HSE can be used when the product requires a very accurate high-speed clock.

The associated hardware configuration is shown in Figure 26: the resonator and the load capacitors must be placed as close as possible to the oscillator pins to minimize output distortion and startup stabilization time. The loading capacitance values must be adjusted according to the selected crystal or ceramic resonator. Refer to the electrical characteristics section of the datasheet for more details.

The HSERDY flag in RCC_CR1 indicates whether the HSE oscillator is stable or not. At startup, the hse_ck clock is not released until this bit is set by hardware. An interrupt can be generated if enabled in RCC_CIER.

The HSE can be switched on and off through the HSEON bit.

Note: The HSE cannot be switched off if one of the following two conditions is met:

In that case the hardware does not allow programming the HSEON bit to 0.

The HSE is automatically disabled by hardware when the system enters Stop or Standby mode. It can be kept on under Stop 0 mode if HSIKERON is set and PSI needs HSE as a reference clock.

In addition, the HSE clock can be driven to the MCO1 and MCO2 outputs and used as a clock source for other application components.

9.4.2 HSI oscillator and HSIS clock

The HSI block provides the default clocks to the product.

The HSI is a high-speed internal oscillator that can be used as a system clock or peripheral clock offering a 144MHz clock available at startup and upon wake-up from low power modes. The HSI oscillator can produce 3 output clocks; HSIS, HSIDIV3, and HSIK.

Two output dividers let you extent the available frequencies for the device. One configurable divider by 1.5, 2, 2.5, ... 7.5 or 8 is configured thanks to HSIKDIV[3:0] generating HSIK clock and a second divided by 3 intended for system clock and USB generating HSIDIV3.

The HSI advantages are the following:

The HSI frequency, even with frequency calibration, is less accurate than an external crystal oscillator or ceramic resonator.

HSI oscillator can be switched on and off using the HSISON bit, the HSIDIV3ON bit, and the HSIKON bit. Only the enabled clock output is generated.

Note: The HSI cannot be switched off if the HSI is used directly (via SW mux) as a system clock. In that case the hardware does not allow clearing the HSISON bit or HSIDIV3ON bit to 0.

The HSISRDY, HSIKRDY, and HSIDIV3RDY flags indicate if the HSI is stable or not. At startup, the HSIS output clock is not released until HSISRDY is set by hardware.

The HSIDIV3 clock can also be used as a backup source (auxiliary clock) if the HSE fails (refer to Section 9.4.10: Clock security system (CSS)).

In addition, the HSI clocks can be driven to the MCO1 or MCO2 outputs and used as clock source for other application components.

Care must be taken when the HSIK is used as a kernel clock for communication peripherals, the application must take in account the following parameters:

Note: The HSI can remain enabled when the system is in Stop 0 mode thanks to HSIKERON bit. In this case, the HSI and its clocks outputs HSIK, HSIDIV3, or HSIS, are kept active if their respective HSIKON, HSIDIV3ON, and HSISON are set. The states of these bits are consequently maintained exiting Stop 0 if HSIKERON bit is set.

HSI calibration

HSI oscillator frequencies can vary from one chip to another due to manufacturing process variations. That is why each device is factory calibrated by STMicroelectronics to achieve an accuracy of ACCHSI (refer to the product datasheet for more information).

After a power-on reset, the factory calibration value is loaded. If the application is subject to voltage or temperature variations, this may affect the oscillator frequency. The user application can trim the HSI frequency using the TRIM[6:0] bits in the CRS_CR register.

The clock recovery system can be used to perform this calibration. It requires an accurate reference that can be HSE (through HSE_1MHz connection), LSE, USB Start of Frame, or an external signal.

9.4.3 PSI oscillator and PSIS clock

The PSI oscillator provides a 100 MHz, 144 MHz, or 160 MHz frequency, selected thanks to PSIFREQ[1:0] bitfield, to the product on condition that an adequate reference clock is available. This programmable speed internal oscillator can be used as a system clock or peripheral clock. The PSI oscillator can produce three output clocks; PSIS, PSIDIV3, and PSIK.

The PSI is only operational when receiving a reference clock of 32.768 kHz, 8 MHz, or 8.33 MHz (25 MHz divided by 3) as input. The PSIREF[2:0] bitfield helps you get the required input frequency depending on your chosen external clock. This external clock is selected thanks to PSIREFSRC[1:0] multiplexer between LSE, HSE, or HSI divided by 18. Details of possible settings are listed in the table below.

Table 66. PSI frequency settings

PSIFREQ[1:0]PSIREFSRC[1:0]PSIREF[2:0]
160HSE48
32
24
16
8
HSI/188
144LSE0.032768
HSE48
32
24
16
8
HSI/188
LSE0.032768

Table 66. PSI frequency settings (continued)

PSIFREQ[1:0]PSIREFSRC[1:0]PSIREF[2:0]
100HSE50
48
32
25
24
16
HSI/188
0.032768
LSE0.032768

Note: If LSE is used as reference, an intrinsic error must be anticipated on the output frequency (100.016 MHz, 144.015 MHz, and 160.006 MHz)

Two output dividers can be used to extent the available frequencies for the device. One configurable divider by 1.5, 2, 2.5, 3, 3.5, ... , 7.5, or 8, configured thanks to PSIKDIV[3:0] generating PSIK clock and a second dividing by 3 generating PSIDIV3 clock, intended for USB.

The PSI advantages are the following:

The PSI frequency accuracy is directly related to the accuracy of its reference clock (for more details regarding the specification of this oscillator, refer to product datasheet).

PSI oscillator can be switched on and off using the PSISON bit, the PSIDIV3ON bit, or the PSIKON bit. Only the enabled clock output is generated.

Note: The PSI cannot be switched off if used (via SW mux) as a system clock. In that case, the hardware does not allow programming the PSISON bit to 0.

The PSISRDY, PSIKRDY, and PSIDIV3RDY flags indicate if the oscillator is stable or not.

In addition, the PSI clocks can be driven to the MCO1 or MCO2 outputs, and used as clock source for other application components.

Care must be taken when the PSI is used as a kernel clock for communication peripherals; the application must take into account the following parameters:

Note: The PSI can remain enabled when the system is in Stop 0 mode thanks to PSIKERON bit. In this case the PSI and its clock outputs PSIK, PSIKDIV3, or PSIS are kept enabled if their respective PSIKON, PSIDIV3ON, and PSISON are set. The states of those bits are maintained exiting Stop 0 if the HSIKERON bit is set.

9.4.4 HSIDIV3 and PSIDIV3 clock

The HSIDIV3 clock signal is generated from the internal 144 MHz RC oscillator, divided by 3 to be used directly for USB and for random number generator (RNG).

This internal 48 MHz clock is mainly dedicated to provide a high-precision clock to the USB peripheral by means of a special clock recovery system (CRS) circuitry. The CRS can use the USB SOF signal, the LSE, or an external signal to automatically and quickly adjust the oscillator frequency on-the-fly. It is disabled as soon as the system enters Stop or Standby mode. When the CRS is not used, the HSI oscillator runs on its default frequency, subject to manufacturing process variations.

For more details on how to configure and use the CRS peripheral, refer to Section 10: Clock recovery system (CRS).

The HSIDIV3RDY flag in the RCC_CR register indicates whether the HSIDIV3 clock is stable or not. At startup, the HSIDIV3 output clock is not released until this bit is set by the hardware.

The HSIDIV3 clock signal can be switched on and off using the HSIDIV3ON bit in the RCC_CR register.

The PSIDIV3 clock signal is generated from the internal 144 MHz RC oscillator, divided by 3 to be used directly for USB and for random number generator (RNG). It benefits from the accuracy of the HSE or LSE thanks to its operation in PLL mode. Similarly to HSIDIV3, it is disabled in Stop or Standby mode, ready once PSIDIV3RDY is set and enabled thanks to PSIDIV3ON bit is set.

9.4.5 HSIK and PSIK clock

THE HSIK and PSIK are two clock outputs offering frequency flexibility to the user. These dividers can be configured thanks to HSIKDIV[3:0] and PSIKDIV[3:0] bitfields respectively with division factors of 1, 1.5, 2, 2.5 ... 7.5, and 8. This allow to create a 96 MHz clock source derived from a 144 MHz for example if divided by 1.5, useful for FDCAN operation, or 64 MHz out of the 160 MHz divided by 2.5 to tune your DAC output sample frequency.

The HSIKRDY and PSIKRDY flags in the RCC_CR register indicate whether the HSIK and PSIK clocks are stable or not. At startup, the HSIK, and PSIK output clocks are not released until this bit is set by hardware.

The HSIK and PSIK clock signals can be switched on and off using the HSIKON and PSIKON bits in the RCC_CR register.

Table 67. PSIK and HSIK output frequency

PSIKDIV[3:0]/
HSIKDIV[3:0]
division factor
PSIK frequency if PSI
160MHz
PSIK frequency if PSI 144MHz and
hsik frequency
PSIK frequency if PSI
100MHz
1160 MHz144 MHz100 MHz
1.5106.67 MHz96 MHz66.67 MHz
280 MHz72 MHz50 MHz
2.564 MHz57.6 MHz40 MHz
353.33 MHz48 MHz33.33 MHz
3.545.71 MHz41.14 MHz28.57 MHz

Table 67. PSIK and HSIK output frequency (continued)

PSIKDIV[3:0]/
HSIKDIV[3:0]
division factor
PSIK frequency if PSI
160MHz
PSIK frequency if PSI 144MHz and
hsik frequency
PSIK frequency if PSI
100MHz
440 MHz36 MHz25 MHz
4.535.56 MHz32 MHz22.22 MHz
532 MHz28.8 MHz20 MHz
5.529.09 MHz26.18 MHz18.18 MHz
626.67 MHz24 MHz16.67 MHz
6.524.62 MHz22.15 MHz15.38 MHz
722.86 MHz20.57 MHz14.28 MHz
7.521.33 MHz19.2 MHz13.33 MHz
820 MHz18 MHz12.5 MHz

Caution: 160 MHz is above the maximum frequency supported by the product. It must not be propagated to the kernel clock of peripherals.

9.4.6 LSE clock

The LSE block can generate a clock from an external crystal/ceramic resonator, or from an external user clock.

External clock source (LSE bypass)

In this mode, an external clock source must be provided to OSC32_IN pin. The input clock can have a frequency up to 1 MHz, and be low swing (analog) or digital. A duty cycle close to 50% is recommended.

This external clock is provided to the OSC32_IN pin while the OSC32_OUT pin must be left high-Z (see Figure 25).

In case of an analog clock (low swing), the LSEBYP, and LSEON bits must be set to 1 in RCC_RTCCR.

In case of a digital clock, the LSEBYP and the LSEEXT bits must be set to 1 followed by setting the LSEON bit to 1 in RCC_RTCCR.

External crystal/ceramic resonator (LSE crystal)

The LSE clock is generated from a 32.768 kHz crystal or ceramic resonator. It has the advantage to provide a low-power, highly accurate clock source to the real-time clock (RTC) for clock/calendar or other timing functions.

The LSERDY flag in RCC_RTCCR indicates whether the LSE crystal is stable or not. At startup, the LSE crystal output clock signal is not released until this bit is set by the hardware. An interrupt can be generated if enabled in RCC_CIER.

The LSE oscillator is switched on and off using the LSEON bit. The LSE remains enabled when the system enters Stop or Standby mode.

In addition, the LSE clock can be driven to the MCO1 and MCO2 output and used as a clock source for other application components.

The LSE also offers a programmable driving capability (LSEDRV[1:0]), which can be used to modulate the amplifier driving capability. This driving capability is chosen according to the external crystal/ceramic component requirement to ensure a stable oscillation.

The driving capability must be set before enabling the LSE oscillator.

9.4.7 LSI clock

The LSI acts as a low-power clock source that can be kept running when the system is in Stop or Standby mode for the independent watchdog (IWDG) and auto-wake-up unit (AWU).

The clock frequency is around 32 kHz. For more details, refer to the electrical characteristics section of the datasheet.

The LSI can be switched on and off using the LSION bit. The LSIRDY flag indicates whether the LSI oscillator is stable or not. If an independent watchdog is started either by hardware or software, the LSI is forced on and cannot be disabled.

The LSI remains enabled when the system enters Stop or Standby mode.

At LSI startup, the clock is not provided until the hardware sets the LSIRDY bit. An interrupt can be generated if enabled in RCC_CIER.

In addition, the LSI clock can be driven to the MCO1 and MCO2 output, and used as a clock source for other application components.

Note: LSION and LSIRDY are located in RCC_RTCCR.

9.4.8 System clock (SYSCLK) selection

Four different clock sources can be used to drive the system clock (SYSCLK):

The system clock maximum frequency is 144 MHz. After a system reset (or after leaving Standby mode), the HSI oscillator divided by 3, at 48 MHz, is selected as the system clock. When a clock source is used directly or through PSI as a system clock, it is not possible to stop it.

A switch from one clock source to another occurs only if the target clock source is ready (clock stable after startup delay). If a clock source not yet ready is selected, the switch occurs when the clock source becomes ready. Status bits in RCC_CR1 indicate which clocks are ready, and which clock is currently used as a system clock.

9.4.9 Handling clock generators in Stop and Standby modes

When the whole system enters Stop mode, all the clocks (system and kernel clocks) are stopped, as well as the following clock sources:

Note: In Stop 0 mode, if HSIKERON or PSIKERON are set, HSI, PSI, or HSE may be kept running depending on clock output enable bits (HSISON, HSIDIV3ON, HSIKON, PSISON, PSIDIV3ON, PSIKON) and PSI reference clock source setting. In Stop 1 mode, HSIKERON, and PSIKERON have no effect.

The content of the RCC registers is not altered except for HSEON set to 0.

Exiting Stop mode

When the system exits this mode via a wake-up event, the application restarts on HSI oscillator and HSIS or HSIDIV3 clock depending on STOPWUCK bit value.

During Stop mode

There are two specific cases where the HSI can be enabled during this mode.

Table 68. HSIKERON and PSIKERON behavior

HSIKERON (PSIKERON)HSI (PSI) state during Stop modeHSI (PSI) state setting time
0Off\(t_{su(HSI)}\) \(t_{su(PSI)}\) (1)
1Running and gated if enabledImmediate

1. \(t_{su(HSI)}\) and \(t_{su(PSI)}\) are the startup times of, respectively, the HSI and PSI oscillators (refer to the product datasheet for the values of these parameters).

When the microcontroller exits Standby mode, HSIDIV3 is selected as the system clock. The RCC registers are reset to their initial values, except for RCC_RSR and RCC_RTCCR.

Note: The HSI and PSI oscillators provide three clock paths respectively:

When a peripheral requests the kernel clock in system Stop mode, only the path providing the hsik_ck, psik_ck or hsidiv3_ck, psidiv3_ck is activated.

9.4.10 Clock security system (CSS)

Clock security system on HSE

The clock security system can be enabled by software via the HSECSSON bit, which can be set even when the HSEON is cleared.

The CSS on HSE is enabled by the hardware when the HSE is enabled and ready, and HSECSSON set to 1.

The CSS on HSE is disabled when the HSE is disabled. It is not possible to clear directly the HSECSSON bit by software.

The HSECSSON bit is cleared by hardware when a system reset occurs or when the system enters Standby mode.

If a failure is detected on the HSE clock while it is used as a system clock, the system automatically switches to the HSIDIV3, to provide a safe clock. The HSE is then automatically disabled, a clock failure event is sent to the break inputs of the advanced-control timer (TIM1, TIM8, TIM15, TIM16, and TIM17), and an NMI is automatically generated to inform the application about the failure, allowing the MCU to perform rescue operations. If the HSE output was used as clock source for the PSI reference clock when the failure occurred, the oscillator is also disabled.

If an HSE clock failure occurs when the CSS is enabled, the CSS generates an interrupt that causes the automatic generation of an NMI. The HSECSSF flag in RCC_CIFR is set to 1 to allow the application to identify the failure source. The NMI routine is executed indefinitely until the HSECSSF bit is cleared. As a consequence, the application must clear the HSECSSF flag in the NMI ISR by setting the HSECSSC bit in RCC_CICR.

Clock security system on LSE

A clock security system on LSE can be activated by software writing the LSECSSON bit in RCC_RTCCR. This bit can be disabled only by a hardware reset or RTC software reset, or after a failure detection on LSE. LSECSSON must be written after LSE is enabled (LSEON enabled) and ready (LSERDY set by hardware), and after the RTC clock has been selected by RTCSEL.

The CSS on LSE is working in all modes. It also works under system reset (excluding power-on reset).

The clock security system on the LSE detects when the LSE disappears or in case of over frequency.

If a failure is detected on the external 32 kHz oscillator, the LSE clock is no longer supplied to the RTC, but no hardware action is made to the registers.

Note: If the LSECSS is enabled and the LSE clock fails, the LSECSSI occurs and an NMI is automatically generated. The NMI is executed infinitely unless the LSECSSF interrupt pending bit is cleared. It is therefore necessary that the NMI ISR clears the LSECSSI by setting the LSECSSC bit in the clock interrupt clear register (RCC_CICR).

In case of CSS on LSE detection event (LSECSSD = 1 in the RCC_RTCCR), the software must change the RTC clock source (no clock or LSI or HSE, with RTCSEL bitfield modification only possible while LSECSSD = 1) then disable the LSECSSON bit that clears the LSECSSD, stop the defective 32 kHz oscillator (disabling LSEON), or act to secure the application.

Refer to the datasheet for CSS on LSE electrical characteristics.

9.4.11 Clock output generation (MCO1/MCO2/LSCO)

Two microcontroller clock output pins (MCO1 and MCO2) are available. A clock source can be selected for each output. The selected clock can be divided thanks to a configurable prescaler (refer to Figure 25 for additional information on signal selection).

MCO1 and MCO2 outputs are controlled via MCO1PRE[3:0], MCO1[2:0], MCO2PRE[3:0], and MCO2[2:0], located in RCC_CFGR1.

The GPIO port corresponding to each MCO pin must be programmed in alternate function mode.

The clock provided to the MCOs outputs must not exceed the maximum pin speed (refer to the product datasheet for information on the supported speed). Under Stop 0, only PSIK, HSIK, and PSIDIV3 can be output on MCOx if they are kept enabled thanks to HSIKERON or PSIKERON.

Another output (LSCO) allows one of the low-speed clocks (LSI, LSE) to be output onto the external LSCO pin. This output is available in Stop mode, not available in Standby mode. The selection is controlled by the LSCOSEL bit, and enabled by the LSCOEN bit in RCC_RTCCR.

The MCO clock output requires the corresponding alternate function selected on the MCO pin. The LSCO pin must be left in the default POR state.

9.4.12 Kernel clock selection

Some peripherals are designed to work with two different clock domains that operate asynchronously:

The benefit of having peripherals supporting these two clock domains is that the user application has more freedom to choose an optimized clock frequency for the CPU, bus matrix and for the kernel part of the peripheral. The user application can thus change the bus frequency without reprogramming the peripherals. As an example, an ongoing transfer with UART is not disturbed if its APB clock is changed on-the-fly.

The table below shows the kernel clock that the RCC can deliver to the peripherals. Each row represents a multiplexer and the peripherals connected to its output.

Table 69. Kernel clock distribution overview

PeripheralsClock multiplexer control bitsBus clocks(1)psis_ckpsidiv3_ckpsik_ckhsis_ckhsidiv3_ckhsik_ckhse_cklse_cklsi_ckAUDIOCLKhse_1M_ckDisabled
XSPI1XSPI1SEL0(2)--1--2------
FDCANxFDCANSEL01-2---3-----
I2CxI2CxSEL0--1--2------
I3C1I3C1SEL0--1--2------
LPTIM1LPTIM1SEL0-----1-23---
SPI(I2S)xSPIxSEL0--1--2---3--
USARTxUSARTxSEL0--1--2-3----
UARTxUARTxSEL0--1--2-3----
LPUART1LPUART1SEL0-----1-23---
USB(CK48)CK48SEL--1--2-3----0
ADCDACADCDACSEL0(2)1-2--3------

Table 69. Kernel clock distribution overview (continued)

PeripheralsClock multiplexer control bitsBus clocks(1)psis_ckpsidiv3_ckpsik_ckhsis_ckhsidiv3_ckhsik_ckhse_cklse_cklsi_ckAUDIOCLKhse_1M_ckDisabled
DACDACSEL--------01---
RTC/AWURTCSEL--------12-30
ETH1_CLKETH1CLKSEL-1-2---3----0
ETH1_PTPETH1PTPCLKSEL12-3--------0
  1. 1. The bus (APB or AHB) clocks are the bus interface clocks to whom the peripherals are connected.
  2. 2. When SYSCCLK is divided by 2 or more, the AHB prescaler does not maintain the 50% duty cycle required by the ADC and XSPI in DDR mode. To achieve a 50% duty cycle, the ADCDACPRE or XSPI peripheral prescalers must divide HCLK by a factor of 2 or higher.

Peripherals dedicated to control and data transfer

Peripherals such as SPIs, I2Cs, UARTs do not need a specific kernel clock frequency but a clock fast enough to generate the correct baud rate, or the required bit clock on the serial interface. For that purpose the source can be selected among the following ones:

Note: UARTs also can use the LSE clock when high baud rates are not required.

Clock distribution for ETH1

The Ethernet clocks provided by the RCC are available on ETH1_CLK pad. The application can select if the ETH1_CLK is generated from the PSIS, PSIK or from the HSE.

The RCC also provides the bus clock and the reference clock for the PTP function. The bus and PTP clocks generation are controlled via ETH1EN and ETH1LPEN bits.

The Ethernet transmit and receive clocks must be provided from an external Ethernet PHY.

Figure 27. Clock distribution for ETH

Block diagram of clock distribution for ETH, showing RCC and PKEU blocks. The RCC block contains clock sources and dividers for MII and RMII modes. The PKEU block contains logic for clock enable and distribution. The ETH block shows the final clock outputs. A legend explains the color coding for MII (yellow) and RMII (blue) paths, and the dynamic switch symbol.

The diagram illustrates the clock distribution architecture for the Ethernet (ETH) peripheral. It is divided into three main sections: RCC (Reset and Clock Control), PKEU (Peripheral Kernel Ethernet Unit), and ETH (Ethernet peripheral).

Legend:

MSv76147V1

Block diagram of clock distribution for ETH, showing RCC and PKEU blocks. The RCC block contains clock sources and dividers for MII and RMII modes. The PKEU block contains logic for clock enable and distribution. The ETH block shows the final clock outputs. A legend explains the color coding for MII (yellow) and RMII (blue) paths, and the dynamic switch symbol.

The signal ETH1_SEL_PHY is provided by the SBS block and defines the interface type:

Clock distribution for cryptographic subsystem

This subsection is only available for STM32C59x/5A3.

Figure 28 shows the clock distribution for the cryptographic subsystem.

Note: All the peripheral clocks of the cryptographic subsystem must be disabled before issuing a software reset to any CCB/PKA/RNG/SAES/HASH/AES peripheral of this subsystem.
For any CCB/PKA/RNG/SAES/HASH/AES peripheral of this subsystem, the software must ensure that the peripheral is not busy (by polling on the BUSY bit flag of the related CCB/PKA/RNG/SAES/HASH/AES peripheral) before disabling the peripheral clock.

Figure 28. Clock distribution for Crypton subsystem Block diagram showing clock distribution for the Crypton subsystem. The diagram is divided into two main sections: RCC (Reset and Clock Control) on the left and Crypton on the right. The Crypton section contains several functional blocks: CCB, PKA, RNG, SAES, HASH, and AES. The RCC section contains a PKEU (Peripheral Key Encryption Unit) block, which is further divided into logic and clock distribution components. The PKEU receives hclk2 and hclk signals and distributes them to the Crypton blocks. The CCB block receives hclk and control signals (ccb_hclk_en, pka_hclk_en, rng_hclk_en, saes_hclk_en). The PKA block receives hclk and control signals (PKAEN, PKALPEN). The RNG block receives hclk and control signals (RNGEN, RNGLPEN) and outputs rng_ckreq and rng_clk. The SAES block receives hclk and control signals (SAESEN, SAESLPEN) and outputs saes_ker_ck. The HASH block receives hclk and control signals (HASHEN, HASHLPEN). The AES block receives hclk and control signals (AESEN, AESLPEN). The PKEU also receives external signals: tamp_erase_req, rdp_erase_ram, PSI_DIV_3, HSE, and HSI_DIV_3. A legend at the bottom indicates that thick lines represent bus interface clocks and thin lines represent kernel clocks. The document version MSv69970V1 is noted in the bottom right corner of the diagram area.
Block diagram showing clock distribution for the Crypton subsystem. The diagram is divided into two main sections: RCC (Reset and Clock Control) on the left and Crypton on the right. The Crypton section contains several functional blocks: CCB, PKA, RNG, SAES, HASH, and AES. The RCC section contains a PKEU (Peripheral Key Encryption Unit) block, which is further divided into logic and clock distribution components. The PKEU receives hclk2 and hclk signals and distributes them to the Crypton blocks. The CCB block receives hclk and control signals (ccb_hclk_en, pka_hclk_en, rng_hclk_en, saes_hclk_en). The PKA block receives hclk and control signals (PKAEN, PKALPEN). The RNG block receives hclk and control signals (RNGEN, RNGLPEN) and outputs rng_ckreq and rng_clk. The SAES block receives hclk and control signals (SAESEN, SAESLPEN) and outputs saes_ker_ck. The HASH block receives hclk and control signals (HASHEN, HASHLPEN). The AES block receives hclk and control signals (AESEN, AESLPEN). The PKEU also receives external signals: tamp_erase_req, rdp_erase_ram, PSI_DIV_3, HSE, and HSI_DIV_3. A legend at the bottom indicates that thick lines represent bus interface clocks and thin lines represent kernel clocks. The document version MSv69970V1 is noted in the bottom right corner of the diagram area.

RTC/AWU clock

The rtc_ck clock source can be one of the following:

The source clock is selected by programming the RTCSEL[1:0] bits in RCC_RTCCR and the RTCPRE[8:0] bits in RCC_CFGR1.

This selection cannot be modified without resetting the RTC domain.

The rtc_ck clock is enabled through the RTCEN bit in RCC_RTCCR.

The RTC bus interface clock (APB clock) is enabled through RTCAPBEN and RTCAPBLPEN bits located in RCC_APB3ENR/LPENR registers.

Note: To read the RTC calendar register when the APB clock frequency is less than seven times the RTC clock frequency (\(F_{APB} < 7 \times F_{RTCLK}\)), the software must read the calendar time and date registers twice. The data are correct if the second read access to RTC_TR gives the same result than the first one. Otherwise, a third read access must be performed.

Watchdog clocks

The RCC provides the clock for the two watchdog blocks available on the circuit. The independent watchdog (IWDG) is connected to the LSI. The window watchdog (WWDG) is connected to the APB clock.

If an independent watchdog is started by either hardware option or software access, the LSI is forced on and cannot be disabled. After the LSI oscillator setup delay, the clock is provided to the IWDG.

Clock frequency measurement using TIMx

The HSI is not operating on a reference clock as the PSI. If the PSI cannot be the source to blocks requiring accurate frequency, it can be interesting to calibrate HSI thanks to timers or CRS. Most of the clock source generator frequencies can be measured by means of the input capture of TIMx.

The primary purpose of having the LSE connected to a TIMx input capture is to be able to accurately measure the HSI. This requires to use the HSI as the system clock source directly. The number of system clock counts between consecutive edges of the LSE signal gives a measurement of the internal clock period. Taking advantage of the high precision of LSE crystals (typically a few tens of ppm) we can determine the internal clock frequency with the same resolution, and trim the source to compensate for manufacturing-process and/or temperature- and voltage-related frequency deviations.

The basic concept consists in providing a relative measurement (such as HSI/LSE ratio). The precision is therefore tightly linked to the ratio between the two clock sources. The greater the ratio is, the more accurate the measurement is.

The HSI oscillator have dedicated user-accessible calibration bits for this purpose (see RCC_CFGR1).

The LSI frequency can also be measured: this is useful for applications that do not have a crystal. The ultra-low-power LSI oscillator has a large manufacturing process

deviation. The LSI clock frequency can be measured using the more precise HSI clock source. Using this measurement, a more accurate RTC time base timeouts (when LSI is used as the RTC clock source) and/or an IWDG timeout with an acceptable accuracy can be obtained.

Clock frequency measurement using CRS

The HSI is as well directly connected to CRS block that can handle its TRIM automatically on HSE, LSE, USB SOF signal or external reference clock.

9.4.13 RTC and TAMP clock

The RTCCLK clock source is used by RTC and TAMP, and can be either the HSE_1MHz, LSE, or LSI clock. It is selected by programming the RTCSEL[1:0] bits in RCC_RTCCR. This selection cannot be modified without resetting the RTC domain. The system must always be configured so as to get a PCLK frequency greater than or equal to the RTCCLK frequency for a proper operation of the RTC. The TAMP does not require any kernel clock if only the backup registers are used, with tampers in edge detection mode. All other tamper detection modes require a kernel clock (refer to Section 40: Tamper and backup registers (TAMP) for more details).

The LSE is in the RTC domain, whereas the HSE and LSI clocks are not.

Consequently, if the HSE clock divided by a prescaler is used as the RTC or TAMP clock, the RTC state is not guaranteed if the internal voltage regulator is powered off (removing power from the core domain) during Standby mode for example. Depending on the TAMP configuration, this one can remain functional if used in a mode that does not need any kernel clock.

When the RTC and TAMP clock is LSE or LSI, the RTC remains clocked and functional under system reset.

9.4.14 Timer clock

The timer clock frequencies (excluding LPTIM) are fixed and equal to HCLK.

9.4.15 Peripherals clock gating

Peripherals clock gating in Run mode

Each peripheral clock can be enabled by the corresponding EN bit in the RCC_AHBxENR and RCC_APBxENR registers.

When the peripheral clock is not active, read or write accesses to the peripheral registers are not supported.

The enable bit has a synchronization mechanism to create a glitch-free clock for the peripheral. After the enable bit is set, there the clock is active after 2 cycles of the peripheral bus clock.

Caution: Just after enabling the clock for a peripheral, the software must wait for these 2 clock cycles before accessing the peripheral registers.

Peripherals clock gating in Sleep mode

When a peripheral is enabled, its clock can be automatically gated off when the device is in Sleep mode, by clearing the peripheral LPEN bit in the RCC_AHBxLPENR and

RCC_APBxLPENR registers. Both EN and LPEN bit of the peripheral must be set to keep the clock on in Sleep mode.

9.5 RCC privilege functional description

By default, after reset, all RCC registers can be read or written with both privileged and unprivileged access except RCC_PRIVCFGR that can be written with privileged access only. RCC_PRIVCFGR can be read by privileged and unprivileged access.

The PRIV bit in RCC_PRIVCFGR can be written with privileged access only. This bit configures the privileged access of all RCC functions.

When the PRIV bit is set in RCC_PRIVCFGR:

9.6 RCC low-power modes

The CPU DeepSleep mode can be overridden for debugging by setting the DBG_STOP or DBG_STANDBY bit in the DBGMCU_CR register.

When exiting Stop mode, the system clock can be HSIS or HSIDIV3 based on the STOPWUCK value. The frequency (user trim) and the setting of the HSIK and PSIK prescaler are the one configured before entering Stop mode.

When leaving Standby mode, the system clock is HSIDIV3 (48 MHz). The user trim is lost.

If a flash memory programming operation is ongoing, a Stop or Standby mode entry is delayed until the flash memory interface access is finished. If an access to the APB domain is ongoing, a Stop or Standby mode entry is delayed until the APB access is finished.

9.7 RCC interrupts

The table below summarizes the interrupt sources and the way to control them.

Table 70. Interrupt sources and control

Interrupt vectorInterrupt event flagDescriptionEnable control bitsInterrupt clear methodExit Sleep modeExit Stop and Standby modes
RCCLSIRDYFLSI readyLSIRDYIESet LSIRDYC to 1YesNo
LSERDYFLSE readyLSERDYIESet LSERDYC to 1YesNo
PSISRDYFPSIS readyPSISRDYIESet PSISRDYC to 1YesNo
PSIDIV3RDYFPSIDIV3 readyPSIDIV3RDYIESet PSIDIV3RDYC to 1YesNo
HSIKRDYFHSIK readyHSIKRDYIESet HSIKRDYC to 1YesNo
HSISRDYFHSIS readyHSISRDYIESet HSISRDYC to 1YesNo
HSIDIV3RDYFHSIDIV3 readyHSIDIV3RDYIESet HSIDIV3RDYC to 1YesNo
HSIKRDYFHSIK readyHSIKRDYIESet HSIKRDYC to 1YesNo
HSERDYFHSE readyHSERDYIESet HSERDYC to 1YesNo
TAMPITAMP3F(1)LSE CSS failureLSECSSON and ITAMP3E(1) and ITAMP3IE(1)Set CITAMP3F(1) to 1YesYes
NMILSECSSFLSE CSS failureLSECSSON(2)Set LSECSSC to 1YesYes
HSECSSFHSE CSS failureHSECSSON(3)Set HSECSSC to 1YesNo
  1. 1. The LSE CSS failure event (LSECSSD) is connected to TAMP internal tamper 3. To get the interrupt associated with this event, the internal tamper 3 must be enabled, and the internal tamper 3 interrupt must be enabled. The ITAMP3F, ITAMP3E, ITAMP3IE, and CITAMP3F bits are in the TAMP peripheral.
  2. 2. It is not possible to mask this interrupt when the security system feature is enabled (LSECSSON = 1).
  3. 3. It is not possible to mask this interrupt when the security system feature is enabled (HSECSSON = 1).

9.8 RCC registers

For the actual availability of some peripherals and their related bits, check the datasheet or Table 3: Memory map and peripheral register boundary addresses. If not present, consider them reserved, and keep them at the reset value.

9.8.1 RCC clock control register (RCC_CR1)

Address offset: 0x000

Reset value: 0x0000 0022

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.HSEEXTHSECSSONHSEBYPHSERDYHSEON
rwrsrwrrw
1514131211109876543210
Res.PSIKRDYPSIDIV3RDYPSISRDYPSIKERONPSIKONPSIDIV3ONPSISONRes.HSIKRDYHSIDIV3RDYHSISRDYHSIKERONHSIKONHSIDIV3ONHSISON
rrrrwrwrwrwrrrrwrwrwrw

Bits 31:21 Reserved, must be kept at reset value.

Bit 20 HSEEXT: External high speed clock type in Bypass mode

This bit is set and reset by software to select the external clock type (analog or digital). The external clock must be enabled with the HSEON bit to be used by the device. The HSEEXT bit can be written only if the HSE oscillator is disabled.

0: HSE in analog mode (default after reset)

1: HSE in digital mode

Bit 19 HSECSSON: HSE clock security system enable

This bit is set by software to enable clock security system on HSE. This bit is “set only” (disabled by a system reset or when the system enters in Standby mode). When HSECSSON is set, the clock detector is enabled by hardware when the HSE is ready and disabled by hardware if an oscillator failure is detected.

0: CSS on HSE off (clock detector off) (default after reset)

1: CSS on HSE on (clock detector on if the HSE oscillator is stable, off if not).

Bit 18 HSEBYP: HSE clock bypass

This bit is set and cleared by software to bypass the oscillator with an external clock. The external clock must be enabled with the HSEON bit to be used by the device. The HSEBYP bit can be written only if the HSE oscillator is disabled.

0: HSE oscillator not bypassed (default after reset)

1: HSE oscillator bypassed with an external clock

Bit 17 HSERDY: HSE clock ready flag

This bit is set by hardware to indicate that the HSE oscillator is stable.

0: HSE clock not ready (default after reset)

1: HSE clock ready

Bit 5 HSIDIV3RDY: HSIDIV3 clock ready flag

This bit is set by hardware to indicate that the HSI oscillator divided by 3 clock is stable.

0: HSIDIV3 clock not ready (default after reset)

1: HSIDIV3 clock ready

Bit 4 HSISRDY: HSIS clock ready flag

This bit is set by hardware to indicate that the HSIS clock is stable.

0: HSIS clock not ready (default after reset)

1: HSIS clock ready

Bit 3 HSIKERON: HSI clock enable in Stop mode

This bit is set and cleared by software to maintain HSI enabled in Stop 0 mode, to be quickly available as kernel clock for some peripherals. This bit only impact HSI if HSISON, HSIDIV3ON or HSIKON are set.

0: No effect on HSI (default after reset)

1: HSI keep ON in Stop 0 mode

Bit 2 HSIKON: HSIK clock enable

This bit is set and reset by software to enable/disable HSIK clock for peripheral. This bit value is kept under Stop 0 mode if HSIKERON is set, otherwise it is cleared.

0: HSIK off (default after reset)

1: HSIK on

Bit 1 HSIDIV3ON: HSIDIV3 clock enable

This bit is set and reset by software to enable/disable HSIDIV3 clock for system or peripheral. It is set by hardware to force the HSIDIV3 to on when product exit Standby mode, or in case of a failure of the HSE which is used directly or indirectly as the system clock source. This bit cannot be cleared if the HSIDIV3 is used directly (via SW mux) as system clock. This bit value is kept under Stop 0 mode if HSIKERON is set, otherwise it is cleared. This bit is set by hardware to force the HSIDIV3 to on when the system leaves Stop mode, if STOPWUCK = 0.

0: HSIDIV3 off

1: HSIDIV3 on (default after reset)

Bit 0 HSISON: HSIS clock enable

This bit is set and cleared by software to enable/disable HSIS clock for system and peripheral. This bit is set by hardware to force the HSI to on when the product leaves Stop mode, if STOPWUCK = 1. This bit value is kept under Stop 0 mode if HSIKERON is set, otherwise it is cleared. This bit cannot be cleared if the HSIS is used directly or indirectly (via SW mux) as system clock.

0: HSIS off (default after reset)

1: HSIS on

9.8.2 RCC clock control register (RCC_CR2)

Address offset: 0x004

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.PSIFREQ[1:0]Res.Res.Res.Res.Res.PSIREF[2:0]Res.Res.PSIREFSRC[1:0]
rwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.PSIKDIV[3:0]Res.Res.Res.Res.HSIKDIV[3:0]
rwrwrwrwrwrwrwrw

Bits 31:30 Reserved, must be kept at reset value.

Bits 29:28 PSIFREQ[1:0]: PSI target frequency configuration

This bitfield is set and reset by software to configure the PSI oscillator target frequency. Each bit can be written only if the PSI oscillator is disabled.

00: PSI nominal frequency = 100 MHz

01: PSI nominal frequency = 144 MHz

1x: PSI nominal frequency = 160 MHz

Bits 27:23 Reserved, must be kept at reset value.

Bits 22:20 PSIREF[2:0]: PSI reference clock frequency selection

This bitfield is set and cleared by software to indicate the adequate reference frequency connected to the PSI oscillator. Each bit can be written only if the PSI oscillator is disabled.

000: 32.768 kHz

001: 8 MHz

010: 16 MHz

011: 24 MHz

100: 25 MHz

101: 32 MHz

110: 48 MHz

111: 50 MHz

Bits 19:18 Reserved, must be kept at reset value.

Bits 17:16 PSIREFSRC[1:0]: PSI reference clock source selection

This bitfield is set and cleared by software to indicate the adequate reference clock source connected to the PSI oscillator. Each bit can be written only if the PSI oscillator is disabled.

00: HSE clock used as reference for PSI

01: LSE clock used as reference for PSI

10: HSI clock divided by 18 used as reference for PSI

Bits 15:12 Reserved, must be kept at reset value.

Bits 11:8 PSIKDIV[3:0]: PSI clock out divider factor

This bitfield is set and cleared by software to configure the PSIK clock based on PSI and its division factor.

0000: PSI clock divided by 1

0001: PSI clock divided by 1

0010: PSI clock divided by 1.5

0011: PSI clock divided by 2

0100: PSI clock divided by 2.5

....

1110: PSI clock divided by 7.5

1111: PSI clock divided by 8

Bits 7:4 Reserved, must be kept at reset value.

Bits 3:0 HSIKDIV[3:0]: HSI clock out divider factor

This bitfield is set and cleared by software to configure the HSIK clock based on HSI and its division factor.

0000: HSI clock divided by 1

0001: HSI clock divided by 1

0010: HSI clock divided by 1.5

0011: HSI clock divided by 2

0100: HSI clock divided by 2.5

....

1110: HSI clock divided by 7.5

1111: HSI clock divided by 8

9.8.3 RCC clock configuration register1 (RCC_CFGR1)

Address offset: 0x01C

Reset value: 0x0000 0000

Access: 0 ≤ wait state ≤ 2; word and half-word access

One or two wait states are inserted only if the access occurs during the clock source switch.

31302928272625242322212019181716
MCO2SEL[2:0]MCO2PRE[3:0]MCO1SEL[2:0]MCO1PRE[3:0]Res.Res.
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
RTCPRE[8:0]STOP
WUCK
Res.SWS[1:0]Res.SW[1:0]
rwrwrwrwrwrwrwrwrwrwrrrwrw

Bits 31:29 MCO2SEL[2:0]: Microcontroller clock output 2

This bitfield is set and cleared by software. Clock source selection may generate glitches on MCO2. It is highly recommended to configure these bits only after reset, before enabling the external oscillators.

000: system clock selected (sys_ck) (default after reset)

001: HSE clock selected (hse_ck)

010: LSE clock selected (lse_ck)

011: LSI clock selected (lsi_ck)

100: PSIK clock selected (psik_ck)

101: HSIK clock selected (hsik_ck)

110: PSIDIV3 clock selected (psidiv3_ck)

111: HSIDIV3 clock selected (hsidiv3_ck): if this clock is retained by HSIKERON, it is not visible on MCO output under the Stop 0 mode.

Other: Reserved

Bits 28:25 MCO2PRE[3:0]: MCO2 prescaler

This bitfield is set and cleared by software to configure the prescaler of the MCO2.

Modification of this prescaler may generate glitches on MCO2. It is highly recommended to change this prescaler only after reset, before enabling the external oscillators and the PLLs.

0000: Prescaler disabled (default after reset)

0001: Division by 1 (bypass)

0010: Division by 2

0011: Division by 3

0100: Division by 4

...

1111: Division by 15

Bits 24:22 MCO1SEL[2:0]: Microcontroller clock output 1

This bitfield is set and cleared by software. Clock source selection may generate glitches on MCO1. It is highly recommended to configure these bits only after reset, before enabling the external oscillators.

000: System clock selected (sys_ck) (default after reset)

001: HSE clock selected (hse_ck)

010: LSE clock selected (lse_ck)

011: LSI clock selected (lsi_ck)

100: PSIK clock selected (psik_ck)

101: HSIK clock selected (hsik_ck)

110: PSIS clock selected (psis_ck), if this clock is retained by PSIKERON, it is not visible on MCO output under the Stop 0 mode.

111: HSIS clock selected (hsis_ck), if this clock is retained by HSIKERON, it is not visible on MCO output under the Stop 0 mode.

Other: Reserved

Bits 21:18 MCO1PRE[3:0]: MCO1 prescaler

This bitfield is set and cleared by software to configure the prescaler of the MCO1.

Modification of this prescaler may generate glitches on MCO1. It is highly recommended to change this prescaler only after reset, before enabling the external oscillators and the PLLs.

0000: Prescaler disabled (default after reset)

0001: Division by 1 (bypass)

0010: Division by 2

0011: Division by 3

0100: Division by 4

...

1111: Division by 15

Bits 17:16 Reserved, must be kept at reset value.

Bits 15:7 RTCPRE[8:0]: HSE division factor for RTC clock (source of HSE_1MHz clock)

This bitfield is set and cleared by software to divide the HSE to generate a clock for RTC.

Caution: Software must set these bits correctly to ensure that the clock supplied to the RTC is lower than 1 MHz. These bits must be configured if needed before selecting the RTC clock source.

00000000: No clock (default after reset)

00000001: No clock

00000010: HSE/2

00000011: HSE/3

00000100: HSE/4

...

11111110: HSE/510

11111111: HSE/511

Bit 6 STOPWUCK: System clock selection after a wake-up from system Stop mode

This bit is set and reset by software to select the system wake-up clock from system Stop.

0: HSIDIV3 selected as wake-up clock from system Stop mode (default after reset)

1: HSIS selected as wake-up clock from system Stop mode

Bit 5 Reserved, must be kept at reset value.

Bits 4:3 SWS[1:0]: System clock switch status

This bitfield is set and reset by hardware to indicate which clock source is used as system clock.

00: HSIDIV3 used as system clock (hsidiv3_ck) (default after reset).

01: HSIS used as system clock (hsis_ck)

10: HSE used as system clock (hse_ck)

11: PSIS used as system clock (psis_ck)

Bit 2 Reserved, must be kept at reset value.

Bits 1:0 SW[1:0]: System clock and trace clock switch

This bitfield is set and reset by software to select system clock and trace clock sources (sys_ck). It is set by hardware to force the selection of the HSI or CSI (depending on STOPWUCK selection) when leaving a system Stop mode, and to force the selection of the HSI in case of failure of the HSE when used directly or indirectly as system clock

00: HSIDIV3 selected as system clock (hsidiv3_ck) (default after reset)

01: HSIS selected as system clock (hsis_ck)

10: HSE selected as system clock (hse_ck)

11: PSIS selected as system clock (psis_ck)

9.8.4 RCC CPU domain clock configuration register 2 (RCC_CFGR2)

Address offset: 0x020

Reset value: 0x0000 0000

1 or 2 wait states are inserted only if the access occurs during the clock source switch.

From 0 to 15 wait states are inserted if the access occurs when the APB or AHB prescalers values update is ongoing.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.APB3D
IS
APB2D
IS
APB1D
IS
AHB4D
IS
Res.AHB2D
IS
AHB1D
IS
rwrwrwrwrwrw
1514131211109876543210
Res.PPRE3[2:0]Res.PPRE2[2:0]Res.PPRE1[2:0]HPRE[3:0]
rwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:23 Reserved, must be kept at reset value.

Bit 22 APB3DIS: APB3 clock disable value.Set and cleared by software

This bit can be set to further reduce power consumption, when none of the APB3 peripherals are used, and when their clocks are disabled in RCC_APB3ENR. When this bit is set, all the APB3 peripheral clocks are off.

0: APB3 clock enabled, distributed to peripherals according to their dedicated clock enable control bits

1: APB3 clock disabled

Bits 10:8 PPRE2[2:0]: APB high-speed prescaler (APB2)

This bitfield is set and reset by software to control APB high-speed clocks division factor. The clocks are divided with the new prescaler factor from 1 to 16 APB cycles after PPRE2 write.

0xx: rcc_pclk2 = rcc_hclk1

100: rcc_pclk2 = rcc_hclk1/2

101: rcc_pclk2 = rcc_hclk1/4

110: rcc_pclk2 = rcc_hclk1/8

111: rcc_pclk2 = rcc_hclk1/16

Bit 7 Reserved, must be kept at reset value.

Bits 6:4 PPRE1[2:0]: APB low-speed prescaler (APB1)

This bitfield is set and reset by software to control the division factor of rcc_pclk1. The clock is divided by the new prescaler factor from 1 to 16 cycles of rcc_hclk after PPRE write.

0xx: rcc_pclk1 = rcc_hclk1 (default after reset)

100: rcc_pclk1 = rcc_hclk1/2

101: rcc_pclk1 = rcc_hclk1/4

110: rcc_pclk1 = rcc_hclk1/8

111: rcc_pclk1 = rcc_hclk1/16

Bits 3:0 HPRE[3:0]: AHB prescaler

This bitfield is set and reset by software to control the division factor of rcc_hclk. Changing this division ratio has an impact on the frequency of all bus matrix clocks

0xxx: rcc_hclk = sys_ck (default after reset)

1000: rcc_hclk = sys_ck/2

1001: rcc_hclk = sys_ck/4

1010: rcc_hclk = sys_ck/8

1011: rcc_hclk = sys_ck/16

1100: rcc_hclk = sys_ck/64

1101: rcc_hclk = sys_ck/128

1110: rcc_hclk = sys_ck/256

1111: rcc_hclk = sys_ck/512

9.8.5 RCC clock source interrupt enable register (RCC_CIER)

Address offset: 0x050

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.HSERD
YIE
PSIKR
DYIE
PSIDIV
3RDYI
E
PSISR
DYIE
HSIKR
DYIE
HSIDIV
3RDYI
E
HSISR
DYIE
LSERD
YIE
LSIRD
YIE
rwrwrwrwrwrwrwrwrw

Bits 31:9 Reserved, must be kept at reset value.

9.8.6 RCC clock source interrupt flag register (RCC_CIFR)

Address offset: 0x054

Reset value: 0x0000 0000

RM0522 9.8.6column_2column_3column_4column_5column_6column_7column_8column_9column_10column_11column_12column_13column_14column_15column_16
31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.LSECSHSECSPSIKRPSIDIVPSISRHSIKRHSIDIVHSISRLSERDLSIRD
SFRes.HSERD
SFYFDYF3RDYFDYFDYF3RDYFDYFYFYF
rrrrrrrrrrr
Bit 11LSECSSF: LSE clock security system interrupt flag
Bit 10HSECSSF: HSE clock security system interrupt flag
Bit 8HSERDYF: HSE ready interrupt flag
Bit 7PSIKRDYF: PSIK ready interrupt flag
Bit 6PSIDIV3RDYF: PSIDIV3 ready interrupt flag
Bit 5PSISRDYF: PSIS ready interrupt flag

Bits 31:12 Reserved, must be kept at reset value.

Bit 11 LSECSSF: LSE clock security system interrupt flag

Reset by software by writing LSECSSC bit. Set by hardware in case of LSE clock failure.

0: No clock security interrupt caused by LSE clock failure (default after reset)

1: Clock security interrupt caused by LSE clock failure

Bit 10 HSECSSF: HSE clock security system interrupt flag

Reset by software by writing HSECSSC bit. Set by hardware in case of HSE clock failure.

0: No clock security interrupt caused by HSE clock failure (default after reset)

1: Clock security interrupt caused by HSE clock failure

Bit 9 Reserved, must be kept at reset value.

Bit 8 HSERDYF: HSE ready interrupt flag

Reset by software by writing HSERDYC bit. Set by hardware when the HSE clock becomes stable and HSERDYIE is set.

0: No clock ready interrupt caused by the HSE (default after reset)

1: Clock ready interrupt caused by the HSE

Bit 7 PSIKRDYF: PSIK ready interrupt flag

Reset by software by writing PSIKRDYC bit.

Set by hardware when the PSIK clock becomes stable and PSIKDYIE is set.

0: No clock ready interrupt caused by PSIK (default after reset)

1: Clock ready interrupt caused by PSIK

Bit 6 PSIDIV3RDYF: PSIDIV3 ready interrupt flag

Reset by software by writing PSIDIV3RDYC bit.

Set by hardware when the PSIDIV3 clock becomes stable and PSIDIV3DYIE is set.

0: No clock ready interrupt caused by PSIDIV3 (default after reset)

1: Clock ready interrupt caused by PSIDIV3

Bit 5 PSISRDYF: PSIS ready interrupt flag

Reset by software by writing PSISRDYC bit.

Set by hardware when the PSIS clock becomes stable and PSISDYIE is set.

0: No clock ready interrupt caused by PSIS (default after reset)

1: Clock ready interrupt caused by PSIS

9.8.7 RCC clock source interrupt clear register (RCC_CICR)

Address offset: 0x058

Reset value: 0x0000 0000

9.8.7Bit 4 Bit 3 Bit 2 Bit 1 Bit 0HSIKRDYF HSISRDYF LSERDYF LSIRDYFHSIDIV3RDYFcolumn_5column_6column_7column_8column_9column_10column_11column_12column_13column_14column_15RM0522
31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.LSECSHSECSPSIKRPSIDIVPSISRHSIKRHSIDIVHSISRLSERDLSIRD
SCRes.HSERD
SCYCDYC3RDYCDYCDYC3RDYCDYCYCYC
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1
Bit 11LSECSSC: LSE clock security system interrupt clear
Bit 10HSECSSC: HSE clock security system interrupt clear

Bits 31:12 Reserved, must be kept at reset value.

ST logo
ST logo

9.8.8 RCC AHB1 reset register (RCC_AHB1RSTR)

Address offset: 0x060

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ETH1
RST
Res.RAMC
FGRST
Res.
rwrw
1514131211109876543210
Res.CORDI
CRST
Res.CRCR
ST
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LPDMA
2RST
LPDMA
1RST
rwrwrwrw

Bits 31:20 Reserved, must be kept at reset value.

Bit 19 ETH1RST: ETHERNET reset

Set and reset by software.

0: ETHERNET not reset (default after reset)

1: ETHERNET reset

Bit 18 Reserved, must be kept at reset value.

Bit 17 RAMCFGRST: RAMCFG reset

Set and reset by software.

0: RAMCFG not reset (default after reset)

1: RAMCFG reset

Bits 16:15 Reserved, must be kept at reset value.

Bit 14 CORDICRST: CORDIC reset

Set and reset by software.

0: CORDIC not reset (default after reset)

1: CORDIC reset

Bit 13 Reserved, must be kept at reset value.

Bit 12 CRCRST: CRC reset

Set and reset by software.

0: CRC not reset (default after reset)

1: CRC reset

Bits 11:2 Reserved, must be kept at reset value.

Bit 1 LPDMA2RST: LPDMA2 reset

Set and reset by software.

0: LPDMA2 not reset (default after reset)

1: LPDMA2 reset

Bit 0 LPDMA1RST: LPDMA1 reset

Set and reset by software.

0: LPDMA1 not reset (default after reset)

1: LPDMA1 reset

9.8.9 RCC AHB2 peripheral reset register (RCC_AHB2RSTR)

Address offset: 0x064

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.ADC3RSTRes.Res.CCBRSTSAESRSTPKARSTRNGRSTHASHRSTAESRST
rwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.DAC1RSTADC12RSTRes.Res.GPIOHRSTGPIOGRSTGPIOFRSTGPIOERSTGPIODRSTGPIOCRSTGPIOBRSTGPIOARST
rwrwrwrwrwrwrwrwrwrw

Bits 31:25 Reserved, must be kept at reset value.

Bit 24 ADC3RST: ADC3 reset

Set and reset by software.

0: ADC3 not reset (default after reset)

1: ADC3 reset

Bits 23:22 Reserved, must be kept at reset value.

Bit 21 CCBRST: CCB reset

Set and reset by software.

0: CCB not reset (default after reset)

1: CCB reset

Bit 20 SAESRST: SAES reset

Set and reset by software.

0: SAES not reset (default after reset)

1: SAES reset

Bit 19 PKARST: PKA reset

Set and reset by software.

0: PKA not reset (default after reset)

1: PKA reset

Bit 18 RNGRST: RNG reset

Set and reset by software.

0: RNG not reset (default after reset)

1: RNG reset

Bit 17 HASHRST: HASH reset

Set and reset by software.

0: HASH not reset (default after reset)

1: HASH reset

Bit 16 AESRST: AES reset

Set and reset by software.

0: AES not reset (default after reset)

1: AES reset

Bits 15:12 Reserved, must be kept at reset value.

9.8.10 RCC AHB4 peripheral reset register (RCC_AHB4RSTR)

Address offset: 0x06C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.XSPI1
RST
Res.Res.Res.Res.
rw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.

Bits 31:21 Reserved, must be kept at reset value.

Bit 20 XSPI1RST: XSPI1 reset

Set and reset by software.

0: XSPI1 not reset (default after reset)

1: XSPI1 reset

Bits 19:0 Reserved, must be kept at reset value.

9.8.11 RCC APB1 peripheral low reset register (RCC_APB1LRSTR)

Address offset: 0x074

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.UART7
RST
Res.Res.Res.Res.USART
6RST
CRSRSTI3C1RS
T
I2C2RS
T
I2C1RS
T
UART5
RST
UART4
RST
USART
3RST
USART
2RST
Res.
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SPI3R
ST
SPI2R
ST
OPAMP
1RST
Res.Res.Res.Res.Res.Res.TIM12
RST
TIM7R
ST
TIM6R
ST
TIM5R
ST
TIM4R
ST
TIM3R
ST
TIM2R
ST
rwrwrwrwrwrwrwrwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 UART7RST: UART7 reset

Set and reset by software.

0: UART7 not reset (default after reset)

1: UART7 reset

Bits 29:26 Reserved, must be kept at reset value.

Bit 25 USART6RST: USART6 reset

Set and reset by software.

0: USART6 not reset (default after reset)

1: USART6 reset

Bit 24 CRSRST: CRS reset

Set and reset by software.

0: CRS not reset (default after reset)

1: CRS reset

9.8.12 RCC APB1 peripheral high reset register (RCC_APB1HRSTR)

Address offset: 0x078

Reset value: 0x0000 0000

RM0522 9.8.12column_2Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0TIM7RST TIM6RST TIM5RST TIM4RST TIM3RST TIM2RST1: TIM7 reset 1: TIM6 reset 1: TIM5 reset 1: TIM4 reset 1: TIM3 reset 1: TIM2 reset: TIM7 reset : TIM6 reset : TIM5 reset : TIM4 reset : TIM3 reset : TIM2 resetcolumn_7column_8column_9column_10column_11column_12column_13column_14column_15column_16
31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.FDCAN
RSTRes.Res.Res.Res.Res.COMP
RST rwRes.Res.Res.
Bit 9FDCANRST: FDCAN1 and FDCAN2 reset

Bits 31:10 Reserved, must be kept at reset value.

Bits 8:4 Reserved, must be kept at reset value.

Bit 3 COMPRST: COMP reset
Set and reset by software.
0: COMP not reset (default after reset)
1: COMP reset

Bits 2:0 Reserved, must be kept at reset value.

9.8.13 RCC APB2 peripheral reset register (RCC_APB2RSTR)

Address offset: 0x07C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.USBRSTRes.Res.Res.Res.Res.TIM17RSTTIM16RSTTIM15RST
rwrwrwrw
1514131211109876543210
Res.USART1RSTTIM8RSTSPI1RSTTIM1RSTRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rwrwrwrw

Bits 31:25 Reserved, must be kept at reset value.

Bit 24 USBRST: USB reset
Set and reset by software.
0: USB not reset (default after reset)
1: USB reset

Bits 23:19 Reserved, must be kept at reset value.

Bit 18 TIM17RST: TIM17 reset
Set and reset by software.
0: TIM17 not reset (default after reset)
1: TIM17 reset

Bit 17 TIM16RST: TIM16 reset
Set and reset by software.
0: TIM16 not reset (default after reset)
1: TIM16 reset

Bit 16 TIM15RST: TIM15 reset
Set and reset by software.
0: TIM15 not reset (default after reset)
1: TIM15 reset

Bit 15 Reserved, must be kept at reset value.

Bit 14 USART1RST: USART1 reset
Set and reset by software.
0: USART1 not reset (default after reset)
1: USART1 reset

Bit 13 TIM8RST: TIM8 reset
Set and reset by software.
0: TIM8 not reset (default after reset)
1: TIM8 reset

Bit 12 SPI1RST: SPI1 reset
Set and reset by software.
0: SPI1 not reset (default after reset)
1: SPI1 reset

Bit 11 TIM1RST: TIM1 reset
Set and reset by software.
0: TIM1 not reset (default after reset)
1: TIM1 reset

Bits 10:0 Reserved, must be kept at reset value.

9.8.14 RCC APB3 peripheral reset register (RCC_APB3RSTR)

Address offset: 0x080

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.LPTIM1
RST
Res.Res.Res.Res.LPUAR
T1RST
Res.Res.Res.Res.SBSRS
T
Res.
rwrwrw

Bits 31:12 Reserved, must be kept at reset value.

Bit 11 LPTIM1RST: LPTIM1 reset
Set and reset by software.
0: LPTIM1 not reset (default after reset)
1: LPTIM1 reset

Bits 10:7 Reserved, must be kept at reset value.

Bit 6 LPUART1RST: LPUART1 reset
Set and reset by software.
0: LPUART1 not reset (default after reset)
1: LPUART1 reset

Bits 5:2 Reserved, must be kept at reset value.

Bit 1 SBSRST: SBS reset
Set and reset by software.
0: SBS not reset (default after reset)
1: SBS reset

Bit 0 Reserved, must be kept at reset value.

9.8.15 RCC AHB1 peripheral clock register (RCC_AHB1ENR)

Address offset: 0x088

Reset value: 0xC000 0100

31302928272625242322212019181716
SRAM1ENSRAM2ENRes.Res.Res.Res.Res.Res.Res.Res.ETH1RXENETH1TXENETH1ENETH1CKENRAMCFGENRes.
rwrwrwrwrwrwrw
1514131211109876543210
Res.CORDECENRes.CRCE NRes.Res.Res.FLASH ENRes.Res.Res.Res.Res.Res.LPDMA 2ENLPDMA 1EN
rwrwrwrwrw

Bit 31 SRAM1EN:SRAM1 clock enable

Set and reset by software.

0: SRAM1 clock disabled

1: SRAM1 clock enabled (default after reset)

Bit 30 SRAM2EN:SRAM2 clock enable

Set and reset by software.

0: SRAM2 clock disabled

1: SRAM2 clock enabled (default after reset)

Bits 29:22 Reserved, must be kept at reset value.

Bit 21 ETH1RXEN: ETH1RX clock enable

Set and reset by software.

0: ETH1RX clock disabled (default after reset)

1: ETH1RX clock enabled

Bit 20 ETH1TXEN: ETH1TX clock enable

Set and reset by software.

0: ETH1TX clock disabled (default after reset)

1: ETH1TX clock enabled

Bit 19 ETH1EN: ETH1 clock enable

Set and reset by software.

0: ETH1 clock disabled (default after reset)

1: ETH1 clock enabled

Bit 18 ETH1CKEN: ETH1 internal clock enable

Set and reset by software.

0: ETH1 internal clock disabled (default after reset)

1: ETH1 internal clock enabled

Bit 17 RAMCFGEN: RAMCFG clock enable

Set and reset by software.

0: RAMCFG clock disabled (default after reset)

1: RAMCFG clock enabled

Bits 16:15 Reserved, must be kept at reset value.

Bit 14 CORDICEN: CORDIC clock enable
Set and reset by software.
0: CORDIC clock disabled (default after reset)
1: CORDIC clock enabled

Bit 13 Reserved, must be kept at reset value.

Bit 12 CRCEN: CRC clock enable
Set and reset by software.
0: CRC clock disabled (default after reset)
1: CRC clock enabled

Bits 11:9 Reserved, must be kept at reset value.

Bit 8 FLASHEN: Flash interface clock enable
Set and reset by software.
0: FLASH clock disabled
1: FLASH clock enabled (default after reset)

Bits 7:2 Reserved, must be kept at reset value.

Bit 1 LPDMA2EN: LPDMA2 clock enable
Set and reset by software.
0: LPDMA2 clock disabled (default after reset)
1: LPDMA2 clock enabled

Bit 0 LPDMA1EN: LPDMA1 clock enable
Set and reset by software.
0: LPDMA1 clock disabled (default after reset)
1: LPDMA1 clock enabled

9.8.16 RCC AHB2 peripheral clock register (RCC_AHB2ENR)

Address offset: 0x08C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.ADC3ENRes.Res.CCBENSAESENPKAENRNGENHASHENAESEN
rwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.DAC1ENADC12ENRes.Res.GPIOHENGPIOGENGPIOFENGPIOEENGPIODENGPIOCENGPIOBENGPIOAEN
rwrwrwrwrwrwrwrwrwrw

Bits 31:25 Reserved, must be kept at reset value.

Bit 24 ADC3EN: ADC3 clock enable
Set and reset by software.
0: ADC3 clock disabled (default after reset)
1: ADC3 clock enabled

Bits 23:22 Reserved, must be kept at reset value.

9.8.17 RCC AHB4 peripheral clock register (RCC_AHB4ENR)

Address offset: 0x094

Reset value: 0x0000 0000

RM0522 9.8.17column_2Bit 4 Bit 3 Bit 2 Bit 1 Bit 0GPIOEEN GPIODEN GPIOCEN GPIOBEN GPIOAENcolumn_5column_6column_7column_8column_9column_10column_11column_12column_13column_14column_15column_16
31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.XSPI1
EN rwRes.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Bit 20XSPI1EN: XSPI1 clock enable
ST logo
ST logo

9.8.18 RCC APB1 peripheral clock register (RCC_APB1LENR)

Address offset: 0x09C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.UART7
EN
Res.Res.Res.Res.USART
6EN
CRSENI3C1ENI2C2ENI2C1ENUART5
EN
UART4
EN
USART
3EN
USART
2EN
Res.
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SPI3E
N
SPI2E
N
OPAMP
1EN
Res.WWDG
EN
Res.Res.Res.Res.TIM12E
N
TIM7E
N
TIM6E
N
TIM5E
N
TIM4E
N
TIM3E
N
TIM2E
N
rwrwrwrsrwrwrwrwrwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 UART7EN: UART7 clock enable

Set and reset by software.

0: UART7 clock disabled (default after reset)

1: UART7 clock enabled

Bits 29:26 Reserved, must be kept at reset value.

Bit 25 USART6EN: USART6 clock enable

Set and reset by software.

0: USART6 clock disabled (default after reset)

1: USART6 clock enabled

Bit 24 CRSEN: CRS clock enable

Set and reset by software.

0: CRS clock disabled (default after reset)

1: CRS clock enabled

Bit 23 I3C1EN: I3C1 clock enable

Set and reset by software.

0: I3C1 clock disabled (default after reset)

1: I3C1 clock enabled

Bit 22 I2C2EN: I2C2 clock enable

Set and reset by software.

0: I2C2 clock disabled (default after reset)

1: I2C2 clock enabled

Bit 21 I2C1EN: I2C1 clock enable

Set and reset by software.

0: I2C1 clock disabled (default after reset)

1: I2C1 clock enabled

Bit 20 UART5EN: UART5 clock enable

Set and reset by software.

0: UART5 clock disabled (default after reset)

1: UART5 clock enabled

9.8.19 RCC APB1 peripheral clock register (RCC_APB1HENR)

Address offset: 0x0A0

Reset value: 0x0000 0000

9.8.19column_2Bit 3 Bit 2 Bit 1 Bit 0TIM5EN TIM4EN TIM3EN TIM2ENcolumn_5column_6column_7column_8column_9column_10column_11column_12column_13column_14column_15RM0522
31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.FDCAN
ENRes.Res.Res.Res.Res.COMP
EN rwRes.Res.Res.
Bit 9FDCANEN: FDCAN1 and FDCAN2 clock enable
Bit 3COMPEN: COMP clock enable

Bits 31:10 Reserved, must be kept at reset value.

Bits 8:4 Reserved, must be kept at reset value.

Bits 2:0 Reserved, must be kept at reset value.

9.8.20 RCC APB2 peripheral clock register (RCC_APB2ENR)

Address offset: 0x0A4

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.USBENRes.Res.Res.Res.Res.TIM17ENTIM16ENTIM15EN
rwrwrwrw
1514131211109876543210
Res.USART1ENTIM8ENSPI1ENTIM1ENRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rwrwrwrw

Bits 31:25 Reserved, must be kept at reset value.

Bit 24 USBEN: USB clock enable

Set and reset by software.

0: USB clock disabled (default after reset)

1: USB clock enabled

Bits 23:19 Reserved, must be kept at reset value.

Bit 18 TIM17EN: TIM17 clock enable

Set and reset by software.

0: TIM17 clock disabled (default after reset)

1: TIM17 clock enabled

Bit 17 TIM16EN: TIM16 clock enable

Set and reset by software.

0: TIM16 clock disabled (default after reset)

1: TIM16 clock enabled

Bit 16 TIM15EN: TIM15 clock enable

Set and reset by software.

0: TIM15 clock disabled (default after reset)

1: TIM15 clock enabled

Bit 15 Reserved, must be kept at reset value.

Bit 14 USART1EN: USART1 clock enable

Set and reset by software.

0: USART1 clock disabled (default after reset)

1: USART1 clock enabled

Bit 13 TIM8EN: TIM8 clock enable

Set and reset by software.

0: TIM8 clock disabled (default after reset)

1: TIM8 clock enabled

Bit 12 SPI1EN: SPI1 clock enable

Set and reset by software.

0: SPI1 clock disabled (default after reset)

1: SPI1 clock enabled

Bit 11 TIM1EN: TIM1 clock enable
Set and reset by software.
0: TIM1 clock disabled (default after reset)
1: TIM1 clock enabled

Bits 10:0 Reserved, must be kept at reset value.

9.8.21 RCC APB3 peripheral clock register (RCC_APB3ENR)

Address offset: 0x0A8

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RTCAP
BEN
Res.Res.Res.Res.Res.
rw
1514131211109876543210
Res.Res.Res.Res.LPTIM1
EN
Res.Res.Res.Res.LPUAR
T1EN
Res.Res.Res.Res.SBSSENRes.
rwrwrw

Bits 31:22 Reserved, must be kept at reset value.

Bit 21 RTCAPBEN: RTC APB interface clock enable
Set and reset by software.
0: RTC APB interface clock disabled (default after reset)
1: RTC APB interface clock enabled

Bits 20:12 Reserved, must be kept at reset value.

Bit 11 LPTIM1EN: LPTIM1 clock enable
Set and reset by software.
0: LPTIM1 clock disabled (default after reset)
1: LPTIM1 clock enabled

Bits 10:7 Reserved, must be kept at reset value.

Bit 6 LPUART1EN: LPUART1 clock enable
Set and reset by software.
0: LPUART1 clock disabled (default after reset)
1: LPUART1 clock enabled

Bits 5:2 Reserved, must be kept at reset value.

Bit 1 SBSSEN: SBS clock enable
Set and reset by software.
0: SBS clock disabled (default after reset)
1: SBS clock enabled

Bit 0 Reserved, must be kept at reset value.

9.8.22 RCC AHB1 sleep clock register (RCC_AHB1LPENR)

Address offset: 0x0B0

Reset value: 0xC402 5103 (for STM32C53x/542/55x/562)

Reset value: 0xC43E 5103 (for STM32C59x/5A3)

31302928272625242322212019181716
SRAM1LPENSRAM2LPENRes.Res.Res.ICACHELPENRes.Res.Res.Res.ETH1RXLPENETH1TXLPENETH1LPENETH1CLKLPENRAMCFGLPENRes.
rwrwrwrwrwrwrwrw
1514131211109876543210
Res.CORICLPENRes.CRCLPENRes.Res.Res.FLASHLPENRes.Res.Res.Res.Res.Res.LPDMA2LPENLPDMA1LPEN
rwrwrwrwrw

Bit 31 SRAM1LPEN: SRAM1 clock enable during Sleep mode

Set and reset by software

0: SRAM1 clock disabled during Sleep mode

1: SRAM1 clock enabled during Sleep mode (default after reset)

Bit 30 SRAM2LPEN: SRAM2 clock enable during Sleep mode

Set and reset by software

0: SRAM2 clock disabled during Sleep mode

1: SRAM2 clock enabled during Sleep mode (default after reset)

Bits 29:27 Reserved, must be kept at reset value.

Bit 26 ICACHELPEN: ICACHE clock enable during Sleep mode

Set and reset by software.

0: ICACHE clock disabled during Sleep mode

1: ICACHE clock enabled during Sleep mode (default after reset)

Bits 25:22 Reserved, must be kept at reset value.

Bit 21 ETH1RXLPEN: ETH1RX clock enable during Sleep mode

Set and reset by software.

0: ETH1RX clock disabled during Sleep mode

1: ETH1RX clock enabled during Sleep mode (default after reset)

Bit 20 ETH1TXLPEN: ETH1TX clock enable during Sleep mode

Set and reset by software.

0: ETH1TX clock disabled during Sleep mode

1: ETH1TX clock enabled during Sleep mode (default after reset)

Bit 19 ETH1LPEN: ETH1 clock enable during Sleep mode

Set and reset by software.

0: ETH1 clock disabled during Sleep mode

1: ETH1 clock enabled during Sleep mode (default after reset)

Bit 18 ETH1CLKLPEN: ETH1 internal clock enable during Sleep mode

Set and reset by software.

0: ETH1 internal clock disabled during Sleep mode

1: ETH1 internal clock enabled during Sleep mode (default after reset)

9.8.23 RCC AHB2 sleep clock register (RCC_AHB2LPENR)

Address offset: 0x0B4

Reset value: 0x0007 0C9F (for STM32C53x/C542/C55x/C562)

Reset value: 0x013F 0CFF (for STM32C59x/C5A3)

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.ADC3LPENRes.Res.CCBLPENSAESLPENPKALPENRNGLPENHASHLPENAESLPEN
rwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.DAC1LPENADC12LPENRes.Res.GPIOHLPENGPIOGLPENGPIOFLPENGPIOELPENGPIOBPLPENGPIOCLPENGPIOBPLPENGPIOALPEN
rwrwrwrwrwrwrwrwrwrw

Bits 31:25 Reserved, must be kept at reset value.

Bit 6 GPIOGLPEN: GPIOG clock enable during Sleep mode

Set and reset by software.

0: GPIOG clock disabled during Sleep mode

1: GPIOG clock enabled during Sleep mode (default after reset)

Bit 5 GPIOFLPEN: GPIOF clock enable during Sleep mode

Set and reset by software.

0: GPIOF clock disabled during Sleep mode

1: GPIOF clock enabled during Sleep mode (default after reset)

Bit 4 GPIOELPEN: GPIOE clock enable during Sleep mode

Set and reset by software.

0: GPIOE clock disabled during Sleep mode

1: GPIOE clock enabled during Sleep mode (default after reset)

Bit 3 GPIODLPEN: GPIOD clock enable during Sleep mode

Set and reset by software.

0: GPIOD clock disabled during Sleep mode

1: GPIOD clock enabled during Sleep mode (default after reset)

Bit 2 GPIOCLPEN: GPIOC clock enable during Sleep mode

Set and reset by software.

0: GPIOC clock disabled during Sleep mode

1: GPIOC clock enabled during Sleep mode (default after reset)

Bit 1 GPIOBLPEN: GPIOB clock enable during Sleep mode

Set and reset by software.

0: GPIOB clock disabled during Sleep mode

1: GPIOB clock enabled during Sleep mode (default after reset)

Bit 0 GPIOALPEN: GPIOA clock enable during Sleep mode

Set and reset by software.

0: GPIOA clock disabled during Sleep mode

1: GPIOA clock enabled during Sleep mode (default after reset)

9.8.24 RCC AHB4 peripheral sleep clock register (RCC_AHB4LPENR)

Address offset: 0x0BC

Reset value: 0x0010 0000

column_1column_2Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1column_4GPIOGLPEN GPIOFLPEN GPIOELPEN GPIODLPEN GPIOCLPEN GPIOBLPENcolumn_6column_7column_8column_9column_10column_11column_12column_13column_14column_15RM0522
Bit 0GPIOALPEN: GPIOA clock enable during Sleep mode
31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.XSPI1L
PEN rwRes.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Bit 20XSPI1LPEN: XSPI1 clock enable during sleep mode

Bits 31:21 Reserved, must be kept at reset value.

Bit 20 XSPI1LPEN: XSPI1 clock enable during sleep mode

Set and reset by software.

0: XSPI1 clock disabled during sleep mode

1: XSPI1 clock enabled during sleep mode (default after reset)

Bits 19:0 Reserved, must be kept at reset value.

9.8.25 RCC APB1 sleep clock register (RCC_APB1LLPENR)

Address offset: 0x0C4

Reset value: 0x01BA 6871 (for STM32C53x/C542)

Reset value: 0x01FE C879 (for STM32C55x/C562)

Reset value: 0x43FE C87F (for STM32C59x/C5A3)

31302928272625242322212019181716
Res.UART7
LPEN
Res.Res.Res.Res.USART
6LPEN
CRSLP
EN
I3C1LP
EN
I2C2LP
EN
I2C1LP
EN
UART5
LPEN
UART4
LPEN
USART
3LPEN
USART
2LPEN
Res.
rwrwrwrwrwrwrwrwrwrw
1514131211109876543210
SPI3LP
EN
SPI2LP
EN
OPAMP
1LPEN
Res.WWDG
LPEN
Res.Res.Res.Res.TIM12L
PEN
TIM7LP
EN
TIM6LP
EN
TIM5LP
EN
TIM4LP
EN
TIM3LP
EN
TIM2LP
EN
rwrwrwrwrwrwrwrwrwrwrw

Bit 31 Reserved, must be kept at reset value.

Bit 30 UART7LPEN: UART7 clock enable during Sleep mode

Set and reset by software.

0: UART7 clock disabled during Sleep mode

1: UART7 clock enabled during Sleep mode (default after reset)

Bits 29:26 Reserved, must be kept at reset value.

Bit 25 USART6LPEN: USART6 clock enable during Sleep mode

Set and reset by software.

0: USART6 clock disabled during Sleep mode

1: USART6 clock enabled during Sleep mode (default after reset)

Bit 24 CRSLPEN: CRS clock enable during Sleep mode

Set and reset by software.

0: CRS clock disabled during Sleep mode

1: CRS clock enabled during Sleep mode (default after reset)

Bit 23 I3C1LPEN: I3C1 clock enable during Sleep mode

Set and reset by software.

0: I3C1 clock disabled during Sleep mode

1: I3C1 clock enabled during Sleep mode (default after reset)

Bit 22 I2C2LPEN: I2C2 clock enable during Sleep mode

Set and reset by software.

0: I2C2 clock disabled during Sleep mode

1: I2C2 clock enabled during Sleep mode (default after reset)

Bit 21 I2C1LPEN: I2C1 clock enable during Sleep mode

Set and reset by software.

0: I2C1 clock disabled during Sleep mode

1: I2C1 clock enabled during Sleep mode (default after reset)

9.8.26 RCC APB1 sleep clock register (RCC_APB1HLPENR)

Address offset: 0x0C8

Reset value: 0x4000 0208

RM0522 9.8.26column_2Bit 4 Bit 3 Bit 2 Bit 1 Bit 0TIM6LPEN TIM5LPEN TIM4LPEN TIM3LPEN TIM2LPENcolumn_5column_6column_7column_8column_9column_10column_11column_12column_13column_14column_15column_16
31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.FDCAN
LPENRes.Res.Res.Res.Res.COMP
LPEN rwRes.Res.Res.
Bit 9FDCANLPEN: FDCAN1 and FDCAN2 clock enable during Sleep mode
Bit 3COMPLPEN: COMP clock enable during Sleep mode

Bits 31:10 Reserved, must be kept at reset value.

Bits 8:4 Reserved, must be kept at reset value.

Bits 2:0 Reserved, must be kept at reset value.

9.8.27 RCC APB2 sleep clock register (RCC_APB2LPENR)

Address offset: 0x0CC

Reset value: 0x0107 7800 (for STM32C55x/562/59x/5A3)

Reset value: 0x0101 7800 (for STM32C53x/542)

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.USBLP
EN
Res.Res.Res.Res.Res.TIM17L
PEN
TIM16L
PEN
TIM15L
PEN
rwrwrwrw
1514131211109876543210
Res.USART
1LPEN
TIM8LP
EN
SPI1LP
EN
TIM1LP
EN
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rwrwrwrw

Bits 31:25 Reserved, must be kept at reset value.

Bit 24 USBLPEN: USB clock enable during Sleep mode

Set and reset by software.

0: USB clock disabled during Sleep mode

1: USB clock enabled during Sleep mode (default after reset)

Bits 23:19 Reserved, must be kept at reset value.

Bit 18 TIM17LPEN: TIM17 clock enable during Sleep mode

Set and reset by software.

0: TIM17 clock disabled during Sleep mode

1: TIM17 clock enabled during Sleep mode (default after reset)

Bit 17 TIM16LPEN: TIM16 clock enable during Sleep mode

Set and reset by software.

0: TIM16 clock disabled during Sleep mode

1: TIM16 clock enabled during Sleep mode (default after reset)

Bit 16 TIM15LPEN: TIM15 clock enable during Sleep mode

Set and reset by software.

0: TIM15 clock disabled during Sleep mode

1: TIM15 clock enabled during Sleep mode (default after reset)

Bit 15 Reserved, must be kept at reset value.

Bit 14 USART1LPEN: USART1 clock enable during Sleep mode

Set and reset by software.

0: USART1 clock disabled during Sleep mode

1: USART1 clock enabled during Sleep mode (default after reset)

Bit 13 TIM8LPEN: TIM8 clock enable during Sleep mode

Set and reset by software.

0: TIM8 clock disabled during Sleep mode

1: TIM8 clock enabled during Sleep mode (default after reset)

Bit 12 SPI1LPEN: SPI1 clock enable during Sleep mode

Set and reset by software.

0: SPI1 clock disabled during Sleep mode

1: SPI1 clock enabled during Sleep mode (default after reset)

Bit 11 TIM1LPEN: TIM1 clock enable during Sleep mode

Set and reset by software.

0: TIM1 clock disabled during Sleep mode

1: TIM1 clock enabled during Sleep mode (default after reset)

Bits 10:0 Reserved, must be kept at reset value.

9.8.28 RCC APB3 sleep clock register (RCC_APB3LPENR)

Address offset: 0x0D0

Reset value: 0x0020 0842

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RTCAP
BLPEN
Res.Res.Res.Res.Res.
rw
1514131211109876543210
Res.Res.Res.Res.LPTIM1
LPEN
Res.Res.Res.Res.LPUAR
T1LPE
N
Res.Res.Res.Res.SBSLP
EN
Res.
rwrwrw

Bits 31:22 Reserved, must be kept at reset value.

Bit 21 RTCAPBLPEN: RTC APB interface clock enable during Sleep mode

Set and reset by software.

0: RTC APB interface clock disabled during Sleep mode

1: RTC APB interface clock enabled during Sleep mode (default after reset)

Bits 20:12 Reserved, must be kept at reset value.

Bit 11 LPTIM1LPEN: LPTIM1 clock enable during Sleep mode

Set and reset by software.

0: LPTIM1 clock disabled during Sleep mode

1: LPTIM1 clock enabled during Sleep mode (default after reset)

Bits 10:7 Reserved, must be kept at reset value.

Bit 6 LPUART1LPEN: LPUART1 clock enable during Sleep mode

Set and reset by software.

0: LPUART1 clock disabled during Sleep mode

1: LPUART1 clock enabled during Sleep mode (default after reset)

Bits 5:2 Reserved, must be kept at reset value.

Bit 1 SBSLPEN: SBS clock enable during Sleep mode

Set and reset by software.

0: SBS clock disabled during Sleep mode

1: SBS clock enabled during Sleep mode (default after reset)

Bit 0 Reserved, must be kept at reset value.

9.8.29 RCC kernel clock configuration register (RCC_CCIPR1)

Address offset: 0x0D8

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.FDCANSEL[1:0]Res.Res.Res.Res.SPI3SEL[1:0]SPI2SEL[1:0]SPI1SEL[1:0]
rwrwrwrwrwrwrwrw
1514131211109876543210
LPUART1SEL[1:0]UART7SEL[1:0]USART6SEL[1:0]UART5SEL[1:0]UART4SEL[1:0]USART3SEL[1:0]USART2SEL[1:0]USART1SEL[1:0]
rwrwrwrwrwrwrwrwrwrwrwrwrwrwrwrw

Bits 31:28 Reserved, must be kept at reset value.

Bits 27:26 FDCANSEL[1:0]: FDCAN1 and FDCAN2 kernel clock source selection

Bits 25:22 Reserved, must be kept at reset value.

Bits 21:20 SPI3SEL[1:0]: SPI3 kernel clock source selection

Bits 19:18 SPI2SEL[1:0]: SPI2 kernel clock source selection

Bits 17:16 SPI1SEL[1:0]: SPI1 kernel clock source selection

Bits 15:14 LPUART1SEL[1:0]: LPUART1 kernel clock source selection

Bits 13:12 UART7SEL[1:0]: UART7 kernel clock source selection

9.8.30 RCC kernel clock configuration register (RCC_CCIPR2)

Address offset: 0x0DC

Reset value: 0x0000 0000

31302928272625242322212019181716
SYSTICKSEL[1:0]Res.Res.Res.Res.CK48SEL[1:0]Res.Res.Res.Res.Res.Res.LPTIM1SEL[1:0]
rwrwrwrwrwrw
1514131211109876543210
DACSELADCDACPRE[2:0]ADCDACSEL[1:0]Res.Res.I3C1SEL[1:0]Res.Res.I2C2SEL[1:0]I2C1SEL[1:0]
rwrwrwrwrwrwrwrwrwrwrwrw

Bits 3:2 I2C2SEL[1:0]: I2C2 kernel clock source selection
00: rcc_pclk1 selected as kernel clock (default after reset)
01: psik_ck selected as kernel clock
10: hsik_ck selected as kernel clock
Other: Reserved, kernel clock disabled

Bits 1:0 I2C1SEL[1:0]: I2C1 kernel clock source selection
00: rcc_pclk1 selected as kernel clock (default after reset)
01: psik_ck selected as kernel clock
10: hsik_ck selected as kernel clock
Other: Reserved, kernel clock disabled

9.8.31 RCC kernel clock configuration register (RCC_CCIPR3)

Address offset: 0x0E0

Reset value: 0x0000 0000

31302928272625242322212019181716
ETH1PTPDIV[3:0]ETH1CLKDIV[1:0]Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
rwrwrwrwrwrw
1514131211109876543210
Res.ETH1CLKSEL[1:0]Res.ETH1PTPCLKSEL[1:0]Res.ETH1REFCLKSELRes.Res.Res.Res.Res.Res.XSPI1SEL[1:0]
rwrwrwrwrwrwrw

Bits 31:28 ETH1PTPDIV[3:0]: Ethernet PTP clock division
This field selects the division factor of the PTP clock.
0000: divided by 1(default after reset)
0001: divided by 2
0010-1111: divided by {v+1}

Bits 27:26 ETH1CLKDIV[1:0]: Ethernet clock division
This field selects the division factor of the ETH1 clock.
00: divided by 1(default after reset)
01: divided by 2
10: divided by 4
11: Reserved

Bits 25:15 Reserved, must be kept at reset value.

Bits 14:13 ETH1CLKSEL[1:0]: ETH1 clock source selection
This field selects the reference clock of the PAD ETH1_CLK.
Set and reset by software.
00: kernel clock disabled (default after reset)
01: psis_ck selected as kernel clock
10: psik_ck selected as kernel clock
11: hse_ck selected as kernel clock

Bit 12 Reserved, must be kept at reset value.

Bits 11:10 ETH1PTPCLKSEL[1:0]: ETH1 PTP clock source selection

Set and reset by software.

00: kernel clock disabled (default after reset)

01: rcc_hclk1 selected as kernel clock

10: psis_ck selected as kernel clock

11: psik_ck selected as kernel clock

Bit 9 Reserved, must be kept at reset value.

Bit 8 ETH1REFCLKSEL: ETH1 RMII reference clock source selection

This bit selects the reference clock of the Ethernet for RMII mode. It must be set to 0 in any other mode than RMII.

0: ETH1_RMII_REF_CLK (default after reset)

1: eth_clk_fb

Bits 7:2 Reserved, must be kept at reset value.

Bits 1:0 XSPI1SEL[1:0]: XSPI1 kernel clock source selection

00: rcc_hclk4 selected as kernel clock (default after reset)

01: psik_ck selected as kernel clock

10: hsik_ck selected as kernel clock

Other: Reserved, kernel clock disabled

9.8.32 RCC RTC domain control register (RCC_RTCCR)

Address offset: 0x0F0

Reset value: 0x0000 0000

Reset by RTC domain reset.

Access: 0 ≤ wait state ≤ 3, word, half-word, and byte access.

Wait states are inserted in case of successive accesses to this register.

Note: After a system reset, this register is write-protected (except bits 27:26 and bit 16). To modify the RTC domain bits, the DRTCP bit in PWR_RTCCR must be set to 1. All bits (except bits 27:26 and bit 16) are reset only after an RTC domain reset (see Section 9.3.3). Other resets do not affect these bits.

31302928272625242322212019181716
Res.Res.Res.Res.LSIRDYLSIONLSCOS ELLSCOE NRes.Res.Res.Res.Res.Res.Res.RTCDR ST
rrwrwrwrw
1514131211109876543210
RTCENRes.Res.Res.Res.Res.RTCSEL[1:0]LSEEX TLSECS SDLSECS SONLSEDRV[1:0]LSEBY PLSERD YLSEON
rwrwrwrwrrwrwrwrwrrw

Bits 31:28 Reserved, must be kept at reset value.

Bit 27 LSIRDY: LSI oscillator ready

Set and cleared by hardware to indicate when the LSI oscillator is stable. After the LSION bit is cleared, LSIRDY goes low after three internal low-speed oscillator clock cycles.

This bit is set when the LSI is used by IWDG or RTC, even if LSION = 0.

0: LSI oscillator not ready

1: LSI oscillator ready

Bit 5 LSECSSON: LSE clock security system enable

Set by software to enable the clock security system on 32 kHz oscillator. This bit must be enabled after LSE is enabled (LSEON enabled) and ready (LSERDY set by hardware), and after RTCSEL is selected.

Once enabled, this bit cannot be disabled, except after a LSE failure detection (LSECSSD = 1). In that case, software must disable LSECSSON.

0: CSS on 32 kHz oscillator off (default after RTC domain reset)

1: CSS on 32 kHz oscillator on

Bits 4:3 LSEDRV[1:0]: LSE oscillator driving capability

Set by software to select the driving capability of the LSE oscillator.

These bits can be written only if LSE oscillator is disabled (LSEON = 0 and LSERDY = 0).

00: Lowest drive (default after RTC domain reset)

01: Medium-low drive

10: Medium-high drive

11: Highest drive

Bit 2 LSEBYP: LSE oscillator bypass

Set and reset by software to bypass oscillator in debug mode. This bit must not be written when the LSE is enabled (by LSEON) or ready (LSERDY = 1)

0: LSE oscillator not bypassed (default after RTC domain reset)

1: LSE oscillator bypassed

Bit 1 LSERDY: LSE oscillator ready

Set and reset by hardware to indicate when the LSE is stable. This bit needs 6 cycles of lse_ck clock to fall down after LSEON has been set to 0.

0: LSE oscillator not ready (default after RTC domain reset)

1: LSE oscillator ready

Bit 0 LSEON: LSE oscillator enabled

Set and reset by software. This bit cannot be cleared if the LSE is selected as reference clock for PSI with PSI enabled (PSISON bit or PSIDIV3ON bit or PSIKON bit set to 1).

0: LSE oscillator off (default after RTC domain reset)

1: LSE oscillator on

9.8.33 RCC reset status register (RCC_RSR)

Address offset: 0x0F4

Reset value: 0xXX00 0000

Reset by power-on reset only.

Access: 0 ≤ wait state ≤ 3, word, half-word, and byte access.

Wait states are inserted in case of successive accesses to this register.

31302928272625242322212019181716
LPWR
RSTF
WWDG
RSTF
IWDGR
STF
SFTRS
TF
BORR
STF
PINRS
TF
Res.Res.RMVFRes.Res.Res.Res.Res.Res.Res.
rrrrrrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.

9.8.34 RCC privilege configuration register (RCC_PRIVCFGR)

Address offset: 0x114

Reset value: 0x0000 0000

Access: no wait state; word, half-word, and byte access

This register can be written only by a privileged access. It can be read by privileged or unprivileged access.

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PRIVRes.
rw

Bits 31:2 Reserved, must be kept at reset value.

Bit 1 PRIV: RCC function privileged configuration

Set and reset by software. This bit can be written only by privileged access.

0: Read and write to RCC functions can be done by privileged or unprivileged access.

1: Read and write to RCC functions can be done by privileged access only

Bit 0 Reserved, must be kept at reset value.

9.8.35 RCC register map

Table 71. RCC register map and reset values

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x000RCC_CR1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.HSEEXTHSECSSONHSEBYPHSERDYHSEONRes.PSIKRDYPSIDIV3RDYPSISRDYPSIKERONPSIKONPSIDIV3ONPSISONRes.HSIKRDYHSIDIV3RDYHSISRDYHSIKERONHSIKONHSIDIV3ONHSISON
Reset value0000000000000000001
0x004RCC_CR2Res.Res.PSIFREQ[1:0]Res.Res.Res.Res.Res.PSIREF[2:0]Res.Res.Res.PSIREFSRC[1:0]Res.Res.Res.Res.PSIKDIV[3:0]Res.Res.Res.Res.HSIKDIV[3:0]
Reset value000000000000000
0x008 - 0x018Reserved
0x01CRCC_CFGR1MCO2SEL[2:0]MCO2PRE[3:0]MCO1SEL[2:0]MCO1PRE[3:0]Res.Res.RTCPRE[8:0]STOPWUCKRes.SWS[1:0]Res.SW[1:0]
Reset value0000000000000000000000000000

Table 71. RCC register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x020RCC_CFGR2Res.Res.Res.Res.Res.Res.Res.Res.Res.APB3DISAPB2DISAPB1DISAHB4DISRes.AHB2DISAHB1DISRes.PPRE3[2:0]Res.Res.PPRE2[2:0]Res.Res.PPRE1[2:0]HPRE[3:0]
Reset value0000000000000000000
0x024 -
0x04C
Reserved
0x050RCC_CIERRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.HSERDYIEPSIKRDYIEPSIDIV3RDYIEPSISRDYIEHSIKRDYIEHSIDIV3RDYIEHSISRDYIELSERDYIELSIRDYIE
Reset value000000000
0x054RCC_CIFRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LSECSSFHSECSSFRes.HSERDYFPSIKRDYFPSIDIV3RDYFPSISRDYFHSIKRDYFHSIDIV3RDYFHSISRDYFLSERDYFLSIRDYF
Reset value00000000000
0x058RCC_CICRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LSECSSCHSECSSCRes.HSERDYCPSIKRDYCPSIDIV3RDYCPSISRDYCHSIKRDYCHSIDIV3RDYCHSISRDYCLSERDYCLSIRDYC
Reset value00000000000
0x05CReserved
0x060RCC_AHB1RSTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.ETH1RSTRes.RAMCFGRSTRes.Res.Res.CORDICRSTRes.CRCRSTRes.Res.Res.Res.Res.Res.Res.Res.Res.LPDMA2RSTLPDMA1RST
Reset value000000
0x064RCC_AHB2RSTRRes.Res.Res.Res.Res.Res.ADC3RSTRes.Res.Res.CCBRSTSAESRSTPKARSTRNGRSTHASHRSTAESRSTRes.Res.Res.DAC1RSTADC12RSTRes.Res.Res.GPIOHRSTGPIOGRSTGPIOFRSTGPIOERSTGPIODRSTGPIOCRSTGPIOBRSTGPIOARST
Reset value00000000000000000
0x068Reserved
0x06CRCC_AHB4RSTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.XSPI1RSTRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value0
0x074RCC_APB1LRSTRRes.UART7RSTRes.Res.Res.Res.Res.USART6RSTCRSRSTI3C1RSTI2C2RSTI2C1RSTUART5RSTUART4RSTUSART3RSTUSART2RSTRes.SPI3RSTSPI2RSTOPAMP1RSTRes.Res.Res.Res.TIM12RSTTIM7RSTTIM6RSTTIM5RSTTIM4RSTTIM3RSTTIM2RSTRes.
Reset value00000000000000000000

Table 71. RCC register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x078RCC_APB1HRSTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FDCANRSTRes.Res.Res.Res.Res.COMPRSTRes.Res.Res.
Reset value00
0x07CRCC_APB2RSTRRes.Res.Res.Res.Res.Res.Res.USBRSTRes.Res.Res.Res.Res.TIM17RSTTIM16RSTTIM15RSTRes.USART1RSTTIM8RSTSPI1RSTTIM1RSTRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value00000000
0x080RCC_APB3RSTRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LPTIM1RSTRes.Res.Res.Res.LPUART1RSTRes.Res.Res.Res.Res.Res.
Reset value00
0x084Reserved
0x088RCC_AHB1ENRSRAM1ENSRAM2ENRes.Res.Res.Res.Res.Res.Res.Res.ETH1RXENETH1TXENETH1ENETH1CKENRAMCFGENRes.Res.CORDICENRes.CRCENRes.Res.Res.FLASHENRes.Res.Res.Res.Res.Res.LPDMA2ENLPDMA1EN
Reset value110000000100
0x08CRCC_AHB2ENRRes.Res.Res.Res.Res.Res.Res.ADC3ENRes.Res.CCBENSAESENPKAENRNGENHASHENAESENRes.Res.Res.Res.DAC1ENADC12ENRes.Res.GPIOHENGPIOGENGPIOFENGPIOEENGPIODENGPIOCENGPIOBENGPIOAEN
Reset value00000000000000000
0x090Reserved
0x094RCC_AHB4ENRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.XSPI1ENRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value0
0x09CRCC_APB1LENRRes.UART7ENRes.Res.Res.Res.USART6ENCRSENI3C1ENI2C2ENI2C1ENUART5ENUART4ENUSART3ENUSART2ENRes.SPI3ENSPI2ENOPAMP1ENRes.WWDGENRes.Res.Res.Res.TIM12ENTIM7ENTIM6ENTIM5ENTIM4ENTIM3ENTIM2EN
Reset value000000000000000000000
0x0A0RCC_APB1HENRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FDCANENRes.Res.Res.Res.Res.COMPENRes.Res.Res.
Reset value00
0x0A4RCC_APB2ENRRes.Res.Res.Res.Res.Res.Res.USBENRes.Res.Res.Res.Res.TIM17ENTIM16ENTIM15ENRes.USART1ENTIM8ENSPI1ENTIM1ENRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value00000000
ST logo
ST logo

Table 71. RCC register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x0A8RCC_APB3ENRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.RTCAPBENRes.Res.Res.Res.Res.Res.Res.Res.Res.LPTIM1ENRes.Res.Res.Res.LPUART1ENRes.Res.Res.Res.SBSENRes.
Reset value0000
0x0ACReserved
0x0B0RCC_AHB1LPENRSRAM1LPENSRAM2LPENRes.Res.Res.ICACHELPENRes.Res.Res.Res.ETH1RXLPENETH1TXLPENETH1LPENETH1CKLPENRAMCFGLPENRes.Res.CORDICLPENRes.CRCLPENRes.Res.Res.Res.FLASHLPENRes.Res.Res.Res.Res.LPDMA2LPENLPDMA1LPEN
Reset value1111111111111
0x0B4RCC_AHB2LPENRRes.Res.Res.Res.Res.Res.Res.ADC3LPENRes.Res.CCBLPENSAESLPENPKALPENRNGLPENHASHLPENAESLPENRes.Res.Res.Res.DAC1LPENADC12LPENRes.Res.Res.GPIOHLPENGPIOGLPENGPIOFLPENGPIOELPENGPIOCLPENGPIOBLPENGPIOALPEN
Reset value1111111111111111
0x0B8Reserved
0x0BCRCC_AHB4LPENRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.XSPI1LPENRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value1
0x0C4RCC_APB1LLPENRRes.UART7LPENRes.Res.Res.Res.USART6LPENCRSLPENI3C1LPENI2C2LPENI2C1LPENUSART5LPENUART4LPENUSART3LPENUSART2LPENRes.SPI3LPENSPI2LPENOPAMP1LPENRes.WWDGLPENRes.Res.Res.Res.TIM12LPENTIM7LPENTIM6LPENTIM5LPENTIM4LPENTIM3LPENTIM2LPEN
Reset value111111111111111111111
0x0C8RCC_APB1HLPENRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.FDCANLPENRes.Res.Res.Res.COMPLPENRes.Res.Res.Res.
Reset value11
0x0CCRCC_APB2LPENRRes.Res.Res.Res.Res.Res.USBLPENRes.Res.Res.Res.Res.Res.TIM17LPENTIM16LPENTIM15LPENRes.USART1LPENTIM8LPENSPI1LPENTIM1LPENRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset value11111111
0x0D0RCC_APB3LPENRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.RTCAPBLPENRes.Res.Res.Res.Res.Res.Res.Res.Res.LPTIM1LPENRes.Res.Res.Res.LPUART1LPENRes.Res.Res.Res.SBSLPENRes.
Reset value1111
0x0D4Reserved

Table 71. RCC register map and reset values (continued)

OffsetRegister name313029282726252423222120191817161514131211109876543210
0x0D8RCC_CCIPR1Res.Res.Res.Res.FDCANSEL[1:0]Res.Res.Res.Res.SPI3SEL[1:0]SPI2SEL[1:0]SPI1SEL[1:0]LPUART1SEL[1:0]UART7SEL[1:0]USART6SEL[1:0]UART5SEL[1:0]UART4SEL[1:0]USART3SEL[1:0]USART2SEL[1:0]USART1SEL[1:0]
Reset value000000000000000000000000
0x0DCRCC_CCIPR2SYSTICKSEL[1:0]Res.Res.Res.Res.CK48SEL[1:0]Res.Res.Res.Res.Res.Res.LPTIM1SEL[1:0]DACSELADCDACPRE[2:0]ADCDACSEL[1:0]Res.Res.I3C1SEL[1:0]Res.Res.I2C2SEL[1:0]I2C1SEL[1:0]
Reset value000000000000000000
0x0E0RCC_CCIPR3ETH1PTPDIV[3:0]ETH1CLKDIV[3:0]Res.Res.Res.Res.Res.Res.Res.Res.ETH1CLKSEL[1:0]Res.Res.ETH1PTPCLKSEL[1:0]Res.ETH1REFCLKSELRes.Res.Res.Res.Res.Res.XSPI1SEL[1:0]
Reset value000000000000000
0x0E4 - 0x0ECReserved
0x0F0RCC_RTCCRRes.Res.Res.Res.LSIRDYLSIONLSCOSELLSCOENRes.Res.Res.Res.Res.Res.Res.RTCDRSTRTCENRes.Res.Res.Res.Res.RTCSEL[1:0]LSEEXTLSECSSDLSECSSONLSEDRV[1:0]LSEBYPLSERDYLSEON
Reset value0000000000000000
0x0F4RCC_RSRLPWRRSTFWWDGRSTFIWDGRSTFSFTRSTFBORRSTFPINRSTFRes.Res.RMVFRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Reset valueXXXXXX0
0x0F8 - 0x110Reserved
0x114RCC_PRIVCFGRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.PRIVRes.
Reset value0
Refer to Section 2.2: Memory organization for the register boundary addresses.