The MSI is made of four internal RC oscillators: MSIRC0 (48 MHz), MSIRC1 (4 MHz), MSIRC2 (3.072 MHz), and MSIRC3 (400 kHz). Each oscillator feeds a prescaler providing a division by 1, 2, 3 or 4.
Two output clocks are generated from these divided oscillators:
- MSIS that can be selected as system clock
- MSIK that can be selected by some peripherals as kernel clock
MSIS and MSIK frequency range can be adjusted by software, by using respectively the MSISRANGE [3:0] and MSIKRANGE [3:0] fields in RCC_ICSCR1, with MSIRGSEL = 1. Sixteen frequency ranges are available, generated from the four internal RCs (refer to document AN5373_general-info.html#id_14462__entry_msl_1fh_dvb for more details).
The MSI clock can also be used as a backup clock source (auxiliary clock) if the HSE crystal oscillator fails (refer to section Clock security system (CSS) in document AN5373_general-info.html#id_14462__entry_msl_1fh_dvb).
The MSI oscillator provides a low-cost (no external components) low-power clock source. In addition, when the MSI is used in PLL‑mode with the LSE, it provides a very accurate clock source that can be used by the USB OTG_FS peripheral, and feeds the PLL to run the system at the maximum speed 160 MHz.
Hardware auto calibration with LSE (PLL-mode)
When a 32.768 kHz external oscillator is present in the application, either MSIS or MSIK can be configured in a PLL‑mode. This mode is enabled as follows:
- for MSIS: by setting the MSIPLLEN bit to 1 in RCC_CR
- for MSIK: by setting the MSIPLLEN bit to 0 in RCC_CR
In case MSIS and MSIK ranges are generated from the same MSIRC source, the PLL‑mode is applied on both MSIS and MSIK. When configured in PLL‑mode, the MSIS or MSIK automatically calibrates itself thanks to the LSE. This mode is available for all MSI frequency ranges. At 48 MHz, the MSIK in PLL‑mode can be used for the USB OTG_FS peripheral, avoiding the need of an external high‑speed crystal.
For more details on how to measure the MSI frequency variation, refer to section Internal/external clock measurement with TIM15/TIM16/TIM17 in document AN5373_general-info.html#id_14462__entry_msl_1fh_dvb.
Note: On STM32U5Ax/59x/5Fx/5Gx, the OTG_HS peripheral cannot be clocked by the MSI in PLL‑mode. The HSE crystal must be used.