6. Reset and clock controller (RCC)

The RCC block manages the clock and reset generation for all the peripherals of the STM32WB05xZ.

6.1 Reset management

6.1.1 General description

Figure 12. Reset generation shows the general principle of reset generation.

Figure 12. Reset generation

Figure 12. Reset generation diagram. The diagram shows the internal logic for reset generation within the SoC and the external NRSTn pad circuitry. Inside the SoC, four reset sources (PORESETn, POR/BOR reset, WDOG reset, and CPU LOCKUP reset) are inputs to an OR gate. The output of this OR gate is connected to a Pulse Generator (20us...80us). The Pulse Generator output is connected to a Spikes Filter. The Spikes Filter output is connected to the External NRSTn PAD. The External NRSTn PAD is also connected to VDD and GND. The NRSTn pad circuitry includes a pull-up resistor and a pull-down resistor. The output of the Spikes Filter is also connected to the PADRESETn output inside the SoC.
Figure 12. Reset generation diagram. The diagram shows the internal logic for reset generation within the SoC and the external NRSTn pad circuitry. Inside the SoC, four reset sources (PORESETn, POR/BOR reset, WDOG reset, and CPU LOCKUP reset) are inputs to an OR gate. The output of this OR gate is connected to a Pulse Generator (20us...80us). The Pulse Generator output is connected to a Spikes Filter. The Spikes Filter output is connected to the External NRSTn PAD. The External NRSTn PAD is also connected to VDD and GND. The NRSTn pad circuitry includes a pull-up resistor and a pull-down resistor. The output of the Spikes Filter is also connected to the PADRESETn output inside the SoC.

Note: The system reset information is output on the NRSTn pad to inform the external world and reset other elements on the board if needed.

Two different resets are available in the design:

Note: A Shutdown exit is equivalent to a POR/BOR situation and generates a PORESETn.

Note: The system reset is called PADRESETn as when an internal reset source is activated (watchdog, software, etc.), the NRSTn pad toggles to inform the external world a reset occurs.

This system reset resets all the resources of the device except:

The pulse generator guarantees a minimum reset pulse duration of 20 µs for each internal reset source. In case of reset from the NRSTn external pad, the reset pulse is generated when the pad is asserted low.

6.1.2 Power reset

The PORESETn signal is active when the power supply of the device is below a threshold value or when the regulator does not provide the target voltage. The PORESETn resets all the resources of the device.

6.1.3 Watchdog reset

The STM32WB05xZ device embeds a watchdog timer which may be used to recover from software crashes. See Section 20: Independent watchdog (IWDG) for details about watchdog usage and programming.

6.1.4 LOCKUP reset

The Cortex-M0+ generates a LOCKUP to indicate the core is in the lock-up state resulting from an unrecoverable exception. The LOCKUP reset is masked if a debugger is connected to the Cortex-M0+. The user can use the SWD to reset or recover the code in this case.

6.1.5 System reset request

The system reset request is generated by the debug circuitry of the Cortex-M0+. The debugger sets the SYSRESETREQ bit of the application interrupt and reset control register (AIRCR). This system reset request through the AIRCR can also be done by the embedded software (in hard fault handler for instance). For more details on the Cortex-M0+ system control and ID registers, refer to section B3.2.2 of the "ARMv6-M Architecture" reference manual.

6.1.6 Deepstop exit

The low-power Deepstop state leads to switching off a part of the 1.2 V (power domain called V12i), while keeping the rest of the 1.2 V at 1 V (power domain called V12o) and the 3.3 V (VDDIO).

When the device exits the Deepstop mode, only the V12i power domain is reset as it is the only power domain that lost the power supply.

6.2 Clock management

Three different clock sources may be used to drive the system clock (CLK_SYS) in the STM32WB05xZ:

The STM32WB05xZ has also a slow frequency clock tree used by some timers (RTC, watchdog, LPUART and MR_BLE radio timer). Four different clock sources can be used for this slow clock tree:

Figure 13. Clock tree generation provides an overview of the clock tree in the STM32WB05xZ.

Figure 13. Clock tree generation

Figure 13. Clock tree generation diagram showing the internal clock sources and their distribution to various system components.

The diagram illustrates the clock tree generation within the RCC. On the left, various clock sources are shown: LSI RCO (32 kHz), LSE OSC (32 kHz), HSE OSC (32 MHz), HSI RCO+PLL (64 MHz), and MCO (output of HSE, HSI, or CLK_16MHz/512). These sources are connected to multiplexers (LOCOSEL, HSESEL, MCOSEL). The main system clock (CLK_SYS) is derived from these sources through a series of dividers (SYSCLKPRE) and multiplexers (HSESEL). The diagram also shows the generation of various peripheral clocks: CLK_RTC, CLK_WDG, CLK_BLEWKUP (from CLK_16 MHz/512); CLK_TIM2, CLK_TIM16, CLK_TIM17 (from SYSCLKDIV); CLK_SYS (to CPU, AHB0, APB0, APB1, SRAM, PKA); CLK_LPUART (from LSE); CLK_SMPS (from SMPSDIV); CLKANA_ADC, CLK_USART, CLK_I2C, CLK_BLE16, CLK_FLASH, CLK_PWR, CLK_RNG (from CLK_16MHz); CLKSYS_BLE (from CLK_16MHz); CLK_BLE32, CLKDIG_ADC (from CLK_32MHz); and CLK_SPI3/I2S (from CLK_16MHz, RC64MPLL, and SPI3I2SCLKSEL).

Figure 13. Clock tree generation diagram showing the internal clock sources and their distribution to various system components.

6.2.1 System clock details

The HSI and the PLL64M clocks are provided by the same analog block called RC64MPLL. The 64 MHz clock output by this block can be:

Note: The usage of PLL64M or HSE as clock source is mandatory for Bluetooth radio operations (need of a high accuracy on the clock).

The software process to switch the system on the accurate clock is indicated in Section 6.7: Programmer model . This fast clock source is used to generate all the fast clocks of the device through dividers as shown in Figure 13. Clock tree generation .

After reset, the CLK_SYS is divided by four to provide a 16 MHz to the whole system (CPU, DMA, memories and peripherals).

Then the software can program another system clock frequency in the following list:

Note: Forbidden configuration means that the “in use” feature cannot work if the system clock runs at this frequency. Special care must be taken when programming the CLK_SYS as some constraints need to be respected: CLK_SYS frequency must be greater or equal to CLK_SYS_BLE.

6.2.2 Peripheral clock details

This fast clock source is also used to generate several internal fast clocks in the system:

Most of the peripherals use the system clock only (CLK_SYS) except:

Note: The CPU/system clock frequency must be equal or slower than the I 2 S clock frequency.

Table 15. CPU versus MR_BLE clock dependency

CLK_SYSCLK_SYS_BLE
1 MHz / 2 MHz / 4 MHz / 8 MHzNot possible to use MR_BLE IP
16 MHz16 MHz (CLKBLEDIV = 4)
32 MHz
  • 16 MHz (CLKBLEDIV = 4)
  • or 32 MHz (CLKBLEDIV = 2)
64 MHz
  • 16 MHz (CLKBLEDIV = 4)
  • or 32 MHz (CLKBLEDIV = 2)

Note: When the ADC is used, the system clock must run at minimum 8 Mhz to be able to read the ADC sample before they are overloaded by a new sample.

Note: To avoid SNR degradation of the ADC, SMPS and ADC clocks must be synchronous.

6.2.3 Slow clock frequency details

As explained at the beginning of the clock management sub-section, four different clock sources can be used for this slow clock tree:

Note: If the external oscillator is used, the PB12/PB13 I/Os are automatically connected to this feature when RCC_CR.LSEON bit is set (GPIO_MODERX configuration is overloaded).

Caution: If APC bit is set, the user has to disable the PUB12/PUB13/PDB12/PDB13 bits on PB12/PB13 by software I/O Port B pull-up control register (PWRC_PUCRB) to have the feature working well. Otherwise, if APC is reset, the pull-up, pull-down of PB12/13 are automatically configured.

Only one source at a time drives the whole low speed clock tree.

Note: By default after a PORESETn, all low speed sources are OFF. After a PADRESETn, the slow clock configuration is the one programmed before the PADRESETn.

The slow clock activation and selection are relevant during the Deepstop low-power mode and at wakeup as they clock the timers involved in wakeup events generation.

Note: If LSI configuration is used, the software must measure the slow clock frequency to know the associated period that is used by the timers. A slow clock measurement feature is available in the MR_BLE IP.

6.3 System frequency switch while MR_BLE is used

The CPU/system clock frequency can be from 1 MHz to 64 MHz while the MR_BLE clock frequency can be 16 MHz or 32 MHz.

When the radio is used on the device, the system clock frequency selection must respect some rules:

This proper system frequency switch is managed through the collaboration of several blocks:

Using this safe mechanism, the software requests a system clock frequency change and is informed by the hardware when the new frequency is really in place through a status bit (see Section 6.6.6: Clock switch command register (RCC_CSCMDR) ) and an associated interrupt line on the CPU (see Section 2.3.2: Interrupts ).

The software sequence is described in Section 6.7.3: Changing the system clock frequency while the MR_BLE is enabled .

6.4 Clock observation on external pad

It is possible to output some internal clocks on external pads:

This is possible by programming the associated I/O in the good alternate function (see Table 7. GPIO alternate options AF0, AF1 and AF2 modes and Table 8. GPIOs AF3, AF4 and AF6 modes ).

The selection of the clock to output for each I/O is programmable through an RCC register (see Section 6.6: RCC registers for more details).

Figure 14. RCC_LCO / RCC_MCO output clocks shows the possible configurations to output an internal clock.

Figure 14. RCC_LCO / RCC_MCO output clocks

Block diagram showing the configuration for RCC_LCO and RCC_MCO output clocks. The top part shows LSI and LSE inputs to a multiplexer controlled by RCC_CFGR.LCOSE[1:0], outputting to RCC_LCO. The bottom part shows multiple clock inputs (CLKANA_ADC, CLK_SMPS, CLK_SYS, HSE, HSI, CLK_16MHz/512) to a multiplexer controlled by RCC_CFGR.MCOSEL[2:0]. The output of this multiplexer goes to a prescaler block (/1, /2, /4, /8, /16, /32) controlled by RCC_CFGR.CCOPRE[2:0], which then outputs to RCC_MCO.
Block diagram showing the configuration for RCC_LCO and RCC_MCO output clocks. The top part shows LSI and LSE inputs to a multiplexer controlled by RCC_CFGR.LCOSE[1:0], outputting to RCC_LCO. The bottom part shows multiple clock inputs (CLKANA_ADC, CLK_SMPS, CLK_SYS, HSE, HSI, CLK_16MHz/512) to a multiplexer controlled by RCC_CFGR.MCOSEL[2:0]. The output of this multiplexer goes to a prescaler block (/1, /2, /4, /8, /16, /32) controlled by RCC_CFGR.CCOPRE[2:0], which then outputs to RCC_MCO.

DT56431V1

6.5 Miscellaneous

6.5.1 IO BOOSTER

Some analog switches are used to select the analog VINM/P pair input signals to be used by the ADC.

An IO BOOSTER block has been added to boost the voltage on the command of those analog switches when the VBAT goes below a threshold (2.7 V) to guarantee the good behavior of those switches. This block has to be enabled by the software when needed through RCC_CFGR.IOBOOSTEN bit.

6.6 RCC registers

Refer to Table 3. STM32WB05xZ memory map and peripheral register boundary addresses for the RCC base address location in the STM32WB05xZ.

6.6.1 Clock source control register (RCC_CR)

This register controls the enable on the different clock sources (low and high speed).

Note: The control bits linked to high speed clock source are reset on PADRESETn. The control bits linked to slow speed clock source are reset on PORESETn only (identified by the table footnote). As this register is in V12o power domain, its content is not modified after a wakeup from Deepstop and system clock is restored with configuration present before Deepstop mode entry.

Address offset: 0x00

Reset value: 0x0000 1400

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.HSERDYHSEON
rrw
1514131211109876543210
Res.HSIPLL RDYHSIPLL ONHSEPLL BUFONRes.HSIRDYLOCKDET_NSTOPLSEBYPLSERDYLSEONLSIRDYLSIONRes.Res.
rrwrwrrwrwrrwrrw
Bits 31:18Reserved, must be kept at reset value.
Bit 17HSERDY: External high speed clock flag.
This bit is set by hardware to indicate that HSE oscillator (32 MHz XO) is stable.
  • 0: HSE oscillator is not ready
  • 1: HSE oscillator is ready
Bit 16HSEON: External high speed clock enable.
The software has to set the bit to start the XO 32 MHz and clear the bit to stop it.
  • 0: HSE oscillator is OFF
  • 1: HSE oscillator is ON
Bit 15Reserved, must be kept at reset value.
Bit 14HSIPLL RDY: Internal high speed clock PLL flag.
This bit is set by hardware to indicate that the RC64MPLL pll is locked.
  • 0: RC64MPLL pll is unlocked
  • 1: RC64MPLL pll is locked
Bit 13HSIPLL ON: Internal high speed clock PLL enable.
The software has to set the bit to request an RC64MPLL lock on HSE and clear the bit to stop it.
  • 0: RC64MPLL PLL is OFF
  • 1: RC64MPLL PLL is ON
Bit 12HSEPLL BUFON: External high speed clock buffer for PLL RF2G4 enable.
The software has to set the bit when the radio is used (to have the 2.4 GHz PLL working).
  • 0: HSE PLL RF2G4 buffer is OFF
  • 1: HSE PLL RF2G4 buffer is ON
Warning: This bit must be set when the radio is used. The only reason to clear this bit would be to reduce power consumption for application not using the radio on this device.
Bit 11Reserved, must be kept at reset value.
Bit 10HSIRDY: Internal high speed clock flag.
This bit is set by hardware to indicate that internal 64 MHz RC is stable.
  • 0: Internal 64 MHz RC is not ready
  • 1: Internal 64 MHz RC is ready
Bits 9:7LOCKDET_NSTOP: Defines a time window target for the counter of the lock detector block in charge to manage the HSIPLLRDY information (PLL indicated as locked if the analog lock signal stays high and stable during this time window).
The formula to define the time window target is the following:
\[ \text{time window target} = (\text{LOCKDET\_NSTOP} + 1) \times 64. \]
Bit 6 (1)(2)LSEBYP: External low speed clock bypass.
This bit needs to be set when the slow clock is directly provided through RCC_OSC32_IN pin.
  • 0: No LSE oscillator bypass
  • 1: LSE oscillator bypass is enabled
Bit 5 (1)LSERDY: External low speed clock flag.
This bit is set by hardware to indicate that the slow clock has started.
  • 0: LSE oscillator is not ready
  • 1: LSE oscillator is ready
Note: This status bit is true whatever the chosen configuration (external 32 kHz oscillator --= LSEON or external clock provided on RCC_OSC32_IN = LSEBYP).
Bit 4 (1)(2)LSEON: External low speed clock enable.
The software has to set the bit to start the XO 32 kHz and clear the bit to stop it.
  • 0: LSE oscillator is OFF
  • 1: LSE oscillator is ON
Bit 3 (1)LSIRDY: Internal low speed clock flag.
This bit is set by hardware to indicate that internal low speed RC is stable.
  • 0: Internal low speed RC is not ready
  • 1: Internal low speed RC is ready
Bit 2 (1)LSION: Internal low speed RC clock enable.
The software has to set the bit to start the internal slow clock RO and clear the bit to stop it.
  • 0: LSI RC is OFF
  • 1: LSI RC is ON
Bits 1:0Reserved, must be kept at reset value.

1. This bit is reset on PORESETn and when the low speed clock is disabled at runtime.

2. The LSEBYP and LSEON bits must not be used at the same time. If the user decides to dynamically change the slow clock source between external XO and clock injection on RCC_OSC32_IN, they have to ensure both LSEON and LSEBYP are low at a time to reset the LSERDY flag.

6.6.2 Clocks configuration register (RCC_CFGR)

Note: The control bits linked to high speed clock source are reset on PADRESETn. The control bits linked to slow speed clock source are reset on PORESETn only (identified by the table footnote).

Address offset: 0x08

Reset value: 0x0000 0240

31302928272625242322212019181716
CCOPRE[2:0]MCOSEL[2:0]LCOSEL[1:0]SPI3I2SCLKSEL [1:0]Res.Res.LCOENOBOOSTCLKENIOBOOSTENCLKSLOWSEL[1]
rwrwrwrwrwrwrwrwrwrwrwrwrwrw
1514131211109876543210
CLKSLOWSEL[0]Res.LPUCLKSELSMPSDIVRes.CLKSYSDIV_STATUS[2:0]CLKSYSDIV[2:0]Res.HSESEL_STATUSSTOPHSIHSESELRes.
rwrwrwrrrrwrwrwrrwrw
Bits 31:29

CCOPRE: Configurable clock output prescaler.

  • • 000: CCO clock is divided by 1
  • • 001: CCO clock is divided by 2
  • • 010: CCO clock is divided by 4
  • • 011: CCO clock is divided by 8
  • • 100: CCO clock is divided by 16
  • • 101: CCO clock is divided by 32
  • • others: Reserved

Note: Glitches propagation possible if CCOPRE[2:0] value is modified while RCC_MCO output is enabled on the IO.

Bits 28:26

MCOSEL: Main configurable clock output selection.

  • • 000: RCC_MCO output disabled. No clock on RCC_MCO pad
  • • 001: system clock
  • • 010: Reserved
  • • 011: HSI_64M = RC64MPLL block output clock (can be internal 64 MHz or PLL 64 MHz accuracy)
  • • 100: HSE (external 32 MHz oscillator)
  • • 101: HSI_64M divided by 2048 clock
  • • 110: SMPS clock
  • • 111: ADC clock

Note: Glitches propagation possible if MCOSEL[2:0] value is modified while RCC_MCO output is enabled on the IO.

Bits 25:24 (1)

LCOSEL: Low speed configurable clock output selection.

  • • 00: RCC_LCO output disabled. No clock on RCC_LCO pad
  • • 01: not used
  • • 10: LSI (internal slow clock RC) clock
  • • 11: LSE (external 32 kHz)
Note: Glitches propagation possible if LCOSEL[1:0] value is modified while RCC_LCO output is enabled on the IO.
Bit 23:22SPI3I2SCLKSEL[1:0] : Selection of I 2 S clock for SPI3 IP.
  • 00: 16 MHz peripheral clock (default)
  • 01: 32 MHz peripheral clock
  • 1x: 64 MHz peripheral clock (available only when HSESEL=0)
Note: The I 2 S clock frequency must be higher or equal to the system clock (configured through RCC_CFGR.CLKSYSDIV[2:0] bit field).
Bits 21:20Reserved, must be kept at reset value.
Bit 19 (1)LCOEN : RCC_LCO enable on PA10 also in deepstop.
  • 0: RCC_LCO output on PA10 is disabled
  • 1: RCC_LCO output on PA10 is enabled
Bit 18IOBOOSTCKEN : IO BOOSTER clock enable (see Section 6.5.1: IO BOOSTER for details).
  • 0: IO BOOSTER block does not use RCC clock
  • 1: IO BOOSTER block uses RCC clock
Bit 17IOBOOSTEN : IO BOOSTER enable (see Section 6.5.1: IO BOOSTER for details).
  • 0: IO BOOSTER block is disabled
  • 1: IO BOOSTER block is enabled.
Bits 16:15 (1)CLKSLOWSEL : Low speed clock source selection.
  • 00: not used
  • 01: LSE (external oscillator). This source can be kept during Deepstop mode
  • 10: LSI (internal RC). This source can be kept during Deepstop mode
  • 11: always 16 MHz divided by 512
Note: No glitch mechanism has been added so glitches may appear on slow clock when the user changes its source.
Bit 14Reserved, must be kept at reset value.
Bit 13 (1)LPUCLKSEL : Selection of LPUART clock
  • 0: 16 MHz peripheral clock (default)
  • 1: LSE clock
Bit 12SMPSDIV : SMPS clock prescaling factor.
  • 0: SMPS clock is 8 MHz
  • 1: SMPS clock is 4 MHz
Bit 11Reserved, must be kept at reset value.
Bit 10:8CLKSYSDIV_STATUS : system clock frequency status. Set and cleared by hardware to indicate the actual system clock frequency. This register must be read to be sure that the new frequency, selected by CLKSYSDIV, has been applied.
  • 000: system clock frequency is 64 MHz
  • 001: system clock frequency is 32 MHz
  • 010: system clock frequency is 16 MHz
  • 011: system clock frequency is 8 MHz
  • 100: system clock frequency is 4 MHz
  • 101: system clock frequency is 2 MHz
  • 110: system clock frequency is 1 MHz
  • 111: not used.
The current clock frequency switching can be delayed of up to 128 system clock cycles, depending on the RCC internal counter status at the moment the new CLKSYSDIV is applied.
Bits 7:5CLKSYSDIV : System clock divided factor from HSI_64M.
  • 000: System clock frequency is 64 MHz ( not available when HSESEL=1 )
  • 001: System clock frequency is 32 MHz
  • 010: System clock frequency is 16 MHz
  • 011: System clock frequency is 8 MHz*
  • 100: System clock frequency is 4 MHz*
  • 101: System clock frequency is 2 MHz*
  • 110: System clock frequency is 1 MHz*
  • 111: not used

*: If RCC_APB2ENR.MRBLEEN bit is set, writing in CLKSYSDIV one of those values is replaced by a 010b = 16 MHz writing at hardware level.

Warning:

  • If the software programs the 64 MHz frequency target while the RCC_CFGR.HSESEL=1, the hardware switches the system clock tree on HSI64MPLL again (and restarts HSIPLL64M analog block if RCC_CFGR.STOPHSI=1).
  • To switch the system frequency between 64 / 32 / 16 MHz without risk when the MR_BLE is used, prefer the RCC_CSCMDR register to change the system frequency.
  • the MR_BLE frequency must always be equal or less than the CPU/system clock to have functional radio.
Bit 4Reserved, must be kept at reset value.
Bit 3HSESEL_STATUS : Clock source selection status.
  • 0: RC64MPLL clock source is selected (default)
  • 1: Direct HSE clock source is selected
Bit 2STOPHSI : RC64MPLL clock source stop request
  • 0: RC64MPLL is enabled (default)
  • 1: RC64MPLL disable requested

Note: If the CLKSYSDIV (from RCC_CFGR or RCC_CSCMDR registers) selects the 64 MHz frequency, the hardware automatically restarts the RC64MPLL block and switches on the RC64MPLL clock source.

Bit 1HSESEL : Clock source selection request.
  • 0: RC64MPLL clock source is requested (default)

In this case, the fast clock tree is sourced by the RC64MPLL block. The clock can be either the HSI or the PLL64M if the HSI PLL is locked.

  • 1: Direct HSE clock source is requested

In this case, the RC64MPLL block is not used and the maximum available frequency for the system clock tree is 32 MHz.

Bit 0Reserved, must be kept at reset value.

1. This bit is reset on PORESETn only.

6.6.3 Clocks Sources Software Calibration register (RCC_CSSWCR)

This register allows overloading the trimming values loaded automatically by hardware with other values.

Note: The control bits linked to high speed clock source are reset on PADRESETn. The control bits linked to high speed clock source are reset on PORESETn only (identified by the table footnote).

Address offset: 0x0C

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.HSITRIMSW[5:0]HSISWTRIMENRes.Res.Res.Res.Res.Res.Res.
rwrwrwrwrwrwrw
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.LSEDRVLSISWBW[3:0]LSISWTRIMEN
rwrwrwrwrwrwrw
Bits 31:30Reserved, must be kept at reset value.
Bits 29:24HSITRIMSW: High speed clock trimming set by software.
This value is taken into account instead of the trimming value loaded by HW at reset if HSISWTRIMEN bit is set.
Bit 23HSISWTRIMEN: High speed clock software trimming enable.
0: HW trimming value readable in RCC_ICSCR.HSITRIM[3:0] bit field is used as trimming value on RC64MPLL block.
1: trimming value written in RCC_CSSWCR.HSITRIMSW[3:0] bit field is used as trimming value on RC64MPLL block.
Bits 22:7Reserved, must be kept at reset value.
Bits 6:5 (1)LSEDRV: external 32 kHz crystal GM.
  • 00: low drive capability
  • 01: medium low drive capability
  • 10: medium high drive capability
  • 11: high drive capability
Bits 4:1 (1)LSISWBW: Low speed internal RC trimming value set by software.
This value is taken into account instead of the trimming value loaded by HW at reset if LSISWTRIMEN bit is set.
Bit 0 (1)LSISWTRIMEN: Low speed internal RC software trimming enable.
  • 0: HW trimming value readable in RCC_ICSCR.LSIBW[3:0] bit field is used as trimming value on the LSI.
  • 0: HW trimming value readable in RCC_ICSCR.LSIBW[3:0] bit field is used as trimming value on the LSI.

1. This bit is reset on PORESETn only.

6.6.4 Clock interrupt enable register (RCC_CIER)

This register controls the enable on interrupt sources.

This register is reset on PADRESETn.

Address offset: 0x18

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.LPURSTIEWDGRSTIERTCIRSTIEHSIPLLUNLOCKDETIEHSIPLLRDYIEHSERDYIEHSIRDYIERes.LSERDYIELSIRDYIE
r/wr/wr/wr/wr/wr/wr/wr/wr/w
Bits 31:10Reserved, must be kept at reset value.
Bit 9LPURSTIE: LPUART reset release interrupt enable.
  • 0: LPUART reset release interrupt is disabled
  • 1: LPUART reset release interrupt is enabled
Bit 8WDGRSTIE: Watchdog reset release interrupt enable.
  • 0: Watchdog reset release interrupt is disabled
  • 1: Watchdog reset release interrupt is enabled
Bit 7RTCIRSTIE: RTC reset release interrupt enable.
  • 0: RTC reset release interrupt is disabled
  • 1: RTC reset release interrupt is enabled
Bit 6HSIPLLUNLOCKDETIE: HSI PLL unlock detection interrupt enable.
  • 0: HSI PLL unlocked detection interrupt is disabled
  • 1: HSI PLL unlocked detection is enabled
Bit 5HSIPLLRDYIE: HSI PLL ready interrupt enable.
  • 0: HSI PLL locked interrupt is disabled
  • 1: HSI PLL locked interrupt is enabled
Bit 4HSERDYIE: HSE ready interrupt enable.
  • 0: HSE ready interrupt is disabled
  • 1: HSE ready interrupt is enabled
Bit 3HSIRDYIE: HSI ready interrupt enable.
  • 0: HSI ready interrupt is disabled
  • 1: HSI ready interrupt is enabled
Bit 2Reserved, must be kept at reset value.
Bit 1LSERDYIE: LSE ready interrupt enable.
  • 0: LSE ready interrupt is disabled
  • 1: LSE ready interrupt is enabled
Bit 0LSIRDYIE: LSI ready interrupt enable.
  • 0: LSI ready interrupt is disabled
  • 1: LSI ready interrupt is enabled

6.6.5 Clock interrupt flag register (RCC_CIFR)

This register provides the status flag linked to clock source ready state or not. It is also used to clear the flags.

This register is reset on PADRESETn.

Address offset: 0x1C

Reset value: 0x0000 0008

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.Res.Res.Res.Res.LPURSTFWDGRSTFRTCSTFHSIPLLUNLOCKDETFHSIPLLRDYFHSERDYFHSIRDYFRes.LSERDYFLSIRDYF
rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1rc_w1
Bits 31:10Reserved, must be kept at reset value.
Bit 9

LPURSTF: LPUART reset release flag.

  • 0: no LPUART reset release event occurred
  • 1: LPUART reset release event occurred. Cleared by writing 1 in this bit

Note: due to asynchronism slow clock/fast clock management, when the software request to release the LPUART reset by writing in the RCC_APB0RSTR.LPUARTRST, the reset release is effective only 2 slow clock periods or 2 16 MHz clock periods after the APB writing, depending on how it's configured LPCLKSEL bit in Clocks Configuration register (RCC_CFGR). This interrupt allows the software to be informed when the reset release is really done. Note: this flag is also set after any PORESETn.

Bit 8

WDGRSTF: Watchdog reset release flag.

  • 0: No watchdog reset release event occurred
  • 1: Watchdog reset release event occurred Cleared by writing 1 in this bit.

Note: Due to asynchronism slow clock/fast clock management, when the software request to release the Watchdog reset by writing in the RCC_APB0RSTR.WDGRST, the reset release is effective only 2 slow clock periods after the APB writing. This interrupt allows informing the software when the reset release is really done.

Note: This flag is also set after any PORESETn.

Bit 7

RTCSTF: RTC reset release flag.

  • 0: No RTC reset release event occurred
  • 1: RTC reset release event occurred. Cleared by writing 1 in this bit

Note: Due to asynchronism slow clock/fast clock management, when the software request to release the RTC reset by writing in the RCC_APB0RSTR.RTCRST, the reset release is effective only 2 slow clock periods after the APB writing. This interrupt allows informing the software when the reset release is really done.

Note: This flag is also set after any PORESETn.

Bit 6

HSIPLLUNLOCKDETF: HSI PLL unlock detection flag.

  • 0: No HSI PLL unlock event occurred
  • 1: HSI PLL unlock event occurred. Cleared by writing 1 in this bit
Bit 5

HSIPLLRDYF: HSI PLL ready flag.

  • 0: No HSI PLL locked event occurred
  • 1: HSI PLL locked event occurred. Cleared by writing 1 in this bit
Bit 4

HSERDYF: HSE ready flag.

  • 0: No HSE ready event occurred
  • 1: HSE ready event occurred. Cleared by writing 1 in this bit
Bit 3HSIRDYF: HSI ready flag.
  • 0: No HSI ready event occurred
  • 1: HSI ready event occurred. Cleared by writing 1 in this bit
Bit 2Reserved, must be kept at reset value.
Bit 1LSERDYF: LSE ready flag.
  • 0: No LSE ready event occurred
  • 1: LSE ready event occurred. Cleared by writing 1 in this bit
Bit 0LSIRDYF: LSI ready flag.
  • 0: No LSI ready event occurred
  • 1: LSI ready event occurred. Cleared by writing 1 in this bit

6.6.6 Clock switch command register (RCC_CSCMDR)

This register allows switching the CPU / system clock frequency safely while the MR_BLE is active.

Requesting a frequency clock switch holds the AHB/APB transfers between the MR_BLE and the rest of the system to execute safely the clock switching and release AHB / APB transfers as soon as the new frequency is in place.

A dedicated line of interrupt (instead of the RCC line) is used on the NVIC for the EOFSEQ_IRQ information (see Table 6. Interrupt vectors).

Note: Anyway, the user must keep the CPU/system frequency at minimum 16 MHz clock when the radio is used.

This register is reset on PADRESETn.

Address offset: 0x20

Reset value: 0x0000 0080

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
15141312111098765    43    2    10
Res.Res.Res.Res.Res.Res.Res.Res.EOFSEQ_IRQEOFSEQ_IESTATUS[1:0]CLKSYSDIV_REQ[2:0]REQUEST
rc_w1rwrrrwrwrwrw
Bits 31:8Reserved, must be kept at reset value.
Bit 7EOFSEQ_IRQ: End of sequence flag.
  • 0: No end of sequence event occurred
  • 1: End of sequence event occurred. Cleared by writing 1 in this bit. It is necessary to clear this bit before setting EOFSEQ_IE.
Bit 6EOFSEQ_IE: End of sequence interrupt enable.
  • 0: End of sequence interrupt is disabled
  • 1: End of sequence interrupt is enabled
Bits 5:4STATUS: Status of the switching sequence.
  • 00: IDLE = no switch sequence requested /on-going
  • 01: ONGOING = a system clock frequency switch is on-going
  • 10: DONE = a system clock frequency switch is done
  • 11: Reserved

This bit field is cleared when EOFSEQ_IRQ bit is cleared.

Bits 3:1CLKSYSDIV_REQ: System clock requested/targeted frequency.
Same format and same notes/warnings as SYSCLKDIV[2:0] bit field described in Section 6.6.2: Clocks configuration register (RCC_CFGR) .
Bit 0REQUEST: request to switch the system clock frequency.
Write 1 in this bit to request a system clock frequency switch (using CLKSYSDIV_REQ[2:0] information).
This bit is cleared by hardware when the clock frequency switch is done.
Note: Writing 0 in this bit aborts the frequency switch sequence if it is not yet finished. This action must not be used in the normal life of the application except if the end of sequence does not occur after a long time (to unblock the situation) but this is not supposed to occur.

6.6.7 AHB0 macro cells reset register (RCC_AHBRSTR)

This register allows resetting individually by software each IP located in the AHB0 mapping. This register is reset on PADRESETn.

Address offset: 0x30

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RNGRSTRes.PKARST
rwrw
1514131211109876543210
Res.Res.Res.CRCRSTRes.Res.Res.Res.Res.Res.Res.Res.GPIOBRSTGPIOARSTRes.DMARST
rwrwrwrw
Bits 31:19Reserved, must be kept at reset value.
Bit 18RNGRST: RNG reset.
  • 0: RNG IP is not under reset
  • 1: RNG IP is under reset
Bit 17Reserved, must be kept at reset value.
Bit 16PKARST: PKA reset.
  • 0: PKA IP is not under reset
  • 1: PKA IP is under reset
Note: PKA RAM no longer accessible by CPU when this bit is set.
Bits 15:13Reserved, must be kept at reset value
Bit 12CRCRST: CRC reset.
  • 0: CRC IP is not under reset
  • 1: CRC IP is under reset
Bits 11:4Reserved, must be kept at reset value.
Bit 3GPIOBRST: IO controller for port B reset.
  • 0: GPIOB IP is not under reset
  • 1: GPIOB IP is under reset
Bit 2GPIOARST: IO controller for port A reset.
  • 0: GPIOA IP is not under reset
  • 1: GPIOA IP is under reset
Bit 1Reserved, must be kept at reset value.
Bit 0DMARST: DMA and DMAMUX reset.
  • 0: DMA and DMAMUX IPs are not under reset
  • 1: DMA and DMAMUX IPs are under reset

6.6.8 APB0 macro cells reset register (RCC_APB0RSTR)

This register allows resetting individually by software each IP located in the APB0 mapping. This register is reset on PADRESETn.

Note: Each bit is set and reset by the software.

Address offset: 0x34

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.WDGRSTRes.RTCRSTRes.Res.Res.SYSCFGRSTRes.Res.Res.Res.Res.TIM17RSTTIM16RSTTIM2RST
rwrwrwrwrwrw
Bits 31:15Reserved, must be kept at reset value.
Bit 14WDGRST : Watchdog reset.
  • 0: Watchdog IP is not under reset
  • 1: Watchdog IP is under reset
Note: Due to asynchronism slow clock/fast clock management, when the software requests to release the RTC reset by writing 0 in the RCC_APB0RSTR.RTCRST, the reset release is effective only 2 slow clock periods after the APB writing. An interrupt/status flag is available to inform the software when the reset release is really done (refer to Section 6.6.5: Clock interrupt flag register (RCC_CIFR) ).
Bit 13Reserved, must be kept at reset value.
Bit 12RTCRST : RTC reset.
  • 0: RTC IP is not under reset
  • 1: RTC IP is under reset
Note: Due to asynchronism slow clock/fast clock management, when the software request to release the RTC reset by writing 0 in the RCC_APB0RSTR.RTCRST, the reset release is effective only 2 slow clock periods after the APB writing. An interrupt/status flag is available to inform the software when the reset release is really done (refer to Section 6.6.5: Clock interrupt flag register (RCC_CIFR) ).
Bits 11:9Reserved, must be kept at reset value.
Bit 8SYSCFGRST : System controller reset.
  • 0: System controller IP is not under reset
  • 1: System controller IP is under reset
Bits 7:3Reserved, must be kept at reset value.
Bit 2TIM17RST : TIM17 reset.
  • 0: TIM17 IP is not under reset
  • 1: TIM17 IP is under reset
Bit 1TIM16RST : TIM16 reset.
  • 0: TIM16 IP is not under reset
  • 1: TIM16 IP is under reset
Bit 0TIM2RST : TIM2 reset.
  • 0: TIM2 IP is not under reset
  • 1: TIM2 IP is under reset

6.6.9 APB1 macro cells reset register (RCC_APB1RSTR)

This register allows resetting individually by software each IP located in the APB1 mapping. This register is reset on PADRESETn.

Address offset: 0x38

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.I2C1RSTRes.Res.Res.Res.Res.
rw
1514131211109876543210
Res.SPI3RSTRes.Res.Res.USARTRSTRes.LPUARTRSTRes.Res.Res.ADCRSTRes.Res.Res.Res.
rwrwrwrw
Bits 31:22Reserved, must be kept at reset value.
Bit 21I2C1RST : I2C1 reset.
  • 0: I2C1 IP is not under reset
  • 1: I2C1 IP is under reset
Bits 20:15Reserved, must be kept at reset value.
Bit 14SPI3RST : SPI3 reset.
  • 0: SPI3 IP is not under reset
  • 1: SPI3 IP is under reset
Bits 13:11Reserved, must be kept at reset value.
Bit 10USARTRST : USART reset.
  • 0: USART IP is not under reset
  • 1: USART IP is under reset
Bit 9Reserved, must be kept at reset value.
Bit 8LPUARTRST : LPUART reset.
  • 0: LPUART IP is not under reset
  • 1: LPUART IP is under reset
Note: due to asynchronism slow clock/fast clock management, when the software request to release the LPUART reset by writing in the RCC_APB1RSTR.LPUARTRST, the reset release is effective only 2 slow clock periods after the APB writing. An interrupt/status flag is available to inform the software when the reset release is really done (see Section 6.6.5: Clock interrupt flag register (RCC_CIFR) registers).
Bits 7:5Reserved, must be kept at reset value.
Bit 4ADCRST : ADC reset.
  • 0: ADC IP is not under reset
  • 1: ADC IP is under reset
Bits 3:0Reserved, must be kept at reset value.

6.6.10 APB2 macro cells reset register (RCC_APB2RSTR)

This register allows resetting individually by software each IP located in the APB2 mapping (radio).

This register is reset on PADRESETn.

Address offset: 0x40

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.Res.Res.Res.Res.Res.Res.Res.Res.MRBLERST
Bits 31:1Reserved, must be kept at reset value.
Bit 0MRBLERST: MR_BLE (Bluetooth radio) reset.
  • 0: MR_BLE IP is not under reset
  • 1: MR_BLE IP is under reset

6.6.11 AHB0 macro cells clock enable register (RCC_AHBENR)

This register allows resetting individually by software each IP located in the AHB0 mapping.

Note: Each IP clock gating is controlled by only 1 bit which gates both AHB clock and kernel clock when the IP uses one.

This register is reset on PADRESETn.

Address offset: 0x50

Reset value: 0x0000 000C

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RNGRENRes.PKAEN
rwrw
1514131211109876543210
Res.Res.Res.CRENRes.Res.Res.Res.Res.Res.Res.Res.GPIOBENGPIOAENRes.DMAEN
rwrwrwrw
Bits 31:19Reserved, must be kept at reset value.
Bit 18RNGEN: RNG clock enable.
  • 0: RNG IP is clock gated
  • 1: RNG IP is clocked
Bit 17Reserved, must be kept at reset value.
Bit 16PKAEN: PKA enable.
  • 0: PKA IP is clock gated
  • 1: PKA IP is clocked
Note: PKA RAM no longer accessible by CPU when this bit is set.
Bits 15:13Reserved, must be kept at reset value.
Bit 12CREN: CRC enable.
  • 0: CRC IP is clock gated
  • 1: CRC IP is clocked
Bits 11:4Reserved, must be kept at reset value.
Bit 3GPIOBEN: IO controller for port B enable.
  • 0: GPIOB IP is clock gated
  • 1: GPIOB IP is clocked (default)
Bit 2GPIOAEN: IO controller for port A enable.
  • 0: GPIOA IP is clock gated
  • 1: GPIOA IP is clocked (default)
Bit 1Reserved, must be kept at reset value.
Bit 0DMAEN: DMA and DMAMUX enable.
  • 0: DMA and DMAMUX IPs are clock gated
  • 1: DMA and DMAMUX IPs are clocked

6.6.12 APB0 macro cell clock enable register (RCC_APB0ENR)

This register allows gating individually by software the clock of each IP located in the APB0 mapping.

Note: Each IP clock gating is controlled by only 1 bit, which gates both APB clock and kernel clock when the IP uses one.

This register is reset on PADRESETn (except one bit identified with a table footnote).

Address offset: 0x54

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.WDGENRes.RTCENRes.Res.Res.SYSCFGENRes.Res.Res.Res.Res.TIM17ENTIM16ENTIM2EN
rwrwrwrwrwrw
Bits 31:15Reserved, must be kept at reset value.
Bit 14WDGEN: Watchdog enable.
  • 0: Watchdog IP is clock gated
  • 1: Watchdog IP is clocked
WARNING: The software has to wait 2 slow clock cycles before using the IWDG IP after setting this bit due to a double resynchronization on slow clock.
Bit 13Reserved, must be kept at reset value.
Bit 12 (1)RTCEN: RTC enable.
  • 0: RTC IP is clock gated
  • 1: RTC IP is clocked
WARNING: The software has to wait 2 slow clock cycles before using the RTC IP after setting this bit due to a double resynchronization on slow clock.
Bit 11:9Reserved, must be kept at reset value.
Bits 8SYSCFGEN: System controller enable.
  • 0: System controller IP is clock gated
  • 1: System controller IP is clocked
Bits 7:3Reserved, must be kept at reset value
Bit 2TIM17EN: TIM17 enable
  • 0: TIM17 IP is clock gated
  • 1: TIM17 IP is clocked
Bit 1TIM16EN: TIM16 enable
  • • 0: TIM16 IP is clock gated
  • • 1: TIM16 IP is clocked
Bit 0TIM2EN: TIM2 enable
  • • 0: TIM2 IP is clock gated
  • • 1: TIM2 IP is clocked

1. This bit is reset on PORESETn only.

6.6.13 APB1 macro cells clock enable register (RCC_APB1ENR)

This register allows gating individually by software the clock of each IP located in the APB1 mapping.

Note: Each IP clock gating is controlled by only 1 bit, which gates both APB clock and kernel clock when the IP uses one.

This register is reset on PADRESETn.

Address offset: 0x58

Reset value: 0x0000 0000

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.I2C1ENRes.Res.Res.Res.Res.
rw
1514131211109876543210
Res.SPI3ENRes.Res.Res.USARTENRes.LPUARTENRes.Res.ADCANAENADCDIGENRes.Res.Res.Res.
rwrwrwrwrw
Bits 31:2Reserved, must be kept at reset value.
Bit 21I2C1EN: I2C1 enable.
  • • 0: I2C1 IP is clock gated
  • • 1: I2C1 IP is clocked
Bits 20:15Reserved, must be kept at reset value.
Bit 14SPI3EN: SPI3 enable.
  • • 0: SPI3 IP is clock gated
  • • 1: SPI3 IP is clocked
Bit 13:11Reserved, must be kept at reset value.
Bit 10USARTEN: USART enable.
  • • 0: USART IP is clock gated
  • • 1: USART IP is clocked
Bit 9Reserved, must be kept at reset value.
Bit 8LPUARTEN: LPUART enable.
  • • 0: LPUART IP is clock gated
  • • 1: LPUART IP is clocked

WARNING: the software has to wait for 2 slow clock cycles before using the LPUART IP after setting this bit due to a double resynchronization on slow clock.

Bits 7:6Reserved, must be kept at reset value.
Bit 5ADCANAEN: ADC clock enable for the analog part of the ADC block.
  • • 0: ADC analog IP is clock gated
  • • 1: ADC analog IP is clocked
Bit 4ADCDIGEN ADC clock enable for digital part of the ADC block.
  • • 0: ADC digital IP is clock gated
  • • 1: ADC digital IP is clocked
Bits 3:0Reserved, must be kept at reset value.

6.6.14 APB2 macro cells clock enable register (RCC_APB2ENR)

This register allows gating by software the MR_BLE clock located in the APB2 mapping (radio) and programming the frequency to be used by the MR_BLE IP.

Note: Gating the MR_BLE means both MR_BLE fast and slow clock trees (so including WAKEUP block).

This register is reset on PADRESETn.

Address offset: 0x60

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.Res.Res.Res.Res.Res.Res.CLKBLEDIVRes.MRBLEEN
rwrw
Bits 31:3Reserved, must be kept at reset value.
Bit 2

CLKBLEDIV: MR_BLE (Bluetooth ® LE radio) clock frequency selection when RCC_APB2ENR.MRBLEEN=1.

  • 00: Reserved

Note: Writing “00” by software is replaced by a write “01” in hardware.

  • 01: 32 MHz
  • 10: 16 MHz
  • 11: Reserved

Warning:

  • MR_BLE frequency must always be equal or less than the CPU/system clock to have functional radio.
  • When the ratio between system clock frequency and MR_BLE frequency is modified, the AHBUPCONV block must adapt the clock ratio on APB/AHB bus. Only dynamic CPU system clock switching is managed (see Section 6.6.6: Clock switch command register (RCC_CSCMDR) )

For this reason, using a static MR_BLE clock configuration is strongly recommended.

Bit 1Reserved, must be kept at reset value
Bit 0

MRBLEEN: MR_BLE (Bluetooth ® LE radio) enable.

  • 0: MR_BLE IP is clock gated
  • 1: MR_BLE IP is clocked

6.6.15 V33 reset status register (RCC_CSR)

This register provides the reset reason flags. It is set automatically by hardware on any new reset event and must be cleared by software.

Table 13. Flags versus CPU reboot reason provides a summary of active flags versus reset reason.

This register is reset on PORESETn.

Address offset: 0x94

Reset value: 0x0C00 0000

31302928272625242322212019181716
Res.LOCKUPRSTFWDGRSTFSFTRSTFPORRSTFPADRSTFRes.Res.RMVFRes.Res.Res.Res.Res.Res.Res.
rrrrrrc_w1
1514131211109876543210
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
Bit 31Reserved, must be kept at reset value.
Bit 30LOCKUPRSTF : CPU lock-up reset flag.
Set by the hardware when a CPU lock-up reset occurs. Reset by writing 1 in RMVF bit.
Bit 29WDGRSTF : Watchdog reset flag.
Set by the hardware when a watchdog reset occurs. Reset by writing 1 in RMVF bit.
Bit 28SFTRSTF : Software reset flag.
Set by the hardware when a CPU system reset occurs. Reset by writing 1 in RMVF bit.
Bit 27PORRSTF : Power-on reset flag.
Set by the hardware when a PORESETN or a BOR reset occurs. Reset by writing 1 in RMVF bit.
Bit 26PADRSTF : NRSTn pad reset flag.
Set by the hardware when a reset from external NRSTn pad occurs but also after any reset. This means the source of the reset is the NRSTn pad only if all flags are low except this one. Reset by writing 1 in RMVF bit.
Bits 25:24Reserved, must be kept at reset value.
Bit 23RMVF : Remove flag reset.
Writing 1 in this bit clears all the reset flags of this register. This bit is auto-cleared by the hardware.
Bits 22:0Reserved, must be kept at reset value.

6.6.16 RF software high speed external register (RCC_RFSWHSECR)

This register is reset on PADRESETn.

Address offset: 0x98

Reset value: 0x0000 0030

31302928272625242322212019181716
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.
1514131211109876543210
Res.Res.SWXOTUNE[5:0]SWXOTUNEE NGMC[2:0]SATRGRes.Res.Res.
rwrwrwrwrwrwrwrwrwrwrw
Bits 31:14Reserved, must be kept at reset value.
Bits 13:8SWXOTUNE: RF HSE capacitor bank tuning value set by software.
This value is taken into account instead of the trimming value loaded by HW at reset if SWXOTUNEEN bit is set.
Bit 7SWXOTUNEEN: RF HSE software capacitor bank tuning enable.
  • 0: Trimming value readable in RCC_RFHSECR.XOTUNE[5:0] bit field is used as trimming value on HSE
  • 1: Trimming value written in RCC_RFSWHSECR.SWXOTUNE[5:0] bit field is used as trimming value on HSE
Bits 6:4GMC: High speed external IO current control.
  • – 000: max. 0.18 mA/V
  • – 001: max. 0.57 mA/V
  • – 010: Max. 0.78 mA/V
  • – 011: Max. 1.13 mA/V
  • – 100: Max. 0.61 mA/V
  • – 101: Max. 1.65 mA/V
  • – 110: Max. 2.12 mA/V
  • – 111: Max. 2.84 mA/V
Note: This value is set only by software.
Bit 3SATRG: Sense amplifier threshold.
  • 0: The bias current is confronted to a reference current with a ratio of 1/2
  • 1: The bias current is confronted to a reference current with a ratio of 3/4
Bits 2:0Reserved, must be kept at reset value.

6.6.17 RF high speed external register (RCC_RFHSECR)

This register is reset on PADRESETn.

Address offset: 0x9C

Reset value: 0x0000 0000 when STM32WB05xZ flash memory is empty, or else depends on trimmed values flashed in the sample.

Note: The XOTUNE value depends on the choice of the external XO component. For this reason, the RCC_RFSWHSECR.SWXOTUNE bit field is the one to program and select before starting the XO.

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.XOTUNE[5:0]
rrrrrr
Bits 31:6Reserved, must be kept at reset value.
Bits 5:0XOTUNE: RF-HSE capacitor bank tuning.
This value is loaded by HW at reset as soon as the Flash controller achieves the reading of the information in Flash memory.

6.6.18 RCC register map

Refer to Section 2.2.2: Memory map and register boundary addresses for the RCC base address location in the STM32WB05xZ.

The grey cells indicate the register is in the V12o power domain and the pink cell indicates the register is in the VBAT (aka V33) power domain. This implies those registers are not reset on Deepstop exit.

Table 16. RCC register map and reset values

OffsetRegister313029282726252423222120191817161514131211109876543210
0x00RCC_CRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.HSE RDYHSE ONRes.HSI PLL RDYHSI PLL ONHSE PLL BUF ONRes.HSIRDYLOCKDET_NSTOPLSE BYPLSE RDYLSE ONLSIRDYLSIONRes.Res.
Reset value00001100000000
0x04Reserved
0x08RCC_CFGRCCOPREMCOSELLCOSELSPI3/2SCLKSELRes.Res.LCOENIOBOOSTCKENIOBOOSTENCLKSLOWSELRes.LPUCLKSELSMPSDIVRes.CLKSYSDIV_STATUSCLKSYSDIVRes.HSESEL_STATUSSTOPHSIHSESELRes.
Reset value000000000000000000000010010000
0x0C(RCC_CSSW_CR)Res.Res.HSITRIMSW[5:0]SISW_TRIMENRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LSEDRVLSISWBW[3:0]LSISW_TRIMEN
Reset value000000000000000
0x010-014Reserved
STMicroelectronics logo
STMicroelectronics logo
OffsetRegister313029282726252423222120191817161514131211109876543210
0x18RCC_CIER 1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LPURSTIEHSIPLLUNLOCKDETIE
Reset value0000000
0x1CRCC_CIFR 1Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.LPURSTFHSIPLLUNLOCKDETIF
Reset value0000001
0x20RCC_CSCM 1
DR
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.EOFSEQ_IRQEOFSEQ_IESTATUS[1:0]CLKSYSDIV_REQ[2:0]
Reset value1000000
0x24-0
x2C
Reserved
0x30RCC_AHBR 1
STR
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RNGRSTRes.PKARSTRes.Res.Res.CRCRSTRes.Res.Res.Res.Res.Res.Res.Res.Res.GPIOBRSTGPIOARSTRes.DMARST
Reset value0000000
OffsetRegister313029282726252423222120191817161514131211109876543210
0x34RCC_APB0
RSTR
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.WDGRSTRes.RTCRSTRes.Res.Res.SYSCFGRSTRes.Res.Res.Res.Res.TIM17RSTTIM16RSTTIM2RST
Reset value0000
0x38RCC_APB1
RSTR
Res.Res.Res.Res.Res.Res.Res.Res.I2C2RSTRes.I2C1RSTRes.Res.Res.Res.Res.Res.SPI3RSTRes.Res.Res.USARTRSTRes.LPUARTRSTRes.Res.Res.ADCRSTRes.Res.Res.Res.
Reset value000000
0x3CReserved
0x40RCC_APB2
RSTR
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.Res.Res.MRBLERST
Reset value0
0x44-0x4CReserved
0x50RCC_AHBENRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.RNGENRes.PKAENRes.Res.Res.CRCENRes.Res.Res.Res.Res.Res.Res.Res.GPIOBENGPIOAENRes.DMAEN
Reset value0001100
0x54RCC_APB0
ENR
Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.WDGENRes.RTCENRes.Res.Res.SYSCFGENRes.Res.Res.Res.Res.TIM17ENTIM16ENTIM2EN
Reset value000
OffsetRegister313029282726252423222120191817161514131211109876543210
0x58RCC_APB1_ENRRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.I2C1ENRes.Res.Res.Res.Res.Res.SPI3ENRes.Res.Res.USARTFNus 2LPUARTENRes.Res.ADCANAFNADCDIGFNRes.Res.Res.Res.
Reset value000000
0x5CReserved
0x60RCC_APB2_ENRRes.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.CLKBLEDIVRes.MRBLEEN
Reset value00
0x64-0x90Reserved
0x94RCC_CSRRes.LOCKUPRSTFWDGRSTFSFTRSTFPORRSTFPADRRSTFRes.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 value000110
0x98RCC_RFSW_HSEC_RRes.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.Res.SWXOTUNESWXOTUNEENGMCSATRGRes.Res.
Reset value00000000110
0x9CRCC_RFHSEC_RRes.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.XOTUNE
Reset value-----

6.7 Programmer model

The STM32WB05xZ embeds up to 192 kBytes of internal flash memory. A flash interface implements instruction access and data access based on the AHB protocol. It implements the logic necessary to carry out the Flash memory operations (Program/Erase) controlled through the flash registers.

6.7.1 Switch the system on the PLL64M clock tree

To switch the system from the HSI clock source to the PLL64M clock source, the user has to:

  1. 1. Enable the HSE (32 MHz external crystal)
  2. 2. Wait for the HSE ready flag information (through interrupt or by polling)
  3. 3. Request to enable the PLL
  4. 4. Wait for the PLL ready flag information (through interrupt or by polling). From this point, the clock source for the whole fast clock tree is the accurate PLL64M source.

Note: A status flag and an associated interrupt are available to inform the software in case of HSIPLL64M unlock event. See RCC_CIER and RCC_CIFR registers.

6.7.2 Use the direct HSE instead of the RC64MPLL block

If the application does not target to use the 64 MHz system clock frequency, the system can be configured to use directly the 32 MHz provided by the external XO (HSE).

This configuration choice is supposed to be static and to be used when 64 MHz is never used.

In this case, the software has to:

  1. 1. Ensure the RCC_CR.CLKSYSDIV bit field is programmed with a system frequency less than 64 MHz
  2. 2. Enable the external XO (by setting the RCC_CR.HSEON if not yet done)
  3. 3. Wait for the HSE ready flag information (through interrupt or by polling)
  4. 4. Set the RCC_CFGR.HSESEL bit to switch the fast clock tree on HSE path. If both clocks (HSI and HSE) are present, the switch should take around 4 clock cycles
  5. 5. To save power, the software can stop the RC64MPLL analog block by setting the RCC_CFGR.STOPHSI bit.

Note: A hardware mechanism is in place to restart the RC64MPLL and switch back the clock tree on it if the HSERDY is low or if the CLKSYSDIV bit field has been programmed to request 64 MHz.

The HSE configuration is not lost on a Deepstop sequence. So at wakeup, the system restarts the HSE (thanks to HEON bit) and clock tree switches HSE back on as soon as the HSERDY flag is set. In the meantime, the clock tree is run on the RC64MPLL block. If the STOPHSI was high before the Deepstop, the RC64MPLL analog is switched off as soon as the clock tree is back on HSE path.

Caution: The HSE configuration is not lost on a Deepstop sequence. So at wakeup, the system restarts the HSE (thanks to HEON bit). However, the SW has to switch the system clock back to HSI or PLL64M path to be able to enter in Deepstop/Shutdown, so at wakeup:

6.7.3 Changing the system clock frequency while the MR_BLE is enabled

As long as the MR_BLE is enabled (by setting the RCC_APB2ENR.MRBLEEN), the application software has no guarantee the radio is running or about to start a sequence that makes the MR_BLE IP perform an AHB access to the RAM. Changing the system clock, and by this action changing the ratio between MR_BLE clock domain and system clock domain, could instigate a crash if not managed carefully.

For this reason, a hardware mechanism has been put in place and must be used to change the system frequency when MR_BLE is ON.

The sequence to execute to change the system clock is the following:

  1. 1. Ensure the targeted frequency is greater than or equal to the MR_BLE frequency (visible in RCC_APB2ENR.CKBLEDIV[1:0])
  2. 2. Program the wanted frequency in the RCC_CSCMDR.CLKSYSDIV bit field and set the RCC_CSCMDR.REQUEST bit
  3. 3. Wait for the RCC_CSCMDR.EOFSEQ_IRQ flag information (through interrupt or by polling)
  4. 4. When the flag (and the interrupt if enabled) is set, the system is running on the new frequency
  5. 5. The RCC_CFGR.CLKSYSDIV[1:0] bit field has been updated by hardware to the new frequency value.

Note: If the software requested a frequency below 16 MHz, the current final frequency is 16 MHz (associated value is readable in the RCC_CFGR.CLKSYSDIV[1:0]). If the software requested a frequency at 16 MHz while the MR_BLE is clocked at 32 MHz, the wanted frequency is used but the radio scenario is no longer functional.