RM0503-STM32U0

This reference manual targets application developers. It provides complete information on how to use the STM32U0 series microcontroller memory and peripherals.

The STM32U0 series are microcontroller lines with different packages and peripherals.

Refer to the corresponding data briefs for ordering information, mechanical and electrical device characteristics.

For information on the Arm ® Cortex ® -M0+ core, refer to the Cortex ® -M0+ Technical Reference Manual .

The STM32U0 series microcontrollers include ST state-of-the-art patented technology.

Contents

3.4.2FLASH option byte programming . . . . .76
3.5Flash memory protection . . . . .78
3.5.1FLASH read protection (RDP) . . . . .78
3.5.2FLASH write protection (WRP) . . . . .82
3.5.3Securable memory area (HDP) . . . . .83
3.5.4Securable memory area extension (HDP extension) . . . . .83
3.5.5Disabling core debug access . . . . .85
3.5.6Forcing boot from main flash memory . . . . .85
3.6FLASH interrupts . . . . .85
3.7FLASH registers . . . . .86
3.7.1FLASH access control register (FLASH_ACR) . . . . .86
3.7.2FLASH key register (FLASH_KEYR) . . . . .87
3.7.3FLASH option key register (FLASH_OPTKEYR) . . . . .87
3.7.4FLASH status register (FLASH_SR) . . . . .88
3.7.5FLASH control register (FLASH_CR) . . . . .90
3.7.6FLASH ECC register (FLASH_ECCR) . . . . .92
3.7.7FLASH option register (FLASH_OPTR) . . . . .93
3.7.8FLASH WRP area A address register (FLASH_WRP1AR) . . . . .95
3.7.9FLASH WRP area B address register (FLASH_WRP1BR) . . . . .95
3.7.10FLASH security register (FLASH_SECR) . . . . .96
3.7.11FLASH OEM1 key register 1 (FLASH_OEM1KEYR1) . . . . .97
3.7.12FLASH OEM1 key register 2 (FLASH_OEM1KEYR2) . . . . .97
3.7.13FLASH OEM1 key register 3 (FLASH_OEM1KEYR3) . . . . .97
3.7.14FLASH OEM1 key register 4 (FLASH_OEM1KEYR4) . . . . .98
3.7.15FLASH OEM2 key register 1 (FLASH_OEM2KEYR1) . . . . .98
3.7.16FLASH OEM2 key register 2 (FLASH_OEM2KEYR2) . . . . .99
3.7.17FLASH OEM2 key register 3 (FLASH_OEM2KEYR3) . . . . .99
3.7.18FLASH OEM2 key register 4 (FLASH_OEM2KEYR4) . . . . .99
3.7.19FLASH OEM key status register (FLASH_OEMKEYSR) . . . . .100
3.7.20FLASH HDP control register (FLASH_HDPCR) . . . . .100
3.7.21FLASH HDP extension register (FLASH_HDPEXTR) . . . . .101
3.7.22FLASH register map . . . . .102
4Power control (PWR) . . . . .104
4.1Power supplies . . . . .104
4.1.1Independent analog peripherals supply . . . . .105
4.1.2Independent USB transceivers supply . . . . .106
4.4.16Power Port E pull-up control register (PWR_PUCRE) . . . . .145
4.4.17Power Port E pull-down control register (PWR_PDCRE) . . . . .146
4.4.18Power Port F pull-up control register (PWR_PUCRF) . . . . .147
4.4.19Power Port F pull-down control register (PWR_PDCRF) . . . . .147
4.4.20PWR register map and reset value table . . . . .148
5Reset and clock control (RCC) . . . . .150
5.1Reset . . . . .150
5.1.1Power reset . . . . .150
5.1.2System reset . . . . .150
5.1.3RTC domain reset . . . . .152
5.2Clocks . . . . .153
5.2.1HSE clock . . . . .157
5.2.2HSI16 clock . . . . .158
5.2.3HSI48 clock . . . . .159
5.2.4MSI clock . . . . .159
5.2.5PLL . . . . .160
5.2.6LSE clock . . . . .161
5.2.7LSI clock . . . . .161
5.2.8System clock (SYSCLK) selection . . . . .162
5.2.9Clock source frequency versus voltage scaling . . . . .162
5.2.10Clock security system (CSS) . . . . .162
5.2.11Clock security system for LSE clock (LSECSS) . . . . .163
5.2.12ADC clock . . . . .163
5.2.13RTC clock . . . . .164
5.2.14Timer clock . . . . .164
5.2.15Watchdog clock . . . . .164
5.2.16Clock-out capability . . . . .165
5.2.17Internal/external clock measurement with TIM16 . . . . .165
5.2.18Peripheral clock enable registers . . . . .167
5.3Low-power modes . . . . .167
5.4RCC registers . . . . .169
5.4.1Clock control register (RCC_CR) . . . . .169
5.4.2Internal clock sources calibration register (RCC_ICSCR) . . . . .172
5.4.3Clock configuration register (RCC_CFGR) . . . . .173
5.4.4PLL configuration register (RCC_PLLCFGR) . . . . .176
5.4.5Clock interrupt enable register (RCC_CIER) . . . . .178
5.4.6Clock interrupt flag register (RCC_CIFR) . . . . .180
5.4.7Clock interrupt clear register (RCC_CICR) . . . . .181
5.4.8AHB peripheral reset register (RCC_AHBRSTR) . . . . .182
5.4.9I/O port reset register (RCC_IOPRSTR) . . . . .184
5.4.10APB peripheral reset register 1 (RCC_APBSTR1) . . . . .185
5.4.11APB peripheral reset register 2 (RCC_APBSTR2) . . . . .188
5.4.12AHB peripheral clock enable register (RCC_AHBENR) . . . . .189
5.4.13I/O port clock enable register (RCC_IOPENR) . . . . .190
5.4.14Debug configuration register (RCC_DBGCFGR) . . . . .191
5.4.15APB peripheral clock enable register 1 (RCC_APBENR1) . . . . .192
5.4.16APB peripheral clock enable register 2(RCC_APBENR2) . . . . .195
5.4.17AHB peripheral clock enable in Sleep mode register
(RCC_AHBSMENR) . . . . .
196
5.4.18I/O port in Sleep mode clock enable register (RCC_IOPSMENR) . . . . .197
5.4.19APB peripheral clock enable in Sleep/Stop mode register 1
(RCC_APBSMENR1) . . . . .
198
5.4.20APB peripheral clock enable in Sleep/Stop mode register 2
(RCC_APBSMENR2) . . . . .
202
5.4.21Peripherals independent clock configuration register (RCC_CCIPR) . . . . .203
5.4.22RTC domain control register (RCC_BDCR) . . . . .205
5.4.23Control/status register (RCC_CSR) . . . . .207
5.4.24RCC clock recovery RC register (RCC_CRRRCR) . . . . .209
5.4.25RCC register map . . . . .210
6Clock recovery system (CRS) . . . . .214
6.1CRS introduction . . . . .214
6.2CRS main features . . . . .214
6.3CRS implementation . . . . .214
6.4CRS functional description . . . . .215
6.4.1CRS block diagram . . . . .215
6.4.2CRS internal signals . . . . .215
6.4.3Synchronization input . . . . .216
6.4.4Frequency error measurement . . . . .216
6.4.5Frequency error evaluation and automatic trimming . . . . .217
6.4.6CRS initialization and configuration . . . . .218
6.5CRS in low-power modes . . . . .219
6.6CRS interrupts . . . . .219
6.7CRS registers . . . . .219
6.7.1CRS control register (CRS_CR) . . . . .219
6.7.2CRS configuration register (CRS_CFGR) . . . . .220
6.7.3CRS interrupt and status register (CRS_ISR) . . . . .221
6.7.4CRS interrupt flag clear register (CRS_ICR) . . . . .223
6.7.5CRS register map . . . . .224
7General-purpose I/Os (GPIO) . . . . .225
7.1Introduction . . . . .225
7.2GPIO main features . . . . .225
7.3GPIO functional description . . . . .225
7.3.1General-purpose I/O (GPIO) . . . . .227
7.3.2I/O pin alternate function multiplexer and mapping . . . . .228
7.3.3I/O port control registers . . . . .229
7.3.4I/O port state in low-power modes . . . . .229
7.3.5I/O port data registers . . . . .229
7.3.6I/O data bitwise handling . . . . .229
7.3.7GPIO locking mechanism . . . . .230
7.3.8I/O alternate function input/output . . . . .230
7.3.9External interrupt/wake-up lines . . . . .230
7.3.10Input configuration . . . . .231
7.3.11Output configuration . . . . .231
7.3.12Alternate function configuration . . . . .232
7.3.13Analog configuration . . . . .233
7.3.14Using the HSE or LSE oscillator pins as GPIOs . . . . .234
7.3.15Using the GPIO pins in the RTC supply domain . . . . .234
7.3.16Using PF3 as GPIO . . . . .234
7.3.17Reset pin (PF2-NRST) in GPIO mode . . . . .234
7.4GPIO registers . . . . .235
7.4.1GPIO port mode register (GPIOx_MODER) (x = A to F) . . . . .235
7.4.2GPIO port output type register (GPIOx_OTYPER) (x = A to F) . . . . .235
7.4.3GPIO port output speed register (GPIOx_OSPEEDR) (x = A to F) . . . . .236
7.4.4GPIO port pull-up/pull-down register (GPIOx_PUPDR) (x = A to F) . . . . .236
7.4.5GPIO port input data register (GPIOx_IDR) (x = A to F) . . . . .237
7.4.6GPIO port output data register (GPIOx_ODR) (x = A to F) . . . . .237
7.4.7GPIO port bit set/reset register (GPIOx_BSRR) (x = A to F) . . . . .237
7.4.8GPIO port configuration lock register (GPIOx_LCKR) (x = A to F) . . . . .238
7.4.9GPIO alternate function low register (GPIOx_AFRL) (x = A to F) . . . .239
7.4.10GPIO alternate function high register (GPIOx_AFRH) (x = A to F) . . .240
7.4.11GPIO port bit reset register (GPIOx_BRR) (x = A to F) . . . . .241
7.4.12GPIO register map . . . . .241

Chapters