在好例子网,分享、交流、成长!
您当前所在位置:首页Others 开发实例一般编程问题 → STM32H750参考手册.pdf

STM32H750参考手册.pdf

一般编程问题

下载此实例
  • 开发语言:Others
  • 实例大小:48.34M
  • 下载次数:10
  • 浏览次数:365
  • 发布时间:2021-09-15
  • 实例类别:一般编程问题
  • 发 布 人:ccutljs
  • 文件格式:.pdf
  • 所需积分:2
 相关标签: STM32H7 STM32 STM3 stm 32

实例介绍

【实例简介】

【实例截图】

from clipboard

【核心代码】

Contents
1 Documentation conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
1.1 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
1.2 List of abbreviations for registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
1.3 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
1.4 Availability of peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
1.5 Availability of security features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
2 Memory and bus architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
2.1 System architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
2.1.1 Bus matrices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
2.1.2 TCM buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
2.1.3 Bus-to-bus bridges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
2.1.4 Inter-domain buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
2.1.5 CPU buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
2.1.6 Bus master peripherals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
2.1.7 Clocks to functional blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
2.2 AXI interconnect matrix (AXIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
2.2.1 AXI introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
2.2.2 AXI interconnect main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
2.2.3 AXI interconnect functional description . . . . . . . . . . . . . . . . . . . . . . . . 107
2.2.4 AXI interconnect registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
2.2.5 AXI interconnect register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
2.3 Memory organization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
2.3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
2.3.2 Memory map and register boundary addresses . . . . . . . . . . . . . . . . . 127
2.4 Embedded SRAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
2.5 Flash memory overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
2.6 Boot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
3 Embedded Flash memory (FLASH) . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
3.2 FLASH main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 137
3.3 FLASH functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
RM0433 Rev 6 3/3289
RM0433 Contents
68
3.3.1 FLASH block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
3.3.2 FLASH internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
3.3.3 FLASH architecture and integration in the system . . . . . . . . . . . . . . . 139
3.3.4 Flash memory architecture and usage . . . . . . . . . . . . . . . . . . . . . . . . 141
3.3.5 FLASH system performance enhancements . . . . . . . . . . . . . . . . . . . . 144
3.3.6 FLASH data protection schemes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
3.3.7 Overview of FLASH operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
3.3.8 FLASH read operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
3.3.9 FLASH program operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
3.3.10 FLASH erase operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
3.3.11 FLASH parallel operations (STM32H743/753 devices only) . . . . . 156
3.3.12 Flash memory error protections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
3.3.13 Flash bank and register swapping (STM32H743/753 devices only)158
3.3.14 FLASH reset and clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
3.4 FLASH option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
3.4.1 About option bytes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
3.4.2 Option byte loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
3.4.3 Option byte modification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
3.4.4 Option bytes overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165
3.4.5 Description of user and system option bytes . . . . . . . . . . . . . . . . . . . . 167
3.4.6 Description of data protection option bytes . . . . . . . . . . . . . . . . . . . . . 168
3.4.7 Description of boot address option bytes . . . . . . . . . . . . . . . . . . . . . . . 169
3.5 FLASH protection mechanisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
3.5.1 FLASH configuration protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
3.5.2 Write protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
3.5.3 Readout protection (RDP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
3.5.4 Proprietary code readout protection (PCROP) . . . . . . . . . . . . . . . . . . 177
3.5.5 Secure access mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
3.6 FLASH low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
3.7 FLASH error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
3.7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
3.7.2 Write protection error (WRPERR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
3.7.3 Programming sequence error (PGSERR) . . . . . . . . . . . . . . . . . . . . . . 182
3.7.4 Strobe error (STRBERR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
3.7.5 Inconsistency error (INCERR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
3.7.6 Operation error (OPERR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
3.7.7 Error correction code error (SNECCERR/DBECCERR) . . . . . . . . . . . 184
Contents RM0433
4/3289 RM0433 Rev 6
3.7.8 Read protection error (RDPERR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
3.7.9 Read secure error (RDSERR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
3.7.10 Option byte change error (OPTCHANGEERR) . . . . . . . . . . . . . . . . . . 185
3.7.11 Miscellaneous HardFault errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
3.8 FLASH interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
3.9 FLASH registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
3.9.1 FLASH access control register (FLASH_ACR) . . . . . . . . . . . . . . . . . . 189
3.9.2 FLASH key register for bank 1 (FLASH_KEYR1) . . . . . . . . . . . . . . . . 189
3.9.3 FLASH option key register (FLASH_OPTKEYR) . . . . . . . . . . . . . . . . . 190
3.9.4 FLASH control register for bank 1 (FLASH_CR1) . . . . . . . . . . . . . . . . 190
3.9.5 FLASH status register for bank 1 (FLASH_SR1) . . . . . . . . . . . . . . . . . 195
3.9.6 FLASH clear control register for bank 1 (FLASH_CCR1) . . . . . . . . . . 198
3.9.7 FLASH option control register (FLASH_OPTCR) . . . . . . . . . . . . . . . . 199
3.9.8 FLASH option status register (FLASH_OPTSR_CUR) . . . . . . . . . . . . 200
3.9.9 FLASH option status register (FLASH_OPTSR_PRG) . . . . . . . . . . . . 203
3.9.10 FLASH option clear control register (FLASH_OPTCCR) . . . . . . . . . . . 205
3.9.11 FLASH protection address for bank 1 (FLASH_PRAR_CUR1) . . . . . . 205
3.9.12 FLASH protection address for bank 1 (FLASH_PRAR_PRG1) . . . . . . 206
3.9.13 FLASH secure address for bank 1 (FLASH_SCAR_CUR1) . . . . . . . . 207
3.9.14 FLASH secure address for bank 1 (FLASH_SCAR_PRG1) . . . . . . . . 207
3.9.15 FLASH write sector protection for bank 1
(FLASH_WPSN_CUR1R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
3.9.16 FLASH write sector protection for bank 1
(FLASH_WPSN_PRG1R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
3.9.17 FLASH register boot address FLASH_BOOT_CURR) . . . . . . . . . . . . 209
3.9.18 FLASH register boot address FLASH_BOOT_PRGR) . . . . . . . . . . . . 209
3.9.19 FLASH CRC control register for bank 1 (FLASH_CRCCR1) . . . . . . . . 210
3.9.20 FLASH CRC start address register for bank 1
(FLASH_CRCSADD1R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
3.9.21 FLASH CRC end address register for bank 1
(FLASH_CRCEADD1R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
3.9.22 FLASH CRC data register (FLASH_CRCDATAR) . . . . . . . . . . . . . . . . 212
3.9.23 FLASH ECC fail address for bank 1 (FLASH_ECC_FA1R) . . . . . . . . . 213
3.9.24 FLASH key register for bank 2 (FLASH_KEYR2) . . . . . . . . . . . . . . . . 213
3.9.25 FLASH control register for bank 2 (FLASH_CR2) . . . . . . . . . . . . . . . . 214
3.9.26 FLASH status register for bank 2 (FLASH_SR2) . . . . . . . . . . . . . . . . . 218
3.9.27 FLASH clear control register for bank 2 (FLASH_CCR2) . . . . . . . . . . 221
3.9.28 FLASH protection address for bank 2 (FLASH_PRAR_CUR2) . . . . . . 222
RM0433 Rev 6 5/3289
RM0433 Contents
68
3.9.29 FLASH protection address for bank 2 (FLASH_PRAR_PRG2) . . . . . . 223
3.9.30 FLASH secure address for bank 2 (FLASH_SCAR_CUR2) . . . . . . . . 223
3.9.31 FLASH secure address for bank 2 (FLASH_SCAR_PRG2) . . . . . . . . 224
3.9.32 FLASH write sector protection for bank 2
(FLASH_WPSN_CUR2R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
3.9.33 FLASH write sector protection for bank 2
(FLASH_WPSN_PRG2R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
3.9.34 FLASH CRC control register for bank 2 (FLASH_CRCCR2) . . . . . . . . 226
3.9.35 FLASH CRC start address register for bank 2
(FLASH_CRCSADD2R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
3.9.36 FLASH CRC end address register for bank 2
(FLASH_CRCEADD2R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
3.9.37 FLASH ECC fail address for bank 2 (FLASH_ECC_FA2R) . . . . . . . . . 228
3.10 FLASH register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . 229
4 Secure internal Flash memory (SIFM) . . . . . . . . . . . . . . . . . . . . . . . . . 234
4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
4.2 Glossary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234
4.3 Secure access mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
4.3.1 Associated features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
4.3.2 Boot state machine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236
4.3.3 Secure access mode configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 237
4.4 Root secure services (RSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
4.4.1 Secure area setting service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
4.4.2 Secure area exiting service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
4.5 Secure user software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
4.5.1 Access rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
4.5.2 Setting secure user memory areas . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
4.6 Summary of Flash protection mechanisms . . . . . . . . . . . . . . . . . . . . . . 240
5 Power control (PWR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
5.2 PWR main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
5.3 PWR block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242
5.3.1 PWR pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
5.4 Power supplies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 245
5.4.1 System supply startup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248
Contents RM0433
6/3289 RM0433 Rev 6
5.4.2 Core domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 250
5.4.3 PWR external supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251
5.4.4 Backup domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
5.4.5 VBAT battery charging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
5.4.6 Analog supply . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254
5.4.7 USB regulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.5 Power supply supervision . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
5.5.1 Power-on reset (POR)/power-down reset (PDR) . . . . . . . . . . . . . . . . . 256
5.5.2 Brownout reset (BOR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
5.5.3 Programmable voltage detector (PVD) . . . . . . . . . . . . . . . . . . . . . . . . 257
5.5.4 Analog voltage detector (AVD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
5.5.5 Battery voltage thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
5.5.6 Temperature thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 261
5.6 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262
5.6.1 Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
5.6.2 Voltage scaling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 266
5.6.3 Power control modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
5.6.4 Power management examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 271
5.7 Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
5.7.1 Slowing down system clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
5.7.2 Controlling peripheral clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
5.7.3 Entering low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
5.7.4 Exiting from low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
5.7.5 CSleep mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
5.7.6 CStop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
5.7.7 DStop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
5.7.8 Stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
5.7.9 DStandby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284
5.7.10 Standby mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286
5.7.11 Monitoring low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
5.8 PWR register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.8.1 PWR control register 1 (PWR_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . . 289
5.8.2 PWR control status register 1 (PWR_CSR1) . . . . . . . . . . . . . . . . . . . . 290
5.8.3 PWR control register 2 (PWR_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . 291
5.8.4 PWR control register 3 (PWR_CR3) . . . . . . . . . . . . . . . . . . . . . . . . . . 292
5.8.5 PWR CPU control register (PWR_CPUCR) . . . . . . . . . . . . . . . . . . . . 294
5.8.6 PWR D3 domain control register (PWR_D3CR) . . . . . . . . . . . . . . . . . 295
RM0433 Rev 6 7/3289
RM0433 Contents
68
5.8.7 PWR wakeup clear register (PWR_WKUPCR) . . . . . . . . . . . . . . . . . . 296
5.8.8 PWR wakeup flag register (PWR_WKUPFR) . . . . . . . . . . . . . . . . . . . 296
5.8.9 PWR wakeup enable and polarity register (PWR_WKUPEPR) . . . . . . 297
5.8.10 PWR register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298
6 Low-power D3 domain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 299
6.2 EXTI, RCC and PWR interconnections . . . . . . . . . . . . . . . . . . . . . . . . . 299
6.2.1 Interrupts and wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
6.2.2 Block interactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
6.2.3 Role of D3 domain DMAMUX2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 302
6.3 Low-power application example based on
LPUART1 transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
6.3.1 Memory retention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
6.3.2 Memory-to-peripheral transfer using LPUART1 interface . . . . . . . . . . 303
6.3.3 Overall description of the low-power application example based on
LPUART1 transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
6.3.4 Alternate implementations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
6.4 Other low-power applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 310
7 Reset and Clock Control (RCC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
7.1 RCC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .311
7.2 RCC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
7.3 RCC pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
7.4 RCC reset block functional description . . . . . . . . . . . . . . . . . . . . . . . . . 314
7.4.1 Power-on/off reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314
7.4.2 System reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315
7.4.3 Local resets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316
7.4.4 Reset source identification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 318
7.4.5 Low-power mode security reset (lpwr_rst) . . . . . . . . . . . . . . . . . . . . . . 319
7.4.6 Backup domain reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
7.4.7 Power-on and wakeup sequences . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
7.5 RCC clock block functional description . . . . . . . . . . . . . . . . . . . . . . . . . 322
7.5.1 Clock naming convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
7.5.2 Oscillators description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 324
7.5.3 Clock Security System (CSS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
7.5.4 Clock output generation (MCO1/MCO2) . . . . . . . . . . . . . . . . . . . . . . . 330
Contents RM0433
8/3289 RM0433 Rev 6
7.5.5 PLL description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
7.5.6 System clock (sys_ck) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335
7.5.7 Handling clock generators in Stop and Standby mode . . . . . . . . . . . . 337
7.5.8 Kernel clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339
7.5.9 General clock concept overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
7.5.10 Peripheral allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
7.5.11 Peripheral clock gating control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
7.5.12 CPU and bus matrix clock gating control . . . . . . . . . . . . . . . . . . . . . . . 363
7.6 RCC Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
7.7 RCC register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
7.7.1 Register mapping overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
7.7.2 RCC Source Control Register (RCC_CR) . . . . . . . . . . . . . . . . . . . . . . 367
7.7.3 RCC Internal Clock Source Calibration Register (RCC_ICSCR) . . . . . 371
7.7.4 RCC HSI configuration register (RCC_HSICFGR) . . . . . . . . . . . . . . . 372
7.7.5 RCC Clock Recovery RC Register (RCC_CRRCR) . . . . . . . . . . . . . . 373
7.7.6 RCC CSI configuration register (RCC_CSICFGR) . . . . . . . . . . . . . . . 374
7.7.7 RCC Clock Configuration Register (RCC_CFGR) . . . . . . . . . . . . . . . . 375
7.7.8 RCC Domain 1 Clock Configuration Register (RCC_D1CFGR) . . . . . 378
7.7.9 RCC Domain 2 Clock Configuration Register (RCC_D2CFGR) . . . . . 380
7.7.10 RCC Domain 3 Clock Configuration Register (RCC_D3CFGR) . . . . . 381
7.7.11 RCC PLLs Clock Source Selection Register (RCC_PLLCKSELR) . . . 382
7.7.12 RCC PLLs Configuration Register (RCC_PLLCFGR) . . . . . . . . . . . . . 384
7.7.13 RCC PLL1 Dividers Configuration Register (RCC_PLL1DIVR) . . . . . . 387
7.7.14 RCC PLL1 Fractional Divider Register (RCC_PLL1FRACR) . . . . . . . 389
7.7.15 RCC PLL2 Dividers Configuration Register (RCC_PLL2DIVR) . . . . . . 390
7.7.16 RCC PLL2 Fractional Divider Register (RCC_PLL2FRACR) . . . . . . . 392
7.7.17 RCC PLL3 Dividers Configuration Register (RCC_PLL3DIVR) . . . . . . 393
7.7.18 RCC PLL3 Fractional Divider Register (RCC_PLL3FRACR) . . . . . . . 395
7.7.19 RCC Domain 1 Kernel Clock Configuration Register
(RCC_D1CCIPR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
7.7.20 RCC Domain 2 Kernel Clock Configuration Register
(RCC_D2CCIP1R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
7.7.21 RCC Domain 2 Kernel Clock Configuration Register
(RCC_D2CCIP2R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
7.7.22 RCC Domain 3 Kernel Clock Configuration Register
(RCC_D3CCIPR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
7.7.23 RCC Clock Source Interrupt Enable Register (RCC_CIER) . . . . . . . . 405
7.7.24 RCC Clock Source Interrupt Flag Register (RCC_CIFR) . . . . . . . . . . 407
RM0433 Rev 6 9/3289
RM0433 Contents
68
7.7.25 RCC Clock Source Interrupt Clear Register (RCC_CICR) . . . . . . . . . 409
7.7.26 RCC Backup Domain Control Register (RCC_BDCR) . . . . . . . . . . . . 411
7.7.27 RCC Clock Control and Status Register (RCC_CSR) . . . . . . . . . . . . . 413
7.7.28 RCC AHB3 Reset Register (RCC_AHB3RSTR) . . . . . . . . . . . . . . . . . 414
7.7.29 RCC AHB1 Peripheral Reset Register(RCC_AHB1RSTR) . . . . . . . . . 416
7.7.30 RCC AHB2 Peripheral Reset Register (RCC_AHB2RSTR) . . . . . . . . 418
7.7.31 RCC AHB4 Peripheral Reset Register (RCC_AHB4RSTR) . . . . . . . . 419
7.7.32 RCC APB3 Peripheral Reset Register (RCC_APB3RSTR) . . . . . . . . . 421
7.7.33 RCC APB1 Peripheral Reset Register (RCC_APB1LRSTR) . . . . . . . . 422
7.7.34 RCC APB1 Peripheral Reset Register (RCC_APB1HRSTR) . . . . . . . 425
7.7.35 RCC APB2 Peripheral Reset Register (RCC_APB2RSTR) . . . . . . . . . 426
7.7.36 RCC APB4 Peripheral Reset Register (RCC_APB4RSTR) . . . . . . . . . 428
7.7.37 RCC Global Control Register (RCC_GCR) . . . . . . . . . . . . . . . . . . . . . 430
7.7.38 RCC D3 Autonomous mode Register (RCC_D3AMR) . . . . . . . . . . . . 431
7.7.39 RCC Reset Status Register (RCC_RSR) . . . . . . . . . . . . . . . . . . . . . . 434
7.7.40 RCC AHB3 Clock Register (RCC_AHB3ENR) . . . . . . . . . . . . . . . . . . 436
7.7.41 RCC AHB1 Clock Register (RCC_AHB1ENR) . . . . . . . . . . . . . . . . . . 438
7.7.42 RCC AHB2 Clock Register (RCC_AHB2ENR) . . . . . . . . . . . . . . . . . . 440
7.7.43 RCC AHB4 Clock Register (RCC_AHB4ENR) . . . . . . . . . . . . . . . . . . 442
7.7.44 RCC APB3 Clock Register (RCC_APB3ENR) . . . . . . . . . . . . . . . . . . . 445
7.7.45 RCC APB1 Clock Register (RCC_APB1LENR) . . . . . . . . . . . . . . . . . . 446
7.7.46 RCC APB1 Clock Register (RCC_APB1HENR) . . . . . . . . . . . . . . . . . 450
7.7.47 RCC APB2 Clock Register (RCC_APB2ENR) . . . . . . . . . . . . . . . . . . . 452
7.7.48 RCC APB4 Clock Register (RCC_APB4ENR) . . . . . . . . . . . . . . . . . . . 455
7.7.49 RCC AHB3 Sleep Clock Register (RCC_AHB3LPENR) . . . . . . . . . . . 458
7.7.50 RCC AHB1 Sleep Clock Register (RCC_AHB1LPENR) . . . . . . . . . . . 460
7.7.51 RCC AHB2 Sleep Clock Register (RCC_AHB2LPENR) . . . . . . . . . . . 462
7.7.52 RCC AHB4 Sleep Clock Register (RCC_AHB4LPENR) . . . . . . . . . . . 464
7.7.53 RCC APB3 Sleep Clock Register (RCC_APB3LPENR) . . . . . . . . . . . 467
7.7.54 RCC APB1 Low Sleep Clock Register (RCC_APB1LLPENR) . . . . . . 468
7.7.55 RCC APB1 High Sleep Clock Register (RCC_APB1HLPENR) . . . . . . 472
7.7.56 RCC APB2 Sleep Clock Register (RCC_APB2LPENR) . . . . . . . . . . . 474
7.7.57 RCC APB4 Sleep Clock Register (RCC_APB4LPENR) . . . . . . . . . . . 477
7.8 RCC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
8 Clock recovery system (CRS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
8.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Contents RM0433
10/3289 RM0433 Rev 6
8.2 CRS main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
8.3 CRS functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
8.3.1 CRS block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
8.4 CRS internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 491
8.4.1 Synchronization input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
8.4.2 Frequency error measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 492
8.4.3 Frequency error evaluation and automatic trimming . . . . . . . . . . . . . . 494
8.4.4 CRS initialization and configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
8.5 CRS low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
8.6 CRS interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
8.7 CRS registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
8.7.1 CRS control register (CRS_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
8.7.2 CRS configuration register (CRS_CFGR) . . . . . . . . . . . . . . . . . . . . . . 497
8.7.3 CRS interrupt and status register (CRS_ISR) . . . . . . . . . . . . . . . . . . . 498
8.7.4 CRS interrupt flag clear register (CRS_ICR) . . . . . . . . . . . . . . . . . . . . 500
8.7.5 CRS register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
9 Hardware semaphore (HSEM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
9.1 Hardware semaphore introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
9.2 Hardware semaphore main features . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
9.3 HSEM functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
9.3.1 HSEM block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
9.3.2 HSEM internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
9.3.3 HSEM lock procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
9.3.4 HSEM Write/Read/ReadLock register address . . . . . . . . . . . . . . . . . . 505
9.3.5 HSEM Clear procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
9.3.6 HSEM MASTERID semaphore clear . . . . . . . . . . . . . . . . . . . . . . . . . . 506
9.3.7 HSEM interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
9.3.8 AHB bus master ID verification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
9.4 HSEM registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
9.4.1 HSEM register semaphore x (HSEM_Rx) . . . . . . . . . . . . . . . . . . . . . . 510
9.4.2 HSEM read lock register semaphore x (HSEM_RLRx) . . . . . . . . . . . . 511
9.4.3 HSEM interrupt enable register (HSEM_IER) . . . . . . . . . . . . . . . . . . . 512
9.4.4 HSEM interrupt clear register (HSEM_ICR) . . . . . . . . . . . . . . . . . . . . 512
9.4.5 HSEM interrupt status register (HSEM_ISR) . . . . . . . . . . . . . . . . . . . . 512
9.4.6 HSEM interrupt status register (HSEM_MISR) . . . . . . . . . . . . . . . . . . 513
RM0433 Rev 6 11/3289
RM0433 Contents
68
9.4.7 HSEM clear register (HSEM_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
9.4.8 HSEM interrupt clear register (HSEM_KEYR) . . . . . . . . . . . . . . . . . . . 514
9.4.9 HSEM register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
10 General-purpose I/Os (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
10.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
10.2 GPIO main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
10.3 GPIO functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
10.3.1 General-purpose I/O (GPIO) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
10.3.2 I/O pin alternate function multiplexer and mapping . . . . . . . . . . . . . . . 519
10.3.3 I/O port control registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
10.3.4 I/O port data registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
10.3.5 I/O data bitwise handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
10.3.6 GPIO locking mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
10.3.7 I/O alternate function input/output . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
10.3.8 External interrupt/wakeup lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 521
10.3.9 Input configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
10.3.10 Output configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 522
10.3.11 I/O compensation cell . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
10.3.12 Alternate function configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
10.3.13 Analog configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524
10.3.14 Using the HSE or LSE oscillator pins as GPIOs . . . . . . . . . . . . . . . . . 525
10.3.15 Using the GPIO pins in the backup supply domain . . . . . . . . . . . . . . . 525
10.4 GPIO registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 526
10.4.1 GPIO port mode register (GPIOx_MODER) (x =A to K) . . . . . . . . . . . 526
10.4.2 GPIO port output type register (GPIOx_OTYPER) (x = A to K) . . . . . . 526
10.4.3 GPIO port output speed register (GPIOx_OSPEEDR)
(x = A to K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
10.4.4 GPIO port pull-up/pull-down register (GPIOx_PUPDR)
(x = A to K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 527
10.4.5 GPIO port input data register (GPIOx_IDR) (x = A to K) . . . . . . . . . . . 528
10.4.6 GPIO port output data register (GPIOx_ODR) (x = A to K) . . . . . . . . . 528
10.4.7 GPIO port bit set/reset register (GPIOx_BSRR) (x = A to K) . . . . . . . . 528
10.4.8 GPIO port configuration lock register (GPIOx_LCKR)
(x = A to K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529
10.4.9 GPIO alternate function low register (GPIOx_AFRL)
(x = A to K) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 530
Contents RM0433
12/3289 RM0433 Rev 6
10.4.10 GPIO alternate function high register (GPIOx_AFRH)
(x = A to J) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
10.4.11 GPIO register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533
11 System configuration controller (SYSCFG) . . . . . . . . . . . . . . . . . . . . 535
11.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
11.2 SYSCFG main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
11.3 SYSCFG registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 535
11.3.1 SYSCFG peripheral mode configuration register (SYSCFG_PMCR) . 535
11.3.2 SYSCFG external interrupt configuration register 1
(SYSCFG_EXTICR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 537
11.3.3 SYSCFG external interrupt configuration register 2
(SYSCFG_EXTICR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 538
11.3.4 SYSCFG external interrupt configuration register 3
(SYSCFG_EXTICR3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 539
11.3.5 SYSCFG external interrupt configuration register 4
(SYSCFG_EXTICR4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 540
11.3.6 SYSCFG configuration register (SYSCFG_CFGR) . . . . . . . . . . . . . . . 541
11.3.7 SYSCFG compensation cell control/status register
(SYSCFG_CCCSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 544
11.3.8 SYSCFG compensation cell value register (SYSCFG_CCVR) . . . . . . 545
11.3.9 SYSCFG compensation cell code register (SYSCFG_CCCR) . . . . . . 545
11.3.10 SYSCFG power control register (SYSCFG_PWRCR) . . . . . . . . . . . . . 546
11.3.11 SYSCFG package register (SYSCFG_PKGR) . . . . . . . . . . . . . . . . . . 546
11.3.12 SYSCFG user register 0 (SYSCFG_UR0) . . . . . . . . . . . . . . . . . . . . . . 547
11.3.13 SYSCFG user register 2 (SYSCFG_UR2) . . . . . . . . . . . . . . . . . . . . . . 547
11.3.14 SYSCFG user register 3 (SYSCFG_UR3) . . . . . . . . . . . . . . . . . . . . . . 548
11.3.15 SYSCFG user register 4 (SYSCFG_UR4) . . . . . . . . . . . . . . . . . . . . . . 548
11.3.16 SYSCFG user register 5 (SYSCFG_UR5) . . . . . . . . . . . . . . . . . . . . . . 549
11.3.17 SYSCFG user register 6 (SYSCFG_UR6) . . . . . . . . . . . . . . . . . . . . . . 549
11.3.18 SYSCFG user register 7 (SYSCFG_UR7) . . . . . . . . . . . . . . . . . . . . . . 550
11.3.19 SYSCFG user register 8 (SYSCFG_UR8) . . . . . . . . . . . . . . . . . . . . . . 550
11.3.20 SYSCFG user register 9 (SYSCFG_UR9) . . . . . . . . . . . . . . . . . . . . . . 551
11.3.21 SYSCFG user register 10 (SYSCFG_UR10) . . . . . . . . . . . . . . . . . . . . 551
11.3.22 SYSCFG user register 11 (SYSCFG_UR11) . . . . . . . . . . . . . . . . . . . . 552
11.3.23 SYSCFG user register 12 (SYSCFG_UR12) . . . . . . . . . . . . . . . . . . . . 552
11.3.24 SYSCFG user register 13 (SYSCFG_UR13) . . . . . . . . . . . . . . . . . . . . 553
11.3.25 SYSCFG user register 14 (SYSCFG_UR14) . . . . . . . . . . . . . . . . . . . . 554
11.3.26 SYSCFG user register 15 (SYSCFG_UR15) . . . . . . . . . . . . . . . . . . . . 555
RM0433 Rev 6 13/3289
RM0433 Contents
68
11.3.27 SYSCFG user register 16 (SYSCFG_UR16) . . . . . . . . . . . . . . . . . . . . 556
11.3.28 SYSCFG user register 17 (SYSCFG_UR17) . . . . . . . . . . . . . . . . . . . . 556
11.3.29 SYSCFG register maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
12 Block interconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
12.1 Peripheral interconnect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
12.1.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
12.1.2 Connection overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 560
12.2 Wakeup from low power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 579
12.3 DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 584
12.3.1 MDMA (D1 domain) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585
12.3.2 DMAMUX1, DMA1 and DMA2 (D2 domain) . . . . . . . . . . . . . . . . . . . . 587
12.3.3 DMAMUX2, BDMA (D3 domain) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 592
13 MDMA controller (MDMA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
13.1 MDMA introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
13.2 MDMA main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
13.3 MDMA functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
13.3.1 MDMA block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
13.3.2 MDMA internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 597
13.3.3 MDMA overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 598
13.3.4 MDMA channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
13.3.5 Source, destination and transfer modes . . . . . . . . . . . . . . . . . . . . . . . 599
13.3.6 Pointer update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 599
13.3.7 MDMA buffer transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 600
13.3.8 Request arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
13.3.9 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 601
13.3.10 Block transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
13.3.11 Block repeat mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
13.3.12 Linked list mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
13.3.13 MDMA transfer completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 602
13.3.14 MDMA transfer suspension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
13.3.15 Error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
13.4 MDMA interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603
13.5 MDMA registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 604
13.5.1 MDMA global interrupt/status register (MDMA_GISR0) . . . . . . . . . . . 604
Contents RM0433
14/3289 RM0433 Rev 6
13.5.2 MDMA channel x interrupt/status register (MDMA_CxISR) . . . . . . . . . 605
13.5.3 MDMA channel x interrupt flag clear register (MDMA_CxIFCR) . . . . . 606
13.5.4 MDMA channel x error status register (MDMA_CxESR) . . . . . . . . . . . 607
13.5.5 MDMA channel x control register (MDMA_CxCR) . . . . . . . . . . . . . . . . 609
13.5.6 MDMA channel x transfer configuration register (MDMA_CxTCR) . . . 611
13.5.7 MDMA channel x block number of data register (MDMA_CxBNDTR) . 614
13.5.8 MDMA channel x source address register (MDMA_CxSAR) . . . . . . . . 616
13.5.9 MDMA channel x destination address register (MDMA_CxDAR) . . . . 616
13.5.10 MDMA channel x block repeat address update register
(MDMA_CxBRUR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618
13.5.11 MDMA channel x link address register (MDMA_CxLAR) . . . . . . . . . . . 619
13.5.12 MDMA channel x trigger and bus selection register (MDMA_CxTBR) 620
13.5.13 MDMA channel x mask address register (MDMA_CxMAR) . . . . . . . . 621
13.5.14 MDMA channel x mask data register (MDMA_CxMDR) . . . . . . . . . . . 621
13.5.15 MDMA register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 622
14 Direct memory access controller (DMA) . . . . . . . . . . . . . . . . . . . . . . . 624
14.1 DMA introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
14.2 DMA main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 624
14.3 DMA functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
14.3.1 DMA block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
14.3.2 DMA internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 626
14.3.3 DMA overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
14.3.4 DMA transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
14.3.5 DMA request mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627
14.3.6 Arbiter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
14.3.7 DMA streams . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 628
14.3.8 Source, destination and transfer modes . . . . . . . . . . . . . . . . . . . . . . . 628
14.3.9 Pointer incrementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 631
14.3.10 Circular mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
14.3.11 Double-buffer mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 632
14.3.12 Programmable data width, packing/unpacking, endianness . . . . . . . . 633
14.3.13 Single and burst transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 635
14.3.14 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636
14.3.15 DMA transfer completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 638
14.3.16 DMA transfer suspension . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 639
14.3.17 Flow controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 640
RM0433 Rev 6 15/3289
RM0433 Contents
68
14.3.18 Summary of the possible DMA configurations . . . . . . . . . . . . . . . . . . . 641
14.3.19 Stream configuration procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 641
14.3.20 Error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 642
14.4 DMA interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643
14.5 DMA registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 644
14.5.1 DMA low interrupt status register (DMA_LISR) . . . . . . . . . . . . . . . . . . 644
14.5.2 DMA high interrupt status register (DMA_HISR) . . . . . . . . . . . . . . . . . 645
14.5.3 DMA low interrupt flag clear register (DMA_LIFCR) . . . . . . . . . . . . . . 646
14.5.4 DMA high interrupt flag clear register (DMA_HIFCR) . . . . . . . . . . . . . 646
14.5.5 DMA stream x configuration register (DMA_SxCR) . . . . . . . . . . . . . . . 647
14.5.6 DMA stream x number of data register (DMA_SxNDTR) . . . . . . . . . . 650
14.5.7 DMA stream x peripheral address register (DMA_SxPAR) . . . . . . . . . 651
14.5.8 DMA stream x memory 0 address register (DMA_SxM0AR) . . . . . . . . 651
14.5.9 DMA stream x memory 1 address register (DMA_SxM1AR) . . . . . . . . 651
14.5.10 DMA stream x FIFO control register (DMA_SxFCR) . . . . . . . . . . . . . . 652
14.5.11 DMA register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 654
15 Basic direct memory access controller (BDMA) . . . . . . . . . . . . . . . . 658
15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
15.2 BDMA main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
15.3 BDMA implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
15.3.1 BDMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 658
15.3.2 BDMA request mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
15.4 BDMA functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
15.4.1 BDMA block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 659
15.4.2 BDMA pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
15.4.3 BDMA transfers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 660
15.4.4 BDMA arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
15.4.5 BDMA channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 661
15.4.6 BDMA data width, alignment and endianness . . . . . . . . . . . . . . . . . . . 665
15.4.7 BDMA error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 666
15.5 BDMA interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
15.6 BDMA registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 667
15.6.1 BDMA interrupt status register (BDMA_ISR) . . . . . . . . . . . . . . . . . . . . 667
15.6.2 BDMA interrupt flag clear register (BDMA_IFCR) . . . . . . . . . . . . . . . . 670
15.6.3 BDMA channel x configuration register (BDMA_CCRx) . . . . . . . . . . . 671
Contents RM0433
16/3289 RM0433 Rev 6
15.6.4 BDMA channel x number of data to transfer register
(BDMA_CNDTRx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 675
15.6.5 BDMA channel x peripheral address register (BDMA_CPARx) . . . . . . 675
15.6.6 BDMA channel x memory 0 address register (BDMA_CM0ARx) . . . . 676
15.6.7 BDMA channel x memory 1 address register (BDMA_CM1ARx) . . . . 677
15.6.8 BDMA register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . 677
16 DMA request multiplexer (DMAMUX) . . . . . . . . . . . . . . . . . . . . . . . . . 680
16.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 680
16.2 DMAMUX main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
16.3 DMAMUX implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
16.3.1 DMAMUX1 and DMAMUX2 instantiation . . . . . . . . . . . . . . . . . . . . . . . 681
16.3.2 DMAMUX1 mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 681
16.3.3 DMAMUX2 mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683
16.4 DMAMUX functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
16.4.1 DMAMUX block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 686
16.4.2 DMAMUX signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
16.4.3 DMAMUX channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
16.4.4 DMAMUX request line multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . 687
16.4.5 DMAMUX request generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 690
16.5 DMAMUX interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 691
16.6 DMAMUX registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
16.6.1 DMAMUX1 request line multiplexer channel x configuration register
(DMAMUX1_CxCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 692
16.6.2 DMAMUX2 request line multiplexer channel x configuration register
(DMAMUX2_CxCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693
16.6.3 DMAMUX1 request line multiplexer interrupt channel status register
(DMAMUX1_CSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
16.6.4 DMAMUX2 request line multiplexer interrupt channel status register
(DMAMUX2_CSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 694
16.6.5 DMAMUX1 request line multiplexer interrupt clear flag register
(DMAMUX1_CFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
16.6.6 DMAMUX2 request line multiplexer interrupt clear flag register
(DMAMUX2_CFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 695
16.6.7 DMAMUX1 request generator channel x configuration register
(DMAMUX1_RGxCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
16.6.8 DMAMUX2 request generator channel x configuration register
(DMAMUX2_RGxCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 696
RM0433 Rev 6 17/3289
RM0433 Contents
68
16.6.9 DMAMUX1 request generator interrupt status register
(DMAMUX1_RGSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 697
16.6.10 DMAMUX2 request generator interrupt status register
(DMAMUX2_RGSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
16.6.11 DMAMUX1 request generator interrupt clear flag register
(DMAMUX1_RGCFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 698
16.6.12 DMAMUX2 request generator interrupt clear flag register
(DMAMUX2_RGCFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 699
16.6.13 DMAMUX register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 700
17 Chrom-Art Accelerator™ controller (DMA2D) . . . . . . . . . . . . . . . . . . 702
17.1 DMA2D introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
17.2 DMA2D main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 702
17.3 DMA2D functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
17.3.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 703
17.4 DMA2D pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 704
17.4.1 DMA2D control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 705
17.4.2 DMA2D foreground and background FIFOs . . . . . . . . . . . . . . . . . . . . 705
17.4.3 DMA2D foreground and background pixel format converter (PFC) . . . 705
17.4.4 DMA2D foreground and background CLUT interface . . . . . . . . . . . . . 708
17.4.5 DMA2D blender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
17.4.6 DMA2D output PFC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 709
17.4.7 DMA2D output FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 710
17.4.8 DMA2D output FIFO byte reordering . . . . . . . . . . . . . . . . . . . . . . . . . . 710
17.4.9 DMA2D AXI master port timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
17.4.10 DMA2D transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 712
17.4.11 DMA2D configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 713
17.4.12 YCbCr support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
17.4.13 DMA2D transfer control (start, suspend, abort and completion) . . . . . 717
17.4.14 Watermark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 717
17.4.15 Error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
17.4.16 AXI dead time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
17.5 DMA2D interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 718
17.6 DMA2D registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 719
17.6.1 DMA2D control register (DMA2D_CR) . . . . . . . . . . . . . . . . . . . . . . . . 719
17.6.2 DMA2D interrupt status register (DMA2D_ISR) . . . . . . . . . . . . . . . . . 721
17.6.3 DMA2D interrupt flag clear register (DMA2D_IFCR) . . . . . . . . . . . . . . 722
17.6.4 DMA2D foreground memory address register (DMA2D_FGMAR) . . . 723
Contents RM0433
18/3289 RM0433 Rev 6
17.6.5 DMA2D foreground offset register (DMA2D_FGOR) . . . . . . . . . . . . . . 723
17.6.6 DMA2D background memory address register (DMA2D_BGMAR) . . 724
17.6.7 DMA2D background offset register (DMA2D_BGOR) . . . . . . . . . . . . . 724
17.6.8 DMA2D foreground PFC control register (DMA2D_FGPFCCR) . . . . . 725
17.6.9 DMA2D foreground color register (DMA2D_FGCOLR) . . . . . . . . . . . . 727
17.6.10 DMA2D background PFC control register (DMA2D_BGPFCCR) . . . . 728
17.6.11 DMA2D background color register (DMA2D_BGCOLR) . . . . . . . . . . . 730
17.6.12 DMA2D foreground CLUT memory address register
(DMA2D_FGCMAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 730
17.6.13 DMA2D background CLUT memory address register
(DMA2D_BGCMAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 731
17.6.14 DMA2D output PFC control register (DMA2D_OPFCCR) . . . . . . . . . . 731
17.6.15 DMA2D output color register (DMA2D_OCOLR) . . . . . . . . . . . . . . . . . 732
17.6.16 DMA2D output memory address register (DMA2D_OMAR) . . . . . . . . 734
17.6.17 DMA2D output offset register (DMA2D_OOR) . . . . . . . . . . . . . . . . . . 734
17.6.18 DMA2D number of line register (DMA2D_NLR) . . . . . . . . . . . . . . . . . 735
17.6.19 DMA2D line watermark register (DMA2D_LWR) . . . . . . . . . . . . . . . . . 735
17.6.20 DMA2D AXI master timer configuration register (DMA2D_AMTCR) . . 736
17.6.21 DMA2D foreground CLUT (DMA2D_FGCLUT[y]) . . . . . . . . . . . . . . . . 736
17.6.22 DMA2D background CLUT (DMA2D_BGCLUT[y]) . . . . . . . . . . . . . . . 737
17.6.23 DMA2D register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 738
18 Nested Vectored Interrupt Controllers . . . . . . . . . . . . . . . . . . . . . . . . 740
18.1 NVIC features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
18.1.1 SysTick calibration value register . . . . . . . . . . . . . . . . . . . . . . . . . . . . 740
18.1.2 Interrupt and exception vectors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 741
19 Extended interrupt and event controller (EXTI) . . . . . . . . . . . . . . . . . 749
19.1 EXTI main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
19.2 EXTI block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 749
19.2.1 EXTI connections between peripherals, CPU, and D3 domain . . . . . . 750
19.3 EXTI functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 751
19.3.1 EXTI Configurable event input CPU wakeup . . . . . . . . . . . . . . . . . . . . 752
19.3.2 EXTI configurable event input Any wakeup . . . . . . . . . . . . . . . . . . . . . 753
19.3.3 EXTI direct event input CPU wakeup . . . . . . . . . . . . . . . . . . . . . . . . . 755
19.3.4 EXTI direct event input Any wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . 756
19.3.5 EXTI D3 pending request clear selection . . . . . . . . . . . . . . . . . . . . . . 757
RM0433 Rev 6 19/3289
RM0433 Contents
68
19.4 EXTI event input mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 757
19.5 EXTI functional behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 760
19.5.1 EXTI CPU interrupt procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
19.5.2 EXTI CPU event procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 761
19.5.3 EXTI CPU wakeup procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 762
19.5.4 EXTI D3 domain wakeup for autonomous Run mode procedure . . . . 762
19.5.5 EXTI software interrupt/event trigger procedure . . . . . . . . . . . . . . . . . 762
19.6 EXTI registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 763
19.6.1 EXTI rising trigger selection register (EXTI_RTSR1) . . . . . . . . . . . . . . 763
19.6.2 EXTI falling trigger selection register (EXTI_FTSR1) . . . . . . . . . . . . . 763
19.6.3 EXTI software interrupt event register (EXTI_SWIER1) . . . . . . . . . . . 764
19.6.4 EXTI D3 pending mask register (EXTI_D3PMR1) . . . . . . . . . . . . . . . . 764
19.6.5 EXTI D3 pending clear selection register low (EXTI_D3PCR1L) . . . . 765
19.6.6 EXTI D3 pending clear selection register high (EXTI_D3PCR1H) . . . 765
19.6.7 EXTI rising trigger selection register (EXTI_RTSR2) . . . . . . . . . . . . . . 766
19.6.8 EXTI falling trigger selection register (EXTI_FTSR2) . . . . . . . . . . . . . 767
19.6.9 EXTI software interrupt event register (EXTI_SWIER2) . . . . . . . . . . . 767
19.6.10 EXTI D3 pending mask register (EXTI_D3PMR2) . . . . . . . . . . . . . . . . 768
19.6.11 EXTI D3 pending clear selection register low (EXTI_D3PCR2L) . . . . 769
19.6.12 EXTI D3 pending clear selection register high (EXTI_D3PCR2H) . . . 769
19.6.13 EXTI rising trigger selection register (EXTI_RTSR3) . . . . . . . . . . . . . . 770
19.6.14 EXTI falling trigger selection register (EXTI_FTSR3) . . . . . . . . . . . . . 770
19.6.15 EXTI software interrupt event register (EXTI_SWIER3) . . . . . . . . . . . 771
19.6.16 EXTI D3 pending mask register (EXTI_D3PMR3) . . . . . . . . . . . . . . . . 771
19.6.17 EXTI D3 pending clear selection register low (EXTI_D3PCR3L) . . . . 772
19.6.18 EXTI D3 pending clear selection register high (EXTI_D3PCR3H) . . . 772
19.6.19 EXTI interrupt mask register (EXTI_CPUIMR1) . . . . . . . . . . . . . . . . . 773
19.6.20 EXTI event mask register (EXTI_CPUEMR1) . . . . . . . . . . . . . . . . . . . 773
19.6.21 EXTI pending register (EXTI_CPUPR1) . . . . . . . . . . . . . . . . . . . . . . . 774
19.6.22 EXTI interrupt mask register (EXTI_CPUIMR2) . . . . . . . . . . . . . . . . . 774
19.6.23 EXTI event mask register (EXTI_CPUEMR2) . . . . . . . . . . . . . . . . . . . 775
19.6.24 EXTI pending register (EXTI_CPUPR2) . . . . . . . . . . . . . . . . . . . . . . . 775
19.6.25 EXTI interrupt mask register (EXTI_CPUIMR3) . . . . . . . . . . . . . . . . . 776
19.6.26 EXTI event mask register (EXTI_CPUEMR3) . . . . . . . . . . . . . . . . . . . 777
19.6.27 EXTI pending register (EXTI_CPUPR3) . . . . . . . . . . . . . . . . . . . . . . . 777
19.6.28 EXTI register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 778
Contents RM0433
20/3289 RM0433 Rev 6
20 Cyclic redundancy check calculation unit (CRC) . . . . . . . . . . . . . . . . 781
20.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
20.2 CRC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 781
20.3 CRC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
20.3.1 CRC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
20.3.2 CRC internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
20.3.3 CRC operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 782
20.4 CRC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
20.4.1 CRC data register (CRC_DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 784
20.4.2 CRC independent data register (CRC_IDR) . . . . . . . . . . . . . . . . . . . . 784
20.4.3 CRC control register (CRC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
20.4.4 CRC initial value (CRC_INIT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 785
20.4.5 CRC polynomial (CRC_POL) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
20.4.6 CRC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 786
21 Flexible memory controller (FMC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
21.1 FMC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 787
21.2 FMC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 788
21.3 FMC internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
21.4 AHB interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
21.5 AXI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 790
21.5.1 Supported memories and transactions . . . . . . . . . . . . . . . . . . . . . . . . 791
21.6 External device address mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 792
21.6.1 NOR/PSRAM address mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 794
21.6.2 NAND Flash memory address mapping . . . . . . . . . . . . . . . . . . . . . . . 794
21.6.3 SDRAM address mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 795
21.7 NOR Flash/PSRAM controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 798
21.7.1 External memory interface signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 800
21.7.2 Supported memories and transactions . . . . . . . . . . . . . . . . . . . . . . . . 802
21.7.3 General timing rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803
21.7.4 NOR Flash/PSRAM controller asynchronous transactions . . . . . . . . . 803
21.7.5 Synchronous transactions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 823
21.7.6 NOR/PSRAM controller registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . 829
21.8 NAND Flash controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
21.8.1 External memory interface signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838
21.8.2 NAND Flash supported memories and transactions . . . . . . . . . . . . . . 839
RM0433 Rev 6 21/3289
RM0433 Contents
68
21.8.3 Timing diagrams for NAND Flash memories . . . . . . . . . . . . . . . . . . . . 840
21.8.4 NAND Flash operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 841
21.8.5 NAND Flash prewait feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 842
21.8.6 Computation of the error correction code (ECC)
in NAND Flash memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 843
21.8.7 NAND Flash controller registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 844
21.9 SDRAM controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
21.9.1 SDRAM controller main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 850
21.9.2 SDRAM External memory interface signals . . . . . . . . . . . . . . . . . . . . . 850
21.9.3 SDRAM controller functional description . . . . . . . . . . . . . . . . . . . . . . . 851
21.9.4 Low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858
21.9.5 SDRAM controller registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 861
21.10 FMC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868
22 Quad-SPI interface (QUADSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
22.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
22.2 QUADSPI main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 870
22.3 QUADSPI functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
22.3.1 QUADSPI block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 871
22.3.2 QUADSPI pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
22.3.3 QUADSPI command sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 872
22.3.4 QUADSPI signal interface protocol modes . . . . . . . . . . . . . . . . . . . . . 875
22.3.5 QUADSPI indirect mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 877
22.3.6 QUADSPI status flag polling mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.3.7 QUADSPI memory-mapped mode . . . . . . . . . . . . . . . . . . . . . . . . . . . 879
22.3.8 QUADSPI Free running clock mode . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.3.9 QUADSPI Flash memory configuration . . . . . . . . . . . . . . . . . . . . . . . . 880
22.3.10 QUADSPI delayed data sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . 880
22.3.11 QUADSPI configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.3.12 QUADSPI usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 881
22.3.13 Sending the instruction only once . . . . . . . . . . . . . . . . . . . . . . . . . . . . 883
22.3.14 QUADSPI error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
22.3.15 QUADSPI busy bit and abort functionality . . . . . . . . . . . . . . . . . . . . . . 884
22.3.16 nCS behavior . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 884
22.4 QUADSPI interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 886
22.5 QUADSPI registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 887
22.5.1 QUADSPI control register (QUADSPI_CR) . . . . . . . . . . . . . . . . . . . . . 887
Contents RM0433
22/3289 RM0433 Rev 6
22.5.2 QUADSPI device configuration register (QUADSPI_DCR) . . . . . . . . . 890
22.5.3 QUADSPI status register (QUADSPI_SR) . . . . . . . . . . . . . . . . . . . . . 891
22.5.4 QUADSPI flag clear register (QUADSPI_FCR) . . . . . . . . . . . . . . . . . . 892
22.5.5 QUADSPI data length register (QUADSPI_DLR) . . . . . . . . . . . . . . . . 892
22.5.6 QUADSPI communication configuration register (QUADSPI_CCR) . . 893
22.5.7 QUADSPI address register (QUADSPI_AR) . . . . . . . . . . . . . . . . . . . . 895
22.5.8 QUADSPI alternate bytes registers (QUADSPI_ABR) . . . . . . . . . . . . 896
22.5.9 QUADSPI data register (QUADSPI_DR) . . . . . . . . . . . . . . . . . . . . . . . 896
22.5.10 QUADSPI polling status mask register (QUADSPI _PSMKR) . . . . . . . 897
22.5.11 QUADSPI polling status match register (QUADSPI _PSMAR) . . . . . . 897
22.5.12 QUADSPI polling interval register (QUADSPI _PIR) . . . . . . . . . . . . . . 898
22.5.13 QUADSPI low-power timeout register (QUADSPI_LPTR) . . . . . . . . . . 898
22.5.14 QUADSPI register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 899
23 Delay block (DLYB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
23.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
23.2 DLYB main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
23.3 DLYB functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
23.3.1 DLYB diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 900
23.3.2 DLYB pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901
23.3.3 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 901
23.3.4 Delay line length configuration procedure . . . . . . . . . . . . . . . . . . . . . . 902
23.3.5 Output clock phase configuration procedure . . . . . . . . . . . . . . . . . . . . 902
23.4 DLYB registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
23.4.1 DLYB control register (DLYB_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 903
23.4.2 DLYB configuration register (DLYB_CFGR) . . . . . . . . . . . . . . . . . . . . 903
23.4.3 DLYB register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 904
24 Analog-to-digital converters (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
24.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 905
24.2 ADC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 906
24.3 ADC implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 907
24.4 ADC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
24.4.1 ADC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908
24.4.2 ADC pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 909
24.4.3 Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 910
RM0433 Rev 6 23/3289
RM0433 Contents
68
24.4.4 ADC1/2/3 connectivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 913
24.4.5 Slave AHB interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916
24.4.6 ADC deep-power-down mode (DEEPPWD) and ADC voltage regulator
(ADVREGEN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 916
24.4.7 Single-ended and differential input channels . . . . . . . . . . . . . . . . . . . . 917
24.4.8 Calibration (ADCAL, ADCALDIF, ADCALLIN, ADC_CALFACT) . . . . . 917
24.4.9 ADC on-off control (ADEN, ADDIS, ADRDY) . . . . . . . . . . . . . . . . . . . . 923
24.4.10 Constraints when writing the ADC control bits . . . . . . . . . . . . . . . . . . . 924
24.4.11 Channel selection (SQRx, JSQRx) . . . . . . . . . . . . . . . . . . . . . . . . . . . 924
24.4.12 Channel preselection register (ADC_PCSEL) . . . . . . . . . . . . . . . . . . . 925
24.4.13 Channel-wise programmable sampling time (SMPR1, SMPR2) . . . . . 925
24.4.14 Single conversion mode (CONT=0) . . . . . . . . . . . . . . . . . . . . . . . . . . . 926
24.4.15 Continuous conversion mode (CONT=1) . . . . . . . . . . . . . . . . . . . . . . . 927
24.4.16 Starting conversions (ADSTART, JADSTART) . . . . . . . . . . . . . . . . . . . 928
24.4.17 Timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 929
24.4.18 Stopping an ongoing conversion (ADSTP, JADSTP) . . . . . . . . . . . . . . 929
24.4.19 Conversion on external trigger and trigger polarity (EXTSEL, EXTEN,
JEXTSEL, JEXTEN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 931
24.4.20 Injected channel management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 934
24.4.21 Discontinuous mode (DISCEN, DISCNUM, JDISCEN) . . . . . . . . . . . . 936
24.4.22 Queue of context for injected conversions . . . . . . . . . . . . . . . . . . . . . . 937
24.4.23 Programmable resolution (RES) - fast conversion mode . . . . . . . . . . 945
24.4.24 End of conversion, end of sampling phase (EOC, JEOC, EOSMP) . . 945
24.4.25 End of conversion sequence (EOS, JEOS) . . . . . . . . . . . . . . . . . . . . . 945
24.4.26 Timing diagrams example (single/continuous modes,
hardware/software triggers) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 946
24.4.27 Data management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 947
24.4.28 Managing conversions using the DFSDM . . . . . . . . . . . . . . . . . . . . . . 954
24.4.29 Dynamic low-power features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 954
24.4.30 Analog window watchdog (AWD1EN, JAWD1EN, AWD1SGL,
 AWD1CH, AWD2CH, AWD3CH, AWD_HTRy, AWD_LTRy, AWDy) . . 959
24.4.31 Oversampler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 962
24.4.32 Dual ADC modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 968
24.4.33 Temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 983
24.4.34 VBAT supply monitoring . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 984
24.4.35 Monitoring the internal voltage reference . . . . . . . . . . . . . . . . . . . . . . 985
24.5 ADC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 987
24.6 ADC registers (for each ADC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 988
Contents RM0433
24/3289 RM0433 Rev 6
24.6.1 ADC interrupt and status register (ADC_ISR) . . . . . . . . . . . . . . . . . . . 988
24.6.2 ADC interrupt enable register (ADC_IER) . . . . . . . . . . . . . . . . . . . . . . 990
24.6.3 ADC control register (ADC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 992
24.6.4 ADC configuration register (ADC_CFGR) . . . . . . . . . . . . . . . . . . . . . 1002
24.6.5 ADC configuration register 2 (ADC_CFGR2) . . . . . . . . . . . . . . . . . . 1006
24.6.6 ADC sample time register 1 (ADC_SMPR1) . . . . . . . . . . . . . . . . . . . 1008
24.6.7 ADC sample time register 2 (ADC_SMPR2) . . . . . . . . . . . . . . . . . . . 1009
24.6.8 ADC channel preselection register (ADC_PCSEL) . . . . . . . . . . . . . . 1010
24.6.9 ADC watchdog threshold register 1 (ADC_LTR1) . . . . . . . . . . . . . . . 1010
24.6.10 ADC watchdog threshold register 1 (ADC_HTR1) . . . . . . . . . . . . . . . 1011
24.6.11 ADC regular sequence register 1 (ADC_SQR1) . . . . . . . . . . . . . . . . 1012
24.6.12 ADC regular sequence register 2 (ADC_SQR2) . . . . . . . . . . . . . . . . 1013
24.6.13 ADC regular sequence register 3 (ADC_SQR3) . . . . . . . . . . . . . . . . 1014
24.6.14 ADC regular sequence register 4 (ADC_SQR4) . . . . . . . . . . . . . . . . 1015
24.6.15 ADC regular Data Register (ADC_DR) . . . . . . . . . . . . . . . . . . . . . . . 1016
24.6.16 ADC injected sequence register (ADC_JSQR) . . . . . . . . . . . . . . . . . 1017
24.6.17 ADC injected channel y offset register (ADC_OFRy) . . . . . . . . . . . . 1019
24.6.18 ADC injected channel y data register (ADC_JDRy) . . . . . . . . . . . . . . 1020
24.6.19 ADC analog watchdog 2 configuration register
(ADC_AWD2CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1020
24.6.20 ADC analog watchdog 3 configuration register
(ADC_AWD3CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1021
24.6.21 ADC watchdog lower threshold register 2 (ADC_LTR2) . . . . . . . . . . 1021
24.6.22 ADC watchdog higher threshold register 2 (ADC_HTR2) . . . . . . . . . 1022
24.6.23 ADC watchdog lower threshold register 3 (ADC_LTR3) . . . . . . . . . . 1022
24.6.24 ADC watchdog higher threshold register 3 (ADC_HTR3) . . . . . . . . . 1023
24.6.25 ADC differential mode selection register (ADC_DIFSEL) . . . . . . . . . 1023
24.6.26 ADC calibration factors register (ADC_CALFACT) . . . . . . . . . . . . . . 1024
24.6.27 ADC calibration factor register 2 (ADC_CALFACT2) . . . . . . . . . . . . . 1024
24.7 ADC common registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1026
24.7.1 ADC x common status register (ADCx_CSR) (x=1/2 or 3) . . . . . . . . 1026
24.7.2 ADC x common control register (ADCx_CCR) (x=1/2 or 3) . . . . . . . . 1028
24.7.3 ADC x common regular data register for dual mode
(ADCx_CDR) (x=1/2 or 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1031
24.7.4 ADC x common regular data register for 32-bit dual mode
(ADCx_CDR2) (x=1/2 or 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1031
24.7.5 ADC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1032
RM0433 Rev 6 25/3289
RM0433 Contents
68
25 Digital-to-analog converter (DAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1036
25.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1036
25.2 DAC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1036
25.3 DAC implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1037
25.4 DAC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1038
25.4.1 DAC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1038
25.4.2 DAC pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1039
25.4.3 DAC channel enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1040
25.4.4 DAC data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1040
25.4.5 DAC conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041
25.4.6 DAC output voltage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1041
25.4.7 DAC trigger selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1042
25.4.8 DMA requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1043
25.4.9 Noise generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1043
25.4.10 Triangle-wave generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1045
25.4.11 DAC channel modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1046
25.4.12 DAC channel buffer calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1049
25.4.13 Dual DAC channel conversion modes (if available) . . . . . . . . . . . . . . 1050
25.5 DAC low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1055
25.6 DAC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1055
25.7 DAC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1056
25.7.1 DAC control register (DAC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1056
25.7.2 DAC software trigger register (DAC_SWTRGR) . . . . . . . . . . . . . . . . 1059
25.7.3 DAC channel1 12-bit right-aligned data holding register
(DAC_DHR12R1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1060
25.7.4 DAC channel1 12-bit left aligned data holding register
(DAC_DHR12L1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1060
25.7.5 DAC channel1 8-bit right aligned data holding register
(DAC_DHR8R1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1061
25.7.6 DAC channel2 12-bit right aligned data holding register
(DAC_DHR12R2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1061
25.7.7 DAC channel2 12-bit left aligned data holding register
(DAC_DHR12L2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1062
25.7.8 DAC channel2 8-bit right-aligned data holding register
(DAC_DHR8R2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1062
25.7.9 Dual DAC 12-bit right-aligned data holding register
(DAC_DHR12RD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1063
Contents RM0433
26/3289 RM0433 Rev 6
25.7.10 Dual DAC 12-bit left aligned data holding register
(DAC_DHR12LD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1063
25.7.11 Dual DAC 8-bit right aligned data holding register
(DAC_DHR8RD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1064
25.7.12 DAC channel1 data output register (DAC_DOR1) . . . . . . . . . . . . . . . 1064
25.7.13 DAC channel2 data output register (DAC_DOR2) . . . . . . . . . . . . . . . 1065
25.7.14 DAC status register (DAC_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1065
25.7.15 DAC calibration control register (DAC_CCR) . . . . . . . . . . . . . . . . . . 1067
25.7.16 DAC mode control register (DAC_MCR) . . . . . . . . . . . . . . . . . . . . . . 1067
25.7.17 DAC channel1 sample and hold sample time register
(DAC_SHSR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1069
25.7.18 DAC channel2 sample and hold sample time register
(DAC_SHSR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1069
25.7.19 DAC sample and hold time register (DAC_SHHR) . . . . . . . . . . . . . . 1070
25.7.20 DAC sample and hold refresh time register (DAC_SHRR) . . . . . . . . 1070
25.7.21 DAC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1072
26 Voltage reference buffer (VREFBUF) . . . . . . . . . . . . . . . . . . . . . . . . . 1074
26.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1074
26.2 VREFBUF functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1074
26.3 VREFBUF registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1075
26.3.1 VREFBUF control and status register (VREFBUF_CSR) . . . . . . . . . 1075
26.3.2 VREFBUF calibration control register (VREFBUF_CCR) . . . . . . . . . 1076
26.3.3 VREFBUF register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1076
27 Comparator (COMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077
27.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077
27.2 COMP main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1077
27.3 COMP functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078
27.3.1 COMP block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078
27.3.2 COMP pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1078
27.3.3 COMP reset and clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080
27.3.4 Comparator LOCK mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080
27.3.5 Window comparator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080
27.3.6 Hysteresis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1080
27.3.7 Comparator output blanking function . . . . . . . . . . . . . . . . . . . . . . . . . 1081
27.3.8 Comparator output on GPIOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1082
27.3.9 Comparator output redirection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083
RM0433 Rev 6 27/3289
RM0433 Contents
68
27.3.10 COMP power and speed modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1083
27.4 COMP low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084
27.5 COMP interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084
27.5.1 Interrupt through EXTI block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1084
27.5.2 Interrupt through NVIC of the CPU . . . . . . . . . . . . . . . . . . . . . . . . . . 1085
27.6 SCALER function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1085
27.7 COMP registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1086
27.7.1 Comparator status register (COMP_SR) . . . . . . . . . . . . . . . . . . . . . . 1086
27.7.2 Comparator interrupt clear flag register (COMP_ICFR) . . . . . . . . . . 1086
27.7.3 Comparator option register (COMP_OR) . . . . . . . . . . . . . . . . . . . . . 1087
27.7.4 Comparator configuration register 1 (COMP_CFGR1) . . . . . . . . . . . 1088
27.7.5 Comparator configuration register 2 (COMP_CFGR2) . . . . . . . . . . . 1090
27.7.6 COMP register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1093
28 Operational amplifiers (OPAMP) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1094
28.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1094
28.2 OPAMP main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1094
28.3 OPAMP functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1094
28.3.1 OPAMP reset and clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1094
28.3.2 Initial configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1095
28.3.3 Signal routing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1095
28.3.4 OPAMP modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1096
28.3.5 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1102
28.4 OPAMP low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1104
28.5 OPAMP PGA gain . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1104
28.6 OPAMP registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1104
28.6.1 OPAMP1 control/status register (OPAMP1_CSR) . . . . . . . . . . . . . . . 1104
28.6.2 OPAMP1 trimming register in normal mode (OPAMP1_OTR) . . . . . . 1106
28.6.3 OPAMP1 trimming register in high-speed mode (OPAMP1_HSOTR) 1107
28.6.4 OPAMP option register (OPAMP_OR) . . . . . . . . . . . . . . . . . . . . . . . . 1107
28.6.5 OPAMP2 control/status register (OPAMP2_CSR) . . . . . . . . . . . . . . . 1107
28.6.6 OPAMP2 trimming register in normal mode (OPAMP2_OTR) . . . . . . 1109
28.6.7 OPAMP2 trimming register in high-speed mode (OPAMP2_HSOTR) 1110
28.6.8 OPAMP register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1111
29 Digital filter for sigma delta modulators (DFSDM) . . . . . . . . . . . . . . 1112
Contents RM0433
28/3289 RM0433 Rev 6
29.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1112
29.2 DFSDM main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1113
29.3 DFSDM implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1114
29.4 DFSDM functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1115
29.4.1 DFSDM block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1115
29.4.2 DFSDM pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . 1116
29.4.3 DFSDM reset and clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1117
29.4.4 Serial channel transceivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1118
29.4.5 Configuring the input serial interface . . . . . . . . . . . . . . . . . . . . . . . . . 1127
29.4.6 Parallel data inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1127
29.4.7 Channel selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1129
29.4.8 Digital filter configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1130
29.4.9 Integrator unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1131
29.4.10 Analog watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1132
29.4.11 Short-circuit detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1134
29.4.12 Extreme detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1135
29.4.13 Data unit block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1135
29.4.14 Signed data format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1136
29.4.15 Launching conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1137
29.4.16 Continuous and fast continuous modes . . . . . . . . . . . . . . . . . . . . . . . 1137
29.4.17 Request precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1138
29.4.18 Power optimization in run mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1139
29.5 DFSDM interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1139
29.6 DFSDM DMA transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1141
29.7 DFSDM channel y registers (y=0..7) . . . . . . . . . . . . . . . . . . . . . . . . . . .1141
29.7.1 DFSDM channel y configuration register (DFSDM_CHyCFGR1) . . . 1141
29.7.2 DFSDM channel y configuration register (DFSDM_CHyCFGR2) . . . 1143
29.7.3 DFSDM channel y analog watchdog and short-circuit detector register
(DFSDM_CHyAWSCDR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1144
29.7.4 DFSDM channel y watchdog filter data register
(DFSDM_CHyWDATR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1145
29.7.5 DFSDM channel y data input register (DFSDM_CHyDATINR) . . . . . 1145
29.8 DFSDM filter x module registers (x=0..3) . . . . . . . . . . . . . . . . . . . . . . . .1146
29.8.1 DFSDM filter x control register 1 (DFSDM_FLTxCR1) . . . . . . . . . . . 1146
29.8.2 DFSDM filter x control register 2 (DFSDM_FLTxCR2) . . . . . . . . . . . 1149
29.8.3 DFSDM filter x interrupt and status register (DFSDM_FLTxISR) . . . . 1150
29.8.4 DFSDM filter x interrupt flag clear register (DFSDM_FLTxICR) . . . . 1152
RM0433 Rev 6 29/3289
RM0433 Contents
68
29.8.5 DFSDM filter x injected channel group selection register
(DFSDM_FLTxJCHGR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1153
29.8.6 DFSDM filter x control register (DFSDM_FLTxFCR) . . . . . . . . . . . . . 1153
29.8.7 DFSDM filter x data register for injected group
(DFSDM_FLTxJDATAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1154
29.8.8 DFSDM filter x data register for the regular channel
(DFSDM_FLTxRDATAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1155
29.8.9 DFSDM filter x analog watchdog high threshold register
(DFSDM_FLTxAWHTR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156
29.8.10 DFSDM filter x analog watchdog low threshold register
(DFSDM_FLTxAWLTR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156
29.8.11 DFSDM filter x analog watchdog status register
(DFSDM_FLTxAWSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1157
29.8.12 DFSDM filter x analog watchdog clear flag register
(DFSDM_FLTxAWCFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1158
29.8.13 DFSDM filter x extremes detector maximum register
(DFSDM_FLTxEXMAX) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1158
29.8.14 DFSDM filter x extremes detector minimum register
(DFSDM_FLTxEXMIN) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1159
29.8.15 DFSDM filter x conversion timer register (DFSDM_FLTxCNVTIMR) . 1159
29.8.16 DFSDM register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1160
30 Digital camera interface (DCMI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1170
30.1 DCMI introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1170
30.2 DCMI main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1170
30.3 DCMI clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1170
30.4 DCMI functional overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1170
30.4.1 DCMI block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1171
30.4.2 DCMI internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1172
30.4.3 DMA interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1172
30.4.4 DCMI physical interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1172
30.4.5 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1174
30.4.6 Capture modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1177
30.4.7 Crop feature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1178
30.4.8 JPEG format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1179
30.4.9 FIFO . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1179
30.5 Data format description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1180
30.5.1 Data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1180
30.5.2 Monochrome format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1180
Contents RM0433
30/3289 RM0433 Rev 6
30.5.3 RGB format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1181
30.5.4 YCbCr format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1181
30.5.5 YCbCr format - Y only . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1181
30.5.6 Half resolution image extraction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1182
30.6 DCMI interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1182
30.7 DCMI register description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1182
30.7.1 DCMI control register (DCMI_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1182
30.7.2 DCMI status register (DCMI_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1186
30.7.3 DCMI raw interrupt status register (DCMI_RIS) . . . . . . . . . . . . . . . . 1187
30.7.4 DCMI interrupt enable register (DCMI_IER) . . . . . . . . . . . . . . . . . . . 1188
30.7.5 DCMI masked interrupt status register (DCMI_MIS) . . . . . . . . . . . . . 1189
30.7.6 DCMI interrupt clear register (DCMI_ICR) . . . . . . . . . . . . . . . . . . . . . 1190
30.7.7 DCMI embedded synchronization code register (DCMI_ESCR) . . . . 1191
30.7.8 DCMI embedded synchronization unmask register (DCMI_ESUR) . 1192
30.7.9 DCMI crop window start (DCMI_CWSTRT) . . . . . . . . . . . . . . . . . . . . 1193
30.7.10 DCMI crop window size (DCMI_CWSIZE) . . . . . . . . . . . . . . . . . . . . . 1193
30.7.11 DCMI data register (DCMI_DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1194
30.7.12 DCMI register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1195
31 LCD-TFT display controller (LTDC) . . . . . . . . . . . . . . . . . . . . . . . . . . 1196
31.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1196
31.2 LTDC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1196
31.3 LTDC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1196
31.3.1 LTDC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1196
31.3.2 LCD-TFT internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1197
31.3.3 LTDC pins and external signal interface . . . . . . . . . . . . . . . . . . . . . . 1198
31.3.4 LTDC reset and clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1198
31.4 LTDC programmable parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1200
31.4.1 LTDC global configuration parameters . . . . . . . . . . . . . . . . . . . . . . . 1200
31.4.2 Layer programmable parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . 1202
31.5 LTDC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1207
31.6 LTDC programming procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1208
31.7 LTDC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1208
31.7.1 LTDC synchronization size configuration register (LTDC_SSCR) . . . 1208
31.7.2 LTDC back porch configuration register (LTDC_BPCR) . . . . . . . . . . 1209
31.7.3 LTDC active width configuration register (LTDC_AWCR) . . . . . . . . . 1210
RM0433 Rev 6 31/3289
RM0433 Contents
68
31.7.4 LTDC total width configuration register (LTDC_TWCR) . . . . . . . . . . . 1211
31.7.5 LTDC global control register (LTDC_GCR) . . . . . . . . . . . . . . . . . . . . 1211
31.7.6 LTDC shadow reload configuration register (LTDC_SRCR) . . . . . . . 1213
31.7.7 LTDC background color configuration register (LTDC_BCCR) . . . . . 1213
31.7.8 LTDC interrupt enable register (LTDC_IER) . . . . . . . . . . . . . . . . . . . 1214
31.7.9 LTDC interrupt status register (LTDC_ISR) . . . . . . . . . . . . . . . . . . . . 1215
31.7.10 LTDC Interrupt Clear Register (LTDC_ICR) . . . . . . . . . . . . . . . . . . . . 1215
31.7.11 LTDC line interrupt position configuration register (LTDC_LIPCR) . . 1216
31.7.12 LTDC current position status register (LTDC_CPSR) . . . . . . . . . . . . 1216
31.7.13 LTDC current display status register (LTDC_CDSR) . . . . . . . . . . . . . 1217
31.7.14 LTDC layer x control register (LTDC_LxCR) . . . . . . . . . . . . . . . . . . . 1217
31.7.15 LTDC layer x window horizontal position configuration register
(LTDC_LxWHPCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1218
31.7.16 LTDC layer x window vertical position configuration register
(LTDC_LxWVPCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1219
31.7.17 LTDC layer x color keying configuration register
(LTDC_LxCKCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1220
31.7.18 LTDC layer x pixel format configuration register
(LTDC_LxPFCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1220
31.7.19 LTDC layer x constant alpha configuration register
(LTDC_LxCACR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1221
31.7.20 LTDC layer x default color configuration register
(LTDC_LxDCCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1222
31.7.21 LTDC layer x blending factors configuration register
(LTDC_LxBFCR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1223
31.7.22 LTDC layer x color frame buffer address register
(LTDC_LxCFBAR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1224
31.7.23 LTDC layer x color frame buffer length register
(LTDC_LxCFBLR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1224
31.7.24 LTDC layer x color frame buffer line number register
(LTDC_LxCFBLNR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1225
31.7.25 LTDC layer x CLUT write register (LTDC_LxCLUTWR) . . . . . . . . . . 1226
31.7.26 LTDC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1227
32 JPEG codec (JPEG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1230
32.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1230
32.2 JPEG codec main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1230
32.3 JPEG codec block functional description . . . . . . . . . . . . . . . . . . . . . . . 1231
32.3.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1231
32.3.2 JPEG internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1231
Contents RM0433
32/3289 RM0433 Rev 6
32.3.3 JPEG decoding procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1232
32.3.4 JPEG encoding procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1233
32.4 JPEG codec interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1235
32.5 JPEG codec registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1236
32.5.1 JPEG codec control register (JPEG_CONFR0) . . . . . . . . . . . . . . . . 1236
32.5.2 JPEG codec configuration register 1 (JPEG_CONFR1) . . . . . . . . . . 1236
32.5.3 JPEG codec configuration register 2 (JPEG_CONFR2) . . . . . . . . . . 1237
32.5.4 JPEG codec configuration register 3 (JPEG_CONFR3) . . . . . . . . . . 1238
32.5.5 JPEG codec configuration register 4-7 (JPEG_CONFR4-7) . . . . . . . 1238
32.5.6 JPEG control register (JPEG_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1239
32.5.7 JPEG status register (JPEG_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1240
32.5.8 JPEG clear flag register (JPEG_CFR) . . . . . . . . . . . . . . . . . . . . . . . . 1241
32.5.9 JPEG data input register (JPEG_DIR) . . . . . . . . . . . . . . . . . . . . . . . . 1242
32.5.10 JPEG data output register (JPEG_DOR) . . . . . . . . . . . . . . . . . . . . . . 1242
32.5.11 JPEG quantization memory x (JPEG_QMEMx[y]) . . . . . . . . . . . . . . . 1243
32.5.12 JPEG Huffman min (JPEG_HUFFMIN[4*y x]) . . . . . . . . . . . . . . . . . 1243
32.5.13 JPEG Huffman base (JPEG_HUFFBASE[y]) . . . . . . . . . . . . . . . . . . 1244
32.5.14 JPEG Huffman symbol (JPEG_HUFFSYMB[y]) . . . . . . . . . . . . . . . . 1245
32.5.15 JPEG DHT memory (JPEG_DHTMEM[y]) . . . . . . . . . . . . . . . . . . . . . 1245
32.5.16 JPEG Huffman encoder ACx (JPEG_HUFFENC_ACx[y]) . . . . . . . . . 1246
32.5.17 JPEG Huffman encoder DCx (JPEG_HUFFENC_DCx[y]) . . . . . . . . 1246
32.5.18 JPEG codec register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1248
33 True random number generator (RNG) . . . . . . . . . . . . . . . . . . . . . . . 1250
33.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1250
33.2 RNG main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1250
33.3 RNG functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1251
33.3.1 RNG block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1251
33.3.2 RNG internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1251
33.3.3 Random number generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1252
33.3.4 RNG initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1254
33.3.5 RNG operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1255
33.3.6 RNG clocking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1256
33.3.7 Error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1256
33.3.8 RNG low-power usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1257
33.4 RNG interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1257
RM0433 Rev 6 33/3289
RM0433 Contents
68
33.5 RNG processing time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258
33.6 RNG entropy source validation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258
33.6.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258
33.6.2 Validation conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258
33.6.3 Data collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1258
33.7 RNG registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1259
33.7.1 RNG control register (RNG_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1259
33.7.2 RNG status register (RNG_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1260
33.7.3 RNG data register (RNG_DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1261
33.7.4 RNG register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1262
34 Cryptographic processor (CRYP) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263
34.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263
34.2 CRYP main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1263
34.3 CRYP functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1265
34.3.1 CRYP block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1265
34.3.2 CRYP internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1266
34.3.3 CRYP DES/TDES cryptographic core . . . . . . . . . . . . . . . . . . . . . . . . 1266
34.3.4 CRYP AES cryptographic core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1267
34.3.5 CRYP procedure to perform a cipher operation . . . . . . . . . . . . . . . . . 1273
34.3.6 CRYP busy state . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1276
34.3.7 Preparing the CRYP AES key for decryption . . . . . . . . . . . . . . . . . . . 1277
34.3.8 CRYP stealing and data padding . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1277
34.3.9 CRYP suspend/resume operations . . . . . . . . . . . . . . . . . . . . . . . . . . 1279
34.3.10 CRYP DES/TDES basic chaining modes (ECB, CBC) . . . . . . . . . . . 1280
34.3.11 CRYP AES basic chaining modes (ECB, CBC) . . . . . . . . . . . . . . . . . 1285
34.3.12 CRYP AES counter mode (AES-CTR) . . . . . . . . . . . . . . . . . . . . . . . . 1290
34.3.13 CRYP AES Galois/counter mode (GCM) . . . . . . . . . . . . . . . . . . . . . . 1294
34.3.14 CRYP AES Galois message authentication code (GMAC) . . . . . . . . 1299
34.3.15 CRYP AES Counter with CBC-MAC (CCM) . . . . . . . . . . . . . . . . . . . 1300
34.3.16 CRYP data registers and data swapping . . . . . . . . . . . . . . . . . . . . . . 1306
34.3.17 CRYP key registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1310
34.3.18 CRYP initialization vector registers . . . . . . . . . . . . . . . . . . . . . . . . . . 1311
34.3.19 CRYP DMA interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1312
34.3.20 CRYP error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1314
34.4 CRYP interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1314
Contents RM0433
34/3289 RM0433 Rev 6
34.5 CRYP processing time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1316
34.6 CRYP registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1317
34.6.1 CRYP control register (CRYP_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . 1317
34.6.2 CRYP status register (CRYP_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1319
34.6.3 CRYP data input register (CRYP_DIN) . . . . . . . . . . . . . . . . . . . . . . . 1319
34.6.4 CRYP data output register (CRYP_DOUT) . . . . . . . . . . . . . . . . . . . . 1320
34.6.5 CRYP DMA control register (CRYP_DMACR) . . . . . . . . . . . . . . . . . . 1321
34.6.6 CRYP interrupt mask set/clear register (CRYP_IMSCR) . . . . . . . . . . 1321
34.6.7 CRYP raw interrupt status register (CRYP_RISR) . . . . . . . . . . . . . . 1322
34.6.8 CRYP masked interrupt status register (CRYP_MISR) . . . . . . . . . . . 1322
34.6.9 CRYP key register 0L (CRYP_K0LR) . . . . . . . . . . . . . . . . . . . . . . . . 1323
34.6.10 CRYP key register 0R (CRYP_K0RR) . . . . . . . . . . . . . . . . . . . . . . . . 1324
34.6.11 CRYP key register 1L (CRYP_K1LR) . . . . . . . . . . . . . . . . . . . . . . . . 1324
34.6.12 CRYP key register 1R (CRYP_K1RR) . . . . . . . . . . . . . . . . . . . . . . . . 1325
34.6.13 CRYP key register 2L (CRYP_K2LR) . . . . . . . . . . . . . . . . . . . . . . . . 1325
34.6.14 CRYP key register 2R (CRYP_K2RR) . . . . . . . . . . . . . . . . . . . . . . . . 1325
34.6.15 CRYP key register 3L (CRYP_K3LR) . . . . . . . . . . . . . . . . . . . . . . . . 1326
34.6.16 CRYP key register 3R (CRYP_K3RR) . . . . . . . . . . . . . . . . . . . . . . . . 1326
34.6.17 CRYP initialization vector register 0L (CRYP_IV0LR) . . . . . . . . . . . . 1327
34.6.18 CRYP initialization vector register 0R (CRYP_IV0RR) . . . . . . . . . . . 1327
34.6.19 CRYP initialization vector register 1L (CRYP_IV1LR) . . . . . . . . . . . . 1328
34.6.20 CRYP initialization vector register 1R (CRYP_IV1RR) . . . . . . . . . . . 1328
34.6.21 CRYP context swap GCM-CCM registers (CRYP_CSGCMCCMxR) 1328
34.6.22 CRYP context swap GCM registers (CRYP_CSGCMxR) . . . . . . . . . 1329
34.6.23 CRYP register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1330
35 Hash processor (HASH) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1333
35.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1333
35.2 HASH main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1333
35.3 HASH functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1334
35.3.1 HASH block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1334
35.3.2 HASH internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1334
35.3.3 About secure hash algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1335
35.3.4 Message data feeding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1335
35.3.5 Message digest computing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1337
35.3.6 Message padding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1338
35.3.7 HMAC operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1340
RM0433 Rev 6 35/3289
RM0433 Contents
68
35.3.8 Context swapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1342
35.3.9 HASH DMA interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1344
35.3.10 HASH error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1344
35.4 HASH interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1344
35.5 HASH processing time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1345
35.6 HASH registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1346
35.6.1 HASH control register (HASH_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . 1346
35.6.2 HASH data input register (HASH_DIN) . . . . . . . . . . . . . . . . . . . . . . . 1349
35.6.3 HASH start register (HASH_STR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1350
35.6.4 HASH digest registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1351
35.6.5 HASH interrupt enable register (HASH_IMR) . . . . . . . . . . . . . . . . . . 1352
35.6.6 HASH status register (HASH_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1353
35.6.7 HASH context swap registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1354
35.6.8 HASH register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1355
36 High-Resolution Timer (HRTIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1356
36.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1356
36.2 Main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1357
36.3 Functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1358
36.3.1 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1358
36.3.2 HRTIM pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1360
36.3.3 Clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1361
36.3.4 Timer A..E timing units . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1364
36.3.5 Master timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1381
36.3.6 Set/reset events priorities and narrow pulses management . . . . . . . 1382
36.3.7 External events global conditioning . . . . . . . . . . . . . . . . . . . . . . . . . . 1383
36.3.8 External event filtering in timing units . . . . . . . . . . . . . . . . . . . . . . . . 1388
36.3.9 Delayed Protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1393
36.3.10 Register preload and update management . . . . . . . . . . . . . . . . . . . . 1399
36.3.11 Events propagation within or across multiple timers . . . . . . . . . . . . . 1402
36.3.12 Output management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1406
36.3.13 Burst mode controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1408
36.3.14 Chopper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1417
36.3.15 Fault protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1418
36.3.16 Auxiliary outputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1421
36.3.17 Synchronizing the HRTIM with other timers or HRTIM instances . . . 1424
Contents RM0433
36/3289 RM0433 Rev 6
36.3.18 ADC triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1427
36.3.19 DAC triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1428
36.3.20 HRTIM Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1430
36.3.21 DMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1432
36.3.22 HRTIM initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1435
36.3.23 Debug . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1436
36.4 Application use cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1437
36.4.1 Buck converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1437
36.4.2 Buck converter with synchronous rectification . . . . . . . . . . . . . . . . . . 1438
36.4.3 Multiphase converters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1439
36.4.4 Transition mode Power Factor Correction . . . . . . . . . . . . . . . . . . . . . 1441
36.5 HRTIM registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1443
36.5.1 HRTIM Master Timer Control Register (HRTIM_MCR) . . . . . . . . . . . 1443
36.5.2 HRTIM Master Timer Interrupt Status Register (HRTIM_MISR) . . . . 1446
36.5.3 HRTIM Master Timer Interrupt Clear Register (HRTIM_MICR) . . . . . 1447
36.5.4 HRTIM Master Timer DMA / Interrupt Enable Register
(HRTIM_MDIER) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1448
36.5.5 HRTIM Master Timer Counter Register (HRTIM_MCNTR) . . . . . . . . 1450
36.5.6 HRTIM Master Timer Period Register (HRTIM_MPER) . . . . . . . . . . . 1450
36.5.7 HRTIM Master Timer Repetition Register (HRTIM_MREP) . . . . . . . . 1451
36.5.8 HRTIM Master Timer Compare 1 Register (HRTIM_MCMP1R) . . . . 1451
36.5.9 HRTIM Master Timer Compare 2 Register (HRTIM_MCMP2R) . . . . 1452
36.5.10 HRTIM Master Timer Compare 3 Register (HRTIM_MCMP3R) . . . . 1452
36.5.11 HRTIM Master Timer Compare 4 Register (HRTIM_MCMP4R) . . . . 1453
36.5.12 HRTIM Timerx Control Register (HRTIM_TIMxCR) . . . . . . . . . . . . . . 1454
36.5.13 HRTIM Timerx Interrupt Status Register (HRTIM_TIMxISR) . . . . . . . 1458
36.5.14 HRTIM Timerx Interrupt Clear Register (HRTIM_TIMxICR) . . . . . . . 1460
36.5.15 HRTIM Timerx DMA / Interrupt Enable Register
(HRTIM_TIMxDIER) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1461
36.5.16 HRTIM Timerx Counter Register (HRTIM_CNTxR) . . . . . . . . . . . . . . 1464
36.5.17 HRTIM Timerx Period Register (HRTIM_PERxR) . . . . . . . . . . . . . . . 1464
36.5.18 HRTIM Timerx Repetition Register (HRTIM_REPxR) . . . . . . . . . . . . 1465
36.5.19 HRTIM Timerx Compare 1 Register (HRTIM_CMP1xR) . . . . . . . . . . 1465
36.5.20 HRTIM Timerx Compare 1 Compound Register
(HRTIM_CMP1CxR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1466
36.5.21 HRTIM Timerx Compare 2 Register (HRTIM_CMP2xR) . . . . . . . . . . 1466
36.5.22 HRTIM Timerx Compare 3 Register (HRTIM_CMP3xR) . . . . . . . . . . 1467
36.5.23 HRTIM Timerx Compare 4 Register (HRTIM_CMP4xR) . . . . . . . . . . 1467
RM0433 Rev 6 37/3289
RM0433 Contents
68
36.5.24 HRTIM Timerx Capture 1 Register (HRTIM_CPT1xR) . . . . . . . . . . . 1468
36.5.25 HRTIM Timerx Capture 2 Register (HRTIM_CPT2xR) . . . . . . . . . . . 1468
36.5.26 HRTIM Timerx Deadtime Register (HRTIM_DTxR) . . . . . . . . . . . . . . 1469
36.5.27 HRTIM Timerx Output1 Set Register (HRTIM_SETx1R) . . . . . . . . . . 1471
36.5.28 HRTIM Timerx Output1 Reset Register (HRTIM_RSTx1R) . . . . . . . . 1473
36.5.29 HRTIM Timerx Output2 Set Register (HRTIM_SETx2R) . . . . . . . . . . 1473
36.5.30 HRTIM Timerx Output2 Reset Register (HRTIM_RSTx2R) . . . . . . . . 1474
36.5.31 HRTIM Timerx External Event Filtering Register 1
(HRTIM_EEFxR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1475
36.5.32 HRTIM Timerx External Event Filtering Register 2
(HRTIM_EEFxR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1477
36.5.33 HRTIM Timerx Reset Register (HRTIM_RSTxR) . . . . . . . . . . . . . . . . 1478
36.5.34 HRTIM Timerx Chopper Register (HRTIM_CHPxR) . . . . . . . . . . . . . 1481
36.5.35 HRTIM Timerx Capture 1 Control Register (HRTIM_CPT1xCR) . . . . 1483
36.5.36 HRTIM Timerx Capture 2 Control Register (HRTIM_CPT2xCR) . . . . 1484
36.5.37 HRTIM Timerx Output Register (HRTIM_OUTxR) . . . . . . . . . . . . . . . 1487
36.5.38 HRTIM Timerx Fault Register (HRTIM_FLTxR) . . . . . . . . . . . . . . . . . 1490
36.5.39 HRTIM Control Register 1 (HRTIM_CR1) . . . . . . . . . . . . . . . . . . . . . 1491
36.5.40 HRTIM Control Register 2 (HRTIM_CR2) . . . . . . . . . . . . . . . . . . . . . 1493
36.5.41 HRTIM Interrupt Status Register (HRTIM_ISR) . . . . . . . . . . . . . . . . . 1494
36.5.42 HRTIM Interrupt Clear Register (HRTIM_ICR) . . . . . . . . . . . . . . . . . 1495
36.5.43 HRTIM Interrupt Enable Register (HRTIM_IER) . . . . . . . . . . . . . . . . 1496
36.5.44 HRTIM Output Enable Register (HRTIM_OENR) . . . . . . . . . . . . . . . 1497
36.5.45 HRTIM Output Disable Register (HRTIM_ODISR) . . . . . . . . . . . . . . 1498
36.5.46 HRTIM Output Disable Status Register (HRTIM_ODSR) . . . . . . . . . 1499
36.5.47 HRTIM Burst Mode Control Register (HRTIM_BMCR) . . . . . . . . . . . 1500
36.5.48 HRTIM Burst Mode Trigger Register (HRTIM_BMTRGR) . . . . . . . . . 1502
36.5.49 HRTIM Burst Mode Compare Register (HRTIM_BMCMPR) . . . . . . . 1504
36.5.50 HRTIM Burst Mode Period Register (HRTIM_BMPER) . . . . . . . . . . . 1504
36.5.51 HRTIM Timer External Event Control Register 1 (HRTIM_EECR1) . 1505
36.5.52 HRTIM Timer External Event Control Register 2 (HRTIM_EECR2) . 1507
36.5.53 HRTIM Timer External Event Control Register 3 (HRTIM_EECR3) . 1508
36.5.54 HRTIM ADC Trigger 1 Register (HRTIM_ADC1R) . . . . . . . . . . . . . . . 1509
36.5.55 HRTIM ADC Trigger 2 Register (HRTIM_ADC2R) . . . . . . . . . . . . . . . 1510
36.5.56 HRTIM ADC Trigger 3 Register (HRTIM_ADC3R) . . . . . . . . . . . . . . . 1511
36.5.57 HRTIM ADC Trigger 4 Register (HRTIM_ADC4R) . . . . . . . . . . . . . . . 1513
36.5.58 HRTIM Fault Input Register 1 (HRTIM_FLTINR1) . . . . . . . . . . . . . . . 1515
36.5.59 HRTIM Fault Input Register 2 (HRTIM_FLTINR2) . . . . . . . . . . . . . . . 1517
Contents RM0433
38/3289 RM0433 Rev 6
36.5.60 HRTIM Burst DMA Master timer update Register
(HRTIM_BDMUPR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1519
36.5.61 HRTIM Burst DMA Timerx update Register (HRTIM_BDTxUPR) . . . 1520
36.5.62 HRTIM Burst DMA Data Register (HRTIM_BDMADR) . . . . . . . . . . . 1521
36.5.63 HRTIM register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1522
37 Advanced-control timers (TIM1/TIM8) . . . . . . . . . . . . . . . . . . . . . . . . 1531
37.1 TIM1/TIM8 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1531
37.2 TIM1/TIM8 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1531
37.3 TIM1/TIM8 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1533
37.3.1 Time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1533
37.3.2 Counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1535
37.3.3 Repetition counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1546
37.3.4 External trigger input . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1548
37.3.5 Clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1549
37.3.6 Capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1553
37.3.7 Input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1555
37.3.8 PWM input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1556
37.3.9 Forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1557
37.3.10 Output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1558
37.3.11 PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1559
37.3.12 Asymmetric PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1562
37.3.13 Combined PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1563
37.3.14 Combined 3-phase PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1564
37.3.15 Complementary outputs and dead-time insertion . . . . . . . . . . . . . . . 1565
37.3.16 Using the break function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1567
37.3.17 Bidirectional break inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1573
37.3.18 Clearing the OCxREF signal on an external event . . . . . . . . . . . . . . 1573
37.3.19 6-step PWM generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1575
37.3.20 One-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1576
37.3.21 Retriggerable one pulse mode (OPM) . . . . . . . . . . . . . . . . . . . . . . . . 1577
37.3.22 Encoder interface mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1578
37.3.23 UIF bit remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1580
37.3.24 Timer input XOR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581
37.3.25 Interfacing with Hall sensors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1581
37.3.26 Timer synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1584
37.3.27 ADC synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1588
RM0433 Rev 6 39/3289
RM0433 Contents
68
37.3.28 DMA burst mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1588
37.3.29 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1589
37.4 TIM1/TIM8 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1590
37.4.1 TIMx control register 1 (TIMx_CR1)(x = 1, 8) . . . . . . . . . . . . . . . . . . 1590
37.4.2 TIMx control register 2 (TIMx_CR2)(x = 1, 8) . . . . . . . . . . . . . . . . . . 1591
37.4.3 TIMx slave mode control register (TIMx_SMCR)(x = 1, 8) . . . . . . . . 1594
37.4.4 TIMx DMA/interrupt enable register (TIMx_DIER)(x = 1, 8) . . . . . . . . 1596
37.4.5 TIMx status register (TIMx_SR)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . 1598
37.4.6 TIMx event generation register (TIMx_EGR)(x = 1, 8) . . . . . . . . . . . . 1600
37.4.7 TIMx capture/compare mode register 1 [alternate]
(TIMx_CCMR1)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1601
37.4.8 TIMx capture/compare mode register 1 [alternate]
(TIMx_CCMR1)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1602
37.4.9 TIMx capture/compare mode register 2 [alternate]
(TIMx_CCMR2)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1605
37.4.10 TIMx capture/compare mode register 2 [alternate]
(TIMx_CCMR2)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1606
37.4.11 TIMx capture/compare enable register
(TIMx_CCER)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1608
37.4.12 TIMx counter (TIMx_CNT)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . 1611
37.4.13 TIMx prescaler (TIMx_PSC)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . 1611
37.4.14 TIMx auto-reload register (TIMx_ARR)(x = 1, 8) . . . . . . . . . . . . . . . . 1611
37.4.15 TIMx repetition counter register (TIMx_RCR)(x = 1, 8) . . . . . . . . . . . 1612
37.4.16 TIMx capture/compare register 1 (TIMx_CCR1)(x = 1, 8) . . . . . . . . . 1612
37.4.17 TIMx capture/compare register 2 (TIMx_CCR2)(x = 1, 8) . . . . . . . . . 1613
37.4.18 TIMx capture/compare register 3 (TIMx_CCR3)(x = 1, 8) . . . . . . . . . 1613
37.4.19 TIMx capture/compare register 4 (TIMx_CCR4)(x = 1, 8) . . . . . . . . . 1614
37.4.20 TIMx break and dead-time register
(TIMx_BDTR)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1614
37.4.21 TIMx DMA control register (TIMx_DCR)(x = 1, 8) . . . . . . . . . . . . . . . 1617
37.4.22 TIMx DMA address for full transfer
(TIMx_DMAR)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1618
37.4.23 TIMx capture/compare mode register 3
(TIMx_CCMR3)(x = 1, 8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1619
37.4.24 TIMx capture/compare register 5 (TIMx_CCR5)(x = 1, 8) . . . . . . . . . 1620
37.4.25 TIMx capture/compare register 6 (TIMx_CCR6)(x = 1, 8) . . . . . . . . . 1621
37.4.26 TIM1 alternate function option register 1 (TIM1_AF1) . . . . . . . . . . . . 1621
37.4.27 TIM1 Alternate function register 2 (TIM1_AF2) . . . . . . . . . . . . . . . . . 1623
37.4.28 TIM8 Alternate function option register 1 (TIM8_AF1) . . . . . . . . . . . . 1624
Contents RM0433
40/3289 RM0433 Rev 6
37.4.29 TIM8 Alternate function option register 2 (TIM8_AF2) . . . . . . . . . . . . 1626
37.4.30 TIM1 timer input selection register (TIM1_TISEL) . . . . . . . . . . . . . . . 1628
37.4.31 TIM8 timer input selection register (TIM8_TISEL) . . . . . . . . . . . . . . . 1628
37.4.32 TIM1 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1630
37.4.33 TIM8 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1632
38 General-purpose timers (TIM2/TIM3/TIM4/TIM5) . . . . . . . . . . . . . . . . 1635
38.1 TIM2/TIM3/TIM4/TIM5 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . 1635
38.2 TIM2/TIM3/TIM4/TIM5 main features . . . . . . . . . . . . . . . . . . . . . . . . . . 1635
38.3 TIM2/TIM3/TIM4/TIM5 functional description . . . . . . . . . . . . . . . . . . . . 1637
38.3.1 Time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1637
38.3.2 Counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1639
38.3.3 Clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1649
38.3.4 Capture/Compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1653
38.3.5 Input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1655
38.3.6 PWM input mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1656
38.3.7 Forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1657
38.3.8 Output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1657
38.3.9 PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1658
38.3.10 Asymmetric PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1662
38.3.11 Combined PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1662
38.3.12 Clearing the OCxREF signal on an external event . . . . . . . . . . . . . . 1663
38.3.13 One-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1665
38.3.14 Retriggerable one pulse mode (OPM) . . . . . . . . . . . . . . . . . . . . . . . . 1666
38.3.15 Encoder interface mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1667
38.3.16 UIF bit remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1669
38.3.17 Timer input XOR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1669
38.3.18 Timers and external trigger synchronization . . . . . . . . . . . . . . . . . . . 1670
38.3.19 Timer synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1673
38.3.20 DMA burst mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1677
38.3.21 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1678
38.4 TIM2/TIM3/TIM4/TIM5 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1679
38.4.1 TIMx control register 1 (TIMx_CR1)(x = 2 to 5) . . . . . . . . . . . . . . . . . 1679
38.4.2 TIMx control register 2 (TIMx_CR2)(x = 2 to 5) . . . . . . . . . . . . . . . . . 1680
38.4.3 TIMx slave mode control register (TIMx_SMCR)(x = 2 to 5) . . . . . . . 1682
38.4.4 TIMx DMA/Interrupt enable register (TIMx_DIER)(x = 2 to 5) . . . . . . 1685
38.4.5 TIMx status register (TIMx_SR)(x = 2 to 5) . . . . . . . . . . . . . . . . . . . . 1686
RM0433 Rev 6 41/3289
RM0433 Contents
68
38.4.6 TIMx event generation register (TIMx_EGR)(x = 2 to 5) . . . . . . . . . . 1687
38.4.7 TIMx capture/compare mode register 1 [alternate] (TIMx_CCMR1)
(x = 2 to 5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1689
38.4.8 TIMx capture/compare mode register 1 [alternate] (TIMx_CCMR1)
(x = 2 to 5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1691
38.4.9 TIMx capture/compare mode register 2 [alternate] (TIMx_CCMR2)
(x = 2 to 5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1693
38.4.10 TIMx capture/compare mode register 2 [alternate] (TIMx_CCMR2)
(x = 2 to 5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1694
38.4.11 TIMx capture/compare enable register (TIMx_CCER)(x = 2 to 5) . . . 1695
38.4.12 TIMx counter [alternate] (TIMx_CNT)(x = 2 to 5) . . . . . . . . . . . . . . . . 1696
38.4.13 TIMx counter [alternate] (TIMx_CNT)(x = 2 to 5) . . . . . . . . . . . . . . . . 1697
38.4.14 TIMx prescaler (TIMx_PSC)(x = 2 to 5) . . . . . . . . . . . . . . . . . . . . . . . 1697
38.4.15 TIMx auto-reload register (TIMx_ARR)(x = 2 to 5) . . . . . . . . . . . . . . 1698
38.4.16 TIMx capture/compare register 1 (TIMx_CCR1)(x = 2 to 5) . . . . . . . 1698
38.4.17 TIMx capture/compare register 2 (TIMx_CCR2)(x = 2 to 5) . . . . . . . 1699
38.4.18 TIMx capture/compare register 3 (TIMx_CCR3)(x = 2 to 5) . . . . . . . 1699
38.4.19 TIMx capture/compare register 4 (TIMx_CCR4)(x = 2 to 5) . . . . . . . 1700
38.4.20 TIMx DMA control register (TIMx_DCR)(x = 2 to 5) . . . . . . . . . . . . . . 1701
38.4.21 TIMx DMA address for full transfer (TIMx_DMAR)(x = 2 to 5) . . . . . . 1701
38.4.22 TIM2 alternate function option register 1 (TIM2_AF1) . . . . . . . . . . . . 1702
38.4.23 TIM3 alternate function option register 1 (TIM3_AF1) . . . . . . . . . . . . 1702
38.4.24 TIM4 alternate function option register 1 (TIM4_AF1) . . . . . . . . . . . . 1703
38.4.25 TIM5 alternate function option register 1 (TIM5_AF1) . . . . . . . . . . . . 1703
38.4.26 TIM2 timer input selection register (TIM2_TISEL) . . . . . . . . . . . . . . . 1703
38.4.27 TIM3 timer input selection register (TIM3_TISEL) . . . . . . . . . . . . . . . 1704
38.4.28 TIM4 timer input selection register (TIM4_TISEL) . . . . . . . . . . . . . . . 1705
38.4.29 TIM5 timer input selection register (TIM5_TISEL) . . . . . . . . . . . . . . . 1706
38.4.30 TIMx register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1707
39 General-purpose timers (TIM12/TIM13/TIM14) . . . . . . . . . . . . . . . . . 1710
39.1 TIM12/TIM13/TIM14 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1710
39.2 TIM12/TIM13/TIM14 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . 1710
39.2.1 TIM12 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1710
39.2.2 TIM13/TIM14 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1711
39.3 TIM12/TIM13/TIM14 functional description . . . . . . . . . . . . . . . . . . . . . 1713
39.3.1 Time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1713
39.3.2 Counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1715
Contents RM0433
42/3289 RM0433 Rev 6
39.3.3 Clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1718
39.3.4 Capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1720
39.3.5 Input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1722
39.3.6 PWM input mode (only for TIM12) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1723
39.3.7 Forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1724
39.3.8 Output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1725
39.3.9 PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1726
39.3.10 Combined PWM mode (TIM12 only) . . . . . . . . . . . . . . . . . . . . . . . . . 1727
39.3.11 One-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1728
39.3.12 Retriggerable one pulse mode (OPM) (TIM12 only) . . . . . . . . . . . . . 1730
39.3.13 UIF bit remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1731
39.3.14 Timer input XOR function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1731
39.3.15 TIM12 external trigger synchronization . . . . . . . . . . . . . . . . . . . . . . . 1731
39.3.16 Slave mode – combined reset   trigger mode . . . . . . . . . . . . . . . . . . 1734
39.3.17 Timer synchronization (TIM12) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1735
39.3.18 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1735
39.4 TIM12 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1735
39.4.1 TIM12 control register 1 (TIM12_CR1) . . . . . . . . . . . . . . . . . . . . . . . 1735
39.4.2 TIM12 control register 2 (TIM12_CR2) . . . . . . . . . . . . . . . . . . . . . . . 1736
39.4.3 TIM12 slave mode control register (TIM12_SMCR) . . . . . . . . . . . . . 1737
39.4.4 TIM12 Interrupt enable register (TIM12_DIER) . . . . . . . . . . . . . . . . . 1739
39.4.5 TIM12 status register (TIM12_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . 1739
39.4.6 TIM12 event generation register (TIM12_EGR) . . . . . . . . . . . . . . . . 1740
39.4.7 TIM12 capture/compare mode register 1 [alternate]
(TIM12_CCMR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1741
39.4.8 TIM12 capture/compare mode register 1 [alternate]
(TIM12_CCMR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1742
39.4.9 TIM12 capture/compare enable register (TIM12_CCER) . . . . . . . . . 1745
39.4.10 TIM12 counter (TIM12_CNT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1746
39.4.11 TIM12 prescaler (TIM12_PSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1747
39.4.12 TIM12 auto-reload register (TIM12_ARR) . . . . . . . . . . . . . . . . . . . . . 1747
39.4.13 TIM12 capture/compare register 1 (TIM12_CCR1) . . . . . . . . . . . . . . 1747
39.4.14 TIM12 capture/compare register 2 (TIM12_CCR2) . . . . . . . . . . . . . . 1748
39.4.15 TIM12 timer input selection register (TIM12_TISEL) . . . . . . . . . . . . . 1748
39.4.16 TIM12 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1749
39.5 TIM13/TIM14 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1751
39.5.1 TIMx control register 1 (TIMx_CR1)(x = 13 to 14) . . . . . . . . . . . . . . . 1751
RM0433 Rev 6 43/3289
RM0433 Contents
68
39.5.2 TIMx Interrupt enable register (TIMx_DIER)(x = 13 to 14) . . . . . . . . 1752
39.5.3 TIMx status register (TIMx_SR)(x = 13 to 14) . . . . . . . . . . . . . . . . . . 1752
39.5.4 TIMx event generation register (TIMx_EGR)(x = 13 to 14) . . . . . . . . 1753
39.5.5 TIMx capture/compare mode register 1 [alternate]
(TIMx_CCMR1)(x = 13 to 14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1754
39.5.6 TIMx capture/compare mode register 1 [alternate]
(TIMx_CCMR1)(x = 13 to 14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1755
39.5.7 TIMx capture/compare enable register
(TIMx_CCER)(x = 13 to 14) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1757
39.5.8 TIMx counter (TIMx_CNT)(x = 13 to 14) . . . . . . . . . . . . . . . . . . . . . . 1758
39.5.9 TIMx prescaler (TIMx_PSC)(x = 13 to 14) . . . . . . . . . . . . . . . . . . . . . 1758
39.5.10 TIMx auto-reload register (TIMx_ARR)(x = 13 to 14) . . . . . . . . . . . . 1758
39.5.11 TIMx capture/compare register 1 (TIMx_CCR1)(x = 13 to 14) . . . . . 1759
39.5.12 TIM13 timer input selection register (TIM13_TISEL) . . . . . . . . . . . . . 1759
39.5.13 TIM14 timer input selection register (TIM14_TISEL) . . . . . . . . . . . . . 1759
39.5.14 TIM13/TIM14 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1760
40 General-purpose timers (TIM15/TIM16/TIM17) . . . . . . . . . . . . . . . . . 1762
40.1 TIM15/TIM16/TIM17 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1762
40.2 TIM15 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1762
40.3 TIM16/TIM17 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1763
40.4 TIM15/TIM16/TIM17 functional description . . . . . . . . . . . . . . . . . . . . . 1766
40.4.1 Time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1766
40.4.2 Counter modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1768
40.4.3 Repetition counter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1772
40.4.4 Clock selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1773
40.4.5 Capture/compare channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1775
40.4.6 Input capture mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1777
40.4.7 PWM input mode (only for TIM15) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1778
40.4.8 Forced output mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1779
40.4.9 Output compare mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1780
40.4.10 PWM mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1781
40.4.11 Combined PWM mode (TIM15 only) . . . . . . . . . . . . . . . . . . . . . . . . . 1782
40.4.12 Complementary outputs and dead-time insertion . . . . . . . . . . . . . . . 1783
40.4.13 Using the break function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1785
40.4.14 One-pulse mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1790
40.4.15 Retriggerable one pulse mode (OPM) (TIM15 only) . . . . . . . . . . . . . 1792
40.4.16 UIF bit remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1792
Contents RM0433
44/3289 RM0433 Rev 6
40.4.17 Timer input XOR function (TIM15 only) . . . . . . . . . . . . . . . . . . . . . . . 1794
40.4.18 External trigger synchronization (TIM15 only) . . . . . . . . . . . . . . . . . . 1795
40.4.19 Slave mode – combined reset   trigger mode . . . . . . . . . . . . . . . . . . 1797
40.4.20 DMA burst mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1797
40.4.21 Timer synchronization (TIM15) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1799
40.4.22 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1799
40.5 TIM15 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1800
40.5.1 TIM15 control register 1 (TIM15_CR1) . . . . . . . . . . . . . . . . . . . . . . . 1800
40.5.2 TIM15 control register 2 (TIM15_CR2) . . . . . . . . . . . . . . . . . . . . . . . 1801
40.5.3 TIM15 slave mode control register (TIM15_SMCR) . . . . . . . . . . . . . 1803
40.5.4 TIM15 DMA/interrupt enable register (TIM15_DIER) . . . . . . . . . . . . 1804
40.5.5 TIM15 status register (TIM15_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . 1805
40.5.6 TIM15 event generation register (TIM15_EGR) . . . . . . . . . . . . . . . . 1807
40.5.7 TIM15 capture/compare mode register 1 [alternate]
(TIM15_CCMR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1808
40.5.8 TIM15 capture/compare mode register 1 [alternate]
(TIM15_CCMR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1809
40.5.9 TIM15 capture/compare enable register (TIM15_CCER) . . . . . . . . . 1812
40.5.10 TIM15 counter (TIM15_CNT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1815
40.5.11 TIM15 prescaler (TIM15_PSC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1815
40.5.12 TIM15 auto-reload register (TIM15_ARR) . . . . . . . . . . . . . . . . . . . . . 1815
40.5.13 TIM15 repetition counter register (TIM15_RCR) . . . . . . . . . . . . . . . . 1816
40.5.14 TIM15 capture/compare register 1 (TIM15_CCR1) . . . . . . . . . . . . . . 1816
40.5.15 TIM15 capture/compare register 2 (TIM15_CCR2) . . . . . . . . . . . . . . 1817
40.5.16 TIM15 break and dead-time register (TIM15_BDTR) . . . . . . . . . . . . 1817
40.5.17 TIM15 DMA control register (TIM15_DCR) . . . . . . . . . . . . . . . . . . . . 1820
40.5.18 TIM15 DMA address for full transfer (TIM15_DMAR) . . . . . . . . . . . . 1820
40.5.19 TIM15 alternate register 1 (TIM15_AF1) . . . . . . . . . . . . . . . . . . . . . . 1821
40.5.20 TIM15 input selection register (TIM15_TISEL) . . . . . . . . . . . . . . . . . 1822
40.5.21 TIM15 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1823
40.6 TIM16/TIM17 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1825
40.6.1 TIMx control register 1 (TIMx_CR1)(x = 16 to 17) . . . . . . . . . . . . . . . 1825
40.6.2 TIMx control register 2 (TIMx_CR2)(x = 16 to 17) . . . . . . . . . . . . . . . 1826
40.6.3 TIMx DMA/interrupt enable register (TIMx_DIER)(x = 16 to 17) . . . . 1827
40.6.4 TIMx status register (TIMx_SR)(x = 16 to 17) . . . . . . . . . . . . . . . . . . 1828
40.6.5 TIMx event generation register (TIMx_EGR)(x = 16 to 17) . . . . . . . . 1829
40.6.6 TIMx capture/compare mode register 1 [alternate] (TIMx_CCMR1)
(x = 16 to 17) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1830
RM0433 Rev 6 45/3289
RM0433 Contents
68
40.6.7 TIMx capture/compare mode register 1 [alternate] (TIMx_CCMR1)
(x = 16 to 17) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1831
40.6.8 TIMx capture/compare enable register (TIMx_CCER)(x = 16 to 17) . 1833
40.6.9 TIMx counter (TIMx_CNT)(x = 16 to 17) . . . . . . . . . . . . . . . . . . . . . . 1835
40.6.10 TIMx prescaler (TIMx_PSC)(x = 16 to 17) . . . . . . . . . . . . . . . . . . . . . 1836
40.6.11 TIMx auto-reload register (TIMx_ARR)(x = 16 to 17) . . . . . . . . . . . . 1836
40.6.12 TIMx repetition counter register (TIMx_RCR)(x = 16 to 17) . . . . . . . . 1837
40.6.13 TIMx capture/compare register 1 (TIMx_CCR1)(x = 16 to 17) . . . . . 1837
40.6.14 TIMx break and dead-time register (TIMx_BDTR)(x = 16 to 17) . . . . 1838
40.6.15 TIMx DMA control register (TIMx_DCR)(x = 16 to 17) . . . . . . . . . . . . 1840
40.6.16 TIMx DMA address for full transfer (TIMx_DMAR)(x = 16 to 17) . . . . 1841
40.6.17 TIM16 alternate function register 1 (TIM16_AF1) . . . . . . . . . . . . . . . 1842
40.6.18 TIM16 input selection register (TIM16_TISEL) . . . . . . . . . . . . . . . . . 1843
40.6.19 TIM17 alternate function register 1 (TIM17_AF1) . . . . . . . . . . . . . . . 1844
40.6.20 TIM17 input selection register (TIM17_TISEL) . . . . . . . . . . . . . . . . . 1845
40.6.21 TIM16/TIM17 register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1846
41 Basic timers (TIM6/TIM7) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1848
41.1 TIM6/TIM7 introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1848
41.2 TIM6/TIM7 main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1848
41.3 TIM6/TIM7 functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1849
41.3.1 Time-base unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1849
41.3.2 Counting mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1851
41.3.3 UIF bit remapping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1854
41.3.4 Clock source . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1854
41.3.5 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1855
41.4 TIM6/TIM7 registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1855
41.4.1 TIMx control register 1 (TIMx_CR1)(x = 6 to 7) . . . . . . . . . . . . . . . . . 1855
41.4.2 TIMx control register 2 (TIMx_CR2)(x = 6 to 7) . . . . . . . . . . . . . . . . . 1857
41.4.3 TIMx DMA/Interrupt enable register (TIMx_DIER)(x = 6 to 7) . . . . . . 1857
41.4.4 TIMx status register (TIMx_SR)(x = 6 to 7) . . . . . . . . . . . . . . . . . . . . 1858
41.4.5 TIMx event generation register (TIMx_EGR)(x = 6 to 7) . . . . . . . . . . 1858
41.4.6 TIMx counter (TIMx_CNT)(x = 6 to 7) . . . . . . . . . . . . . . . . . . . . . . . . 1858
41.4.7 TIMx prescaler (TIMx_PSC)(x = 6 to 7) . . . . . . . . . . . . . . . . . . . . . . . 1859
41.4.8 TIMx auto-reload register (TIMx_ARR)(x = 6 to 7) . . . . . . . . . . . . . . 1859
41.4.9 TIMx register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1860
Contents RM0433
46/3289 RM0433 Rev 6
42 Low-power timer (LPTIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861
42.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861
42.2 LPTIM main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861
42.3 LPTIM implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1861
42.4 LPTIM functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1862
42.4.1 LPTIM block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1862
42.4.2 LPTIM pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1864
42.4.3 LPTIM input and trigger mapping . . . . . . . . . . . . . . . . . . . . . . . . . . . 1864
42.4.4 LPTIM reset and clocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1867
42.4.5 Glitch filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1867
42.4.6 Prescaler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1868
42.4.7 Trigger multiplexer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1869
42.4.8 Operating mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1869
42.4.9 Timeout function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1871
42.4.10 Waveform generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1871
42.4.11 Register update . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1872
42.4.12 Counter mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1873
42.4.13 Timer enable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1873
42.4.14 Timer counter reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
42.4.15 Encoder mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1874
42.4.16 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1876
42.5 LPTIM low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1876
42.6 LPTIM interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1877
42.7 LPTIM registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1877
42.7.1 LPTIM interrupt and status register (LPTIM_ISR) . . . . . . . . . . . . . . . 1877
42.7.2 LPTIM interrupt clear register (LPTIM_ICR) . . . . . . . . . . . . . . . . . . . 1878
42.7.3 LPTIM interrupt enable register (LPTIM_IER) . . . . . . . . . . . . . . . . . . 1879
42.7.4 LPTIM configuration register (LPTIM_CFGR) . . . . . . . . . . . . . . . . . . 1880
42.7.5 LPTIM control register (LPTIM_CR) . . . . . . . . . . . . . . . . . . . . . . . . . 1883
42.7.6 LPTIM compare register (LPTIM_CMP) . . . . . . . . . . . . . . . . . . . . . . 1885
42.7.7 LPTIM autoreload register (LPTIM_ARR) . . . . . . . . . . . . . . . . . . . . . 1885
42.7.8 LPTIM counter register (LPTIM_CNT) . . . . . . . . . . . . . . . . . . . . . . . . 1886
42.7.9 LPTIM configuration register 2 (LPTIM_CFGR2) . . . . . . . . . . . . . . . 1886
42.7.10 LPTIM3 configuration register 2 (LPTIM3_CFGR2) . . . . . . . . . . . . . 1887
42.7.11 LPTIM register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1888
RM0433 Rev 6 47/3289
RM0433 Contents
68
43 System window watchdog (WWDG) . . . . . . . . . . . . . . . . . . . . . . . . . 1890
43.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1890
43.2 WWDG main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1890
43.3 WWDG functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1890
43.3.1 WWDG block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1891
43.3.2 WWDG internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1891
43.3.3 Enabling the watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1891
43.3.4 Controlling the downcounter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1891
43.3.5 Advanced watchdog interrupt feature . . . . . . . . . . . . . . . . . . . . . . . . 1892
43.3.6 How to program the watchdog timeout . . . . . . . . . . . . . . . . . . . . . . . 1892
43.3.7 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1893
43.4 WWDG registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1894
43.4.1 Control register (WWDG_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1894
43.4.2 Configuration register (WWDG_CFR) . . . . . . . . . . . . . . . . . . . . . . . . 1894
43.4.3 Status register (WWDG_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1895
43.4.4 WWDG register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1895
44 Independent watchdog (IWDG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1897
44.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1897
44.2 IWDG main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1897
44.3 IWDG functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1897
44.3.1 IWDG block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1897
44.3.2 IWDG internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1898
44.3.3 Window option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1898
44.3.4 Hardware watchdog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1899
44.3.5 Low-power freeze . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1899
44.3.6 Register access protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1899
44.3.7 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1899
44.4 IWDG registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1900
44.4.1 IWDG key register (IWDG_KR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1900
44.4.2 IWDG prescaler register (IWDG_PR) . . . . . . . . . . . . . . . . . . . . . . . . 1901
44.4.3 IWDG reload register (IWDG_RLR) . . . . . . . . . . . . . . . . . . . . . . . . . . 1902
44.4.4 IWDG status register (IWDG_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 1903
44.4.5 IWDG window register (IWDG_WINR) . . . . . . . . . . . . . . . . . . . . . . . 1904
44.4.6 IWDG register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1905
Contents RM0433
48/3289 RM0433 Rev 6
45 Real-time clock (RTC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1906
45.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1906
45.2 RTC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1907
45.3 RTC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1907
45.3.1 RTC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1907
45.3.2 RTC pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1909
45.3.3 GPIOs controlled by the RTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1910
45.3.4 Clock and prescalers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1912
45.3.5 Real-time clock and calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1913
45.3.6 Programmable alarms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1913
45.3.7 Periodic auto-wakeup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1913
45.3.8 RTC initialization and configuration . . . . . . . . . . . . . . . . . . . . . . . . . . 1914
45.3.9 Reading the calendar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1916
45.3.10 Resetting the RTC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1917
45.3.11 RTC synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1917
45.3.12 RTC reference clock detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1918
45.3.13 RTC smooth digital calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1919
45.3.14 Time-stamp function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1921
45.3.15 Tamper detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1921
45.3.16 Calibration clock output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1923
45.3.17 Alarm output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1924
45.4 RTC low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1924
45.5 RTC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1924
45.6 RTC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1925
45.6.1 RTC time register (RTC_TR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1925
45.6.2 RTC date register (RTC_DR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1926
45.6.3 RTC control register (RTC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1928
45.6.4 RTC initialization and status register (RTC_ISR) . . . . . . . . . . . . . . . . 1931
45.6.5 RTC prescaler register (RTC_PRER) . . . . . . . . . . . . . . . . . . . . . . . . 1934
45.6.6 RTC wakeup timer register (RTC_WUTR) . . . . . . . . . . . . . . . . . . . . . 1935
45.6.7 RTC alarm A register (RTC_ALRMAR) . . . . . . . . . . . . . . . . . . . . . . . 1936
45.6.8 RTC alarm B register (RTC_ALRMBR) . . . . . . . . . . . . . . . . . . . . . . . 1937
45.6.9 RTC write protection register (RTC_WPR) . . . . . . . . . . . . . . . . . . . . 1938
45.6.10 RTC sub second register (RTC_SSR) . . . . . . . . . . . . . . . . . . . . . . . . 1938
45.6.11 RTC shift control register (RTC_SHIFTR) . . . . . . . . . . . . . . . . . . . . . 1939
45.6.12 RTC timestamp time register (RTC_TSTR) . . . . . . . . . . . . . . . . . . . . 1940
RM0433 Rev 6 49/3289
RM0433 Contents
68
45.6.13 RTC timestamp date register (RTC_TSDR) . . . . . . . . . . . . . . . . . . . 1941
45.6.14 RTC time-stamp sub second register (RTC_TSSSR) . . . . . . . . . . . . 1942
45.6.15 RTC calibration register (RTC_CALR) . . . . . . . . . . . . . . . . . . . . . . . . 1943
45.6.16 RTC tamper configuration register (RTC_TAMPCR) . . . . . . . . . . . . . 1944
45.6.17 RTC alarm A sub second register (RTC_ALRMASSR) . . . . . . . . . . . 1947
45.6.18 RTC alarm B sub second register (RTC_ALRMBSSR) . . . . . . . . . . . 1948
45.6.19 RTC option register (RTC_OR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1949
45.6.20 RTC backup registers (RTC_BKPxR) . . . . . . . . . . . . . . . . . . . . . . . . 1949
45.6.21 RTC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1950
46 Inter-integrated circuit (I2C) interface . . . . . . . . . . . . . . . . . . . . . . . . 1952
46.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1952
46.2 I2C main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1952
46.3 I2C implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1953
46.4 I2C functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1953
46.4.1 I2C block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1954
46.4.2 I2C pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1955
46.4.3 I2C clock requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1955
46.4.4 Mode selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1955
46.4.5 I2C initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1956
46.4.6 Software reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1961
46.4.7 Data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1962
46.4.8 I2C slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1964
46.4.9 I2C master mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1973
46.4.10 I2C_TIMINGR register configuration examples . . . . . . . . . . . . . . . . . 1985
46.4.11 SMBus specific features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1986
46.4.12 SMBus initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1990
46.4.13 SMBus: I2C_TIMEOUTR register configuration examples . . . . . . . . 1992
46.4.14 SMBus slave mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1992
46.4.15 Wakeup from Stop mode on address match . . . . . . . . . . . . . . . . . . . 2000
46.4.16 Error conditions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2000
46.4.17 DMA requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2002
46.4.18 Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2003
46.5 I2C low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2003
46.6 I2C interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2004
46.7 I2C registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2005
Contents RM0433
50/3289 RM0433 Rev 6
46.7.1 I2C control register 1 (I2C_CR1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2005
46.7.2 I2C control register 2 (I2C_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2008
46.7.3 I2C own address 1 register (I2C_OAR1) . . . . . . . . . . . . . . . . . . . . . . 2011
46.7.4 I2C own address 2 register (I2C_OAR2) . . . . . . . . . . . . . . . . . . . . . . 2012
46.7.5 I2C timing register (I2C_TIMINGR) . . . . . . . . . . . . . . . . . . . . . . . . . . 2013
46.7.6 I2C timeout register (I2C_TIMEOUTR) . . . . . . . . . . . . . . . . . . . . . . . 2014
46.7.7 I2C interrupt and status register (I2C_ISR) . . . . . . . . . . . . . . . . . . . . 2015
46.7.8 I2C interrupt clear register (I2C_ICR) . . . . . . . . . . . . . . . . . . . . . . . . 2017
46.7.9 I2C PEC register (I2C_PECR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2018
46.7.10 I2C receive data register (I2C_RXDR) . . . . . . . . . . . . . . . . . . . . . . . 2019
46.7.11 I2C transmit data register (I2C_TXDR) . . . . . . . . . . . . . . . . . . . . . . . 2019
46.7.12 I2C register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2020
47 Universal synchronous/asynchronous receiver
transmitter (USART/UART) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2022
47.1 USART introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2022
47.2 USART main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2023
47.3 USART extended features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2024
47.4 USART implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2024
47.5 USART functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2025
47.5.1 USART block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2025
47.5.2 USART signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2026
47.5.3 USART character description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2027
47.5.4 USART FIFOs and thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2029
47.5.5 USART transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2029
47.5.6 USART receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2033
47.5.7 USART baud rate generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2041
47.5.8 Tolerance of the USART receiver to clock deviation . . . . . . . . . . . . . 2042
47.5.9 USART Auto baud rate detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2043
47.5.10 USART multiprocessor communication . . . . . . . . . . . . . . . . . . . . . . . 2045
47.5.11 USART Modbus communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047
47.5.12 USART parity control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2047
47.5.13 USART LIN (local interconnection network) mode . . . . . . . . . . . . . . 2048
47.5.14 USART synchronous mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2051
47.5.15 USART single-wire Half-duplex communication . . . . . . . . . . . . . . . . 2055
47.5.16 USART receiver timeout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2055
47.5.17 USART Smartcard mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2056
RM0433 Rev 6 51/3289
RM0433 Contents
68
47.5.18 USART IrDA SIR ENDEC block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2060
47.5.19 Continuous communication using USART and DMA . . . . . . . . . . . . . 2063
47.5.20 RS232 Hardware flow control and RS485 Driver Enable . . . . . . . . . 2065
47.5.21 USART low-power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2068
47.6 USART interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2071
47.7 USART registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2074
47.7.1 USART control register 1 [alternate] (USART_CR1) . . . . . . . . . . . . . 2074
47.7.2 USART control register 1 [alternate] (USART_CR1) . . . . . . . . . . . . . 2078
47.7.3 USART control register 2 (USART_CR2) . . . . . . . . . . . . . . . . . . . . . 2081
47.7.4 USART control register 3 (USART_CR3) . . . . . . . . . . . . . . . . . . . . . 2085
47.7.5 USART baud rate register (USART_BRR) . . . . . . . . . . . . . . . . . . . . 2090
47.7.6 USART guard time and prescaler register (USART_GTPR) . . . . . . . 2090
47.7.7 USART receiver timeout register (USART_RTOR) . . . . . . . . . . . . . . 2091
47.7.8 USART request register (USART_RQR) . . . . . . . . . . . . . . . . . . . . . . 2092
47.7.9 USART interrupt and status register [alternate] (USART_ISR) . . . . . 2093
47.7.10 USART interrupt and status register [alternate] (USART_ISR) . . . . . 2099
47.7.11 USART interrupt flag clear register (USART_ICR) . . . . . . . . . . . . . . 2104
47.7.12 USART receive data register (USART_RDR) . . . . . . . . . . . . . . . . . . 2106
47.7.13 USART transmit data register (USART_TDR) . . . . . . . . . . . . . . . . . . 2106
47.7.14 USART prescaler register (USART_PRESC) . . . . . . . . . . . . . . . . . . 2107
47.7.15 USART register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2108
48 Low-power universal asynchronous receiver
transmitter (LPUART) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2110
48.1 LPUART introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2110
48.2 LPUART main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2111
48.3 LPUART functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .2112
48.3.1 LPUART block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2112
48.3.2 LPUART signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2113
48.3.3 LPUART character description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2113
48.3.4 LPUART FIFOs and thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2114
48.3.5 LPUART transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2115
48.3.6 LPUART receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2118
48.3.7 LPUART baud rate generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2122
48.3.8 Tolerance of the LPUART receiver to clock deviation . . . . . . . . . . . . 2124
48.3.9 LPUART multiprocessor communication . . . . . . . . . . . . . . . . . . . . . . 2124
48.3.10 LPUART parity control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2126
Contents RM0433
52/3289 RM0433 Rev 6
48.3.11 LPUART single-wire Half-duplex communication . . . . . . . . . . . . . . . 2127
48.3.12 Continuous communication using DMA and LPUART . . . . . . . . . . . . 2128
48.3.13 RS232 Hardware flow control and RS485 Driver Enable . . . . . . . . . 2130
48.3.14 LPUART low-power management . . . . . . . . . . . . . . . . . . . . . . . . . . . 2133
48.4 LPUART interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2136
48.5 LPUART registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2138
48.5.1 Control register 1 [alternate] (LPUART_CR1) . . . . . . . . . . . . . . . . . . 2138
48.5.2 Control register 1 [alternate] (LPUART_CR1) . . . . . . . . . . . . . . . . . . 2141
48.5.3 Control register 2 (LPUART_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2144
48.5.4 Control register 3 (LPUART_CR3) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2146
48.5.5 Baud rate register (LPUART_BRR) . . . . . . . . . . . . . . . . . . . . . . . . . . 2149
48.5.6 Request register (LPUART_RQR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2150
48.5.7 Interrupt and status register [alternate] (LPUART_ISR) . . . . . . . . . . 2150
48.5.8 Interrupt and status register [alternate] (LPUART_ISR) . . . . . . . . . . 2155
48.5.9 Interrupt flag clear register (LPUART_ICR) . . . . . . . . . . . . . . . . . . . . 2158
48.5.10 Receive data register (LPUART_RDR) . . . . . . . . . . . . . . . . . . . . . . . 2159
48.5.11 Transmit data register (LPUART_TDR) . . . . . . . . . . . . . . . . . . . . . . . 2159
48.5.12 Prescaler register (LPUART_PRESC) . . . . . . . . . . . . . . . . . . . . . . . . 2160
48.5.13 LPUART register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2161
49 Serial peripheral interface (SPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2163
49.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2163
49.2 SPI main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2164
49.3 SPI implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2164
49.4 SPI functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2165
49.4.1 SPI block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2165
49.4.2 SPI signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2166
49.4.3 SPI communication general aspects . . . . . . . . . . . . . . . . . . . . . . . . . 2166
49.4.4 Communications between one master and one slave . . . . . . . . . . . . 2166
49.4.5 Standard multi-slave communication . . . . . . . . . . . . . . . . . . . . . . . . . 2169
49.4.6 Multi-master communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2172
49.4.7 Slave select (SS) pin management . . . . . . . . . . . . . . . . . . . . . . . . . . 2172
49.4.8 Communication formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2176
49.4.9 Configuration of SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2178
49.4.10 Procedure for enabling SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2179
49.4.11 SPI data transmission and reception procedures . . . . . . . . . . . . . . . 2179
RM0433 Rev 6 53/3289
RM0433 Contents
68
49.4.12 Procedure for disabling the SPI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2183
49.4.13 Data packing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2184
49.4.14 Communication using DMA (direct memory addressing) . . . . . . . . . . 2185
49.5 SPI specific modes and control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2187
49.5.1 TI mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2187
49.5.2 SPI error flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2187
49.5.3 CRC computation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2189
49.6 Low-power mode management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2191
49.7 SPI wakeup and interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2193
49.8 I2S main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2194
49.9 I2S functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2195
49.9.1 I2S general description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2195
49.9.2 Pin sharing with SPI function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2195
49.9.3 Bits and fields usable in I2S/PCM mode . . . . . . . . . . . . . . . . . . . . . . 2196
49.9.4 Slave and master modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2197
49.9.5 Supported audio protocols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2197
49.9.6 Additional Serial Interface Flexibility . . . . . . . . . . . . . . . . . . . . . . . . . 2203
49.9.7 Start-up sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2205
49.9.8 Stop sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2206
49.9.9 Clock generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2207
49.9.10 Internal FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2209
49.9.11 FIFOs status flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2210
49.9.12 Handling of underrun situation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2211
49.9.13 Handling of overrun situation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2212
49.9.14 Frame error detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2212
49.9.15 DMA Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2214
49.9.16 Programing examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2215
49.9.17 Slave I2S Philips standard, receive . . . . . . . . . . . . . . . . . . . . . . . . . . 2217
49.10 I2S wakeup and interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2218
49.11 SPI/I2S registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2219
49.11.1 SPI/I2S control register 1 (SPI2S_CR1) . . . . . . . . . . . . . . . . . . . . . . 2219
49.11.2 SPI control register 2 (SPI_CR2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2220
49.11.3 SPI configuration register 1 (SPI_CFG1) . . . . . . . . . . . . . . . . . . . . . . 2221
49.11.4 SPI configuration register 2 (SPI_CFG2) . . . . . . . . . . . . . . . . . . . . . . 2224
49.11.5 SPI/I2S interrupt enable register (SPI2S_IER) . . . . . . . . . . . . . . . . . 2226
49.11.6 SPI/I2S status register (SPI2S_SR) . . . . . . . . . . . . . . . . . . . . . . . . . 2227
Contents RM0433
54/3289 RM0433 Rev 6
49.11.7 SPI/I2S interrupt/status flags clear register (SPI2S_IFCR) . . . . . . . . 2229
49.11.8 SPI/I2S transmit data register (SPI2S_TXDR) . . . . . . . . . . . . . . . . . 2230
49.11.9 SPI/I2S receive data register (SPI2S_RXDR) . . . . . . . . . . . . . . . . . . 2231
49.11.10 SPI polynomial register (SPI_CRCPOLY) . . . . . . . . . . . . . . . . . . . . . 2231
49.11.11 SPI transmitter CRC register (SPI_TXCRC) . . . . . . . . . . . . . . . . . . . 2232
49.11.12 SPI receiver CRC register (SPI_RXCRC) . . . . . . . . . . . . . . . . . . . . . 2232
49.11.13 SPI underrun data register (SPI_UDRDR) . . . . . . . . . . . . . . . . . . . . 2233
49.11.14 SPI/I2S configuration register (SPI_I2SCFGR) . . . . . . . . . . . . . . . . . 2233
49.12 SPI register map and reset values . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2236
50 Serial audio interface (SAI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2238
50.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2238
50.2 SAI main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2239
50.3 SAI functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2240
50.3.1 SAI block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2240
50.3.2 SAI pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2241
50.3.3 Main SAI modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2241
50.3.4 SAI synchronization mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2242
50.3.5 Audio data size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2243
50.3.6 Frame synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2244
50.3.7 Slot configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2247
50.3.8 SAI clock generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2249
50.3.9 Internal FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2251
50.3.10 PDM Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2253
50.3.11 AC’97 link controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2261
50.3.12 SPDIF output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2263
50.3.13 Specific features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2266
50.3.14 Error flags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2270
50.3.15 Disabling the SAI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2273
50.3.16 SAI DMA interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2273
50.4 SAI interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2274
50.5 SAI registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2275
50.5.1 Global configuration register (SAI_GCR) . . . . . . . . . . . . . . . . . . . . . . 2275
50.5.2 Configuration register 1 (SAI_ACR1) . . . . . . . . . . . . . . . . . . . . . . . . . 2275
50.5.3 Configuration register 1 (SAI_BCR1) . . . . . . . . . . . . . . . . . . . . . . . . . 2278
50.5.4 Configuration register 2 (SAI_ACR2) . . . . . . . . . . . . . . . . . . . . . . . . . 2281
RM0433 Rev 6 55/3289
RM0433 Contents
68
50.5.5 Configuration register 2 (SAI_BCR2) . . . . . . . . . . . . . . . . . . . . . . . . . 2283
50.5.6 Frame configuration register (SAI_AFRCR) . . . . . . . . . . . . . . . . . . . 2285
50.5.7 Frame configuration register (SAI_BFRCR) . . . . . . . . . . . . . . . . . . . 2286
50.5.8 Slot register (SAI_ASLOTR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2287
50.5.9 Slot register (SAI_BSLOTR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2288
50.5.10 Interrupt mask register (SAI_AIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2289
50.5.11 Interrupt mask register (SAI_BIM) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2291
50.5.12 Status register (SAI_ASR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2292
50.5.13 Status register (SAI_BSR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2294
50.5.14 Clear flag register (SAI_ACLRFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2296
50.5.15 Clear flag register (SAI_BCLRFR) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2297
50.5.16 Data register (SAI_ADR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2298
50.5.17 Data register (SAI_BDR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2299
50.5.18 PDM control register (SAI_PDMCR) . . . . . . . . . . . . . . . . . . . . . . . . . 2299
50.5.19 PDM delay register (SAI_PDMDLY) . . . . . . . . . . . . . . . . . . . . . . . . . 2300
50.5.20 SAI register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2303
51 SPDIF receiver interface (SPDIFRX) . . . . . . . . . . . . . . . . . . . . . . . . . 2305
51.1 SPDIFRX interface introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2305
51.2 SPDIFRX main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2305
51.3 SPDIFRX functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2305
51.3.1 SPDIFRX pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . 2306
51.3.2 S/PDIF protocol (IEC-60958) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2307
51.3.3 SPDIFRX decoder (SPDIFRX_DC) . . . . . . . . . . . . . . . . . . . . . . . . . . 2309
51.3.4 SPDIFRX tolerance to clock deviation . . . . . . . . . . . . . . . . . . . . . . . . 2313
51.3.5 SPDIFRX synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2313
51.3.6 SPDIFRX handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2315
51.3.7 Data reception management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2317
51.3.8 Dedicated control flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2319
51.3.9 Reception errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2320
51.3.10 Clocking strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2322
51.3.11 DMA Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2322
51.3.12 Interrupt Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2323
51.3.13 Register protection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2324
51.4 Programming procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2325
51.4.1 Initialization phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2325
51.4.2 Handling of interrupts coming from SPDIFRX . . . . . . . . . . . . . . . . . . 2326
Contents RM0433
56/3289 RM0433 Rev 6
51.4.3 Handling of interrupts coming from DMA . . . . . . . . . . . . . . . . . . . . . . 2327
51.5 SPDIFRX interface registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2327
51.5.1 Control register (SPDIFRX_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2327
51.5.2 Interrupt mask register (SPDIFRX_IMR) . . . . . . . . . . . . . . . . . . . . . . 2330
51.5.3 Status register (SPDIFRX_SR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2331
51.5.4 Interrupt flag clear register (SPDIFRX_IFCR) . . . . . . . . . . . . . . . . . . 2333
51.5.5 Data input register (SPDIFRX_FMT0_DR) . . . . . . . . . . . . . . . . . . . . 2334
51.5.6 Data input register (SPDIFRX_FMT1_DR) . . . . . . . . . . . . . . . . . . . . 2335
51.5.7 Data input register (SPDIFRX_FMT2_DR) . . . . . . . . . . . . . . . . . . . . 2336
51.5.8 Channel status register (SPDIFRX_CSR) . . . . . . . . . . . . . . . . . . . . . 2337
51.5.9 Debug information register (SPDIFRX_DIR) . . . . . . . . . . . . . . . . . . . 2337
51.5.10 SPDIFRX interface register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2339
52 Single Wire Protocol Master Interface (SWPMI) . . . . . . . . . . . . . . . . 2340
52.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2340
52.2 SWPMI main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2341
52.3 SWPMI functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2342
52.3.1 SWPMI block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2342
52.3.2 SWPMI pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2342
52.3.3 SWP initialization and activation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2343
52.3.4 SWP bus states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2343
52.3.5 SWPMI_IO (internal transceiver) bypass . . . . . . . . . . . . . . . . . . . . . . 2345
52.3.6 SWPMI Bit rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2345
52.3.7 SWPMI frame handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2346
52.3.8 Transmission procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2346
52.3.9 Reception procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2351
52.3.10 Error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2355
52.3.11 Loopback mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2357
52.4 SWPMI low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2357
52.5 SWPMI interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2358
52.6 SWPMI registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2359
52.6.1 SWPMI Configuration/Control register (SWPMI_CR) . . . . . . . . . . . . 2359
52.6.2 SWPMI Bitrate register (SWPMI_BRR) . . . . . . . . . . . . . . . . . . . . . . . 2360
52.6.3 SWPMI Interrupt and Status register (SWPMI_ISR) . . . . . . . . . . . . . 2361
52.6.4 SWPMI Interrupt Flag Clear register (SWPMI_ICR) . . . . . . . . . . . . . 2362
52.6.5 SWPMI Interrupt Enable register (SMPMI_IER) . . . . . . . . . . . . . . . . 2363
RM0433 Rev 6 57/3289
RM0433 Contents
68
52.6.6 SWPMI Receive Frame Length register (SWPMI_RFL) . . . . . . . . . . 2365
52.6.7 SWPMI Transmit data register (SWPMI_TDR) . . . . . . . . . . . . . . . . . 2365
52.6.8 SWPMI Receive data register (SWPMI_RDR) . . . . . . . . . . . . . . . . . 2365
52.6.9 SWPMI Option register (SWPMI_OR) . . . . . . . . . . . . . . . . . . . . . . . . 2366
52.6.10 SWPMI register map and reset value table . . . . . . . . . . . . . . . . . . . . 2367
53 Management data input/output (MDIOS) . . . . . . . . . . . . . . . . . . . . . . 2368
53.1 MDIOS introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2368
53.2 MDIOS main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2368
53.3 MDIOS functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2369
53.3.1 MDIOS block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2369
53.3.2 MDIOS pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2369
53.3.3 MDIOS protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2370
53.3.4 MDIOS enabling and disabling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2371
53.3.5 MDIOS data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2371
53.3.6 MDIOS APB frequency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2373
53.3.7 Write/read flags and interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2373
53.3.8 MDIOS error management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2373
53.3.9 MDIOS in Stop mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2374
53.3.10 MDIOS interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2375
53.4 MDIOS registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2376
53.4.1 MDIOS configuration register (MDIOS_CR) . . . . . . . . . . . . . . . . . . . 2376
53.4.2 MDIOS write flag register (MDIOS_WRFR) . . . . . . . . . . . . . . . . . . . . 2377
53.4.3 MDIOS clear write flag register (MDIOS_CWRFR) . . . . . . . . . . . . . . 2377
53.4.4 MDIOS read flag register (MDIOS_RDFR) . . . . . . . . . . . . . . . . . . . . 2378
53.4.5 MDIOS clear read flag register (MDIOS_CRDFR) . . . . . . . . . . . . . . 2378
53.4.6 MDIOS status register (MDIOS_SR) . . . . . . . . . . . . . . . . . . . . . . . . . 2379
53.4.7 MDIOS clear flag register (MDIOS_CLRFR) . . . . . . . . . . . . . . . . . . . 2380
53.4.8 MDIOS input data register x (MDIOS_DINRx) . . . . . . . . . . . . . . . . . . 2381
53.4.9 MDIOS output data register x (MDIOS_DOUTRx) . . . . . . . . . . . . . . 2381
53.4.10 MDIOS register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2382
54 Secure digital input/output MultiMediaCard interface (SDMMC) . . 2383
54.1 SDMMC main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2383
54.2 SDMMC bus topology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2383
54.3 SDMMC operation modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2385
Contents RM0433
58/3289 RM0433 Rev 6
54.4 SDMMC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2386
54.4.1 SDMMC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2387
54.4.2 SDMMC pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . 2387
54.4.3 General description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2388
54.4.4 SDMMC adapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2390
54.4.5 SDMMC AHB slave interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2411
54.4.6 SDMMC AHB master interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2412
54.4.7 MDMA request generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2414
54.4.8 AHB and SDMMC_CK clock relation . . . . . . . . . . . . . . . . . . . . . . . . . 2414
54.4.9 Hardware flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2414
54.5 Card functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2415
54.5.1 SD I/O mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2415
54.5.2 CMD12 send timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2424
54.5.3 Sleep (CMD5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2427
54.5.4 Interrupt mode (Wait-IRQ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2428
54.5.5 Boot operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2429
54.5.6 Response R1b handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2432
54.5.7 Reset and card cycle power . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2433
54.6 Ultra-high-speed phase I (UHS-I) voltage switch . . . . . . . . . . . . . . . . . 2434
54.7 SDMMC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2438
54.8 SDMMC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2440
54.8.1 SDMMC power control register (SDMMC_POWER) . . . . . . . . . . . . . 2440
54.8.2 SDMMC clock control register (SDMMC_CLKCR) . . . . . . . . . . . . . . 2441
54.8.3 SDMMC argument register (SDMMC_ARGR) . . . . . . . . . . . . . . . . . . 2443
54.8.4 SDMMC command register (SDMMC_CMDR) . . . . . . . . . . . . . . . . . 2443
54.8.5 SDMMC command response register (SDMMC_RESPCMDR) . . . . 2445
54.8.6 SDMMC response x register (SDMMC_RESPxR) . . . . . . . . . . . . . . 2446
54.8.7 SDMMC data timer register (SDMMC_DTIMER) . . . . . . . . . . . . . . . 2446
54.8.8 SDMMC data length register (SDMMC_DLENR) . . . . . . . . . . . . . . . 2447
54.8.9 SDMMC data control register (SDMMC_DCTRL) . . . . . . . . . . . . . . . 2448
54.8.10 SDMMC data counter register (SDMMC_DCNTR) . . . . . . . . . . . . . . 2449
54.8.11 SDMMC status register (SDMMC_STAR) . . . . . . . . . . . . . . . . . . . . . 2450
54.8.12 SDMMC interrupt clear register (SDMMC_ICR) . . . . . . . . . . . . . . . . 2453
54.8.13 SDMMC mask register (SDMMC_MASKR) . . . . . . . . . . . . . . . . . . . . 2455
54.8.14 SDMMC acknowledgment timer register (SDMMC_ACKTIMER) . . . 2458
54.8.15 SDMMC data FIFO registers x (SDMMC_FIFORx) . . . . . . . . . . . . . . 2458
RM0433 Rev 6 59/3289
RM0433 Contents
68
54.8.16 SDMMC DMA control register (SDMMC_IDMACTRLR) . . . . . . . . . . 2459
54.8.17 SDMMC IDMA buffer size register (SDMMC_IDMABSIZER) . . . . . . 2460
54.8.18 SDMMC IDMA buffer 0 base address register
(SDMMC_IDMABASE0R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2460
54.8.19 SDMMC IDMA buffer 1 base address register
(SDMMC_IDMABASE1R) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2461
54.8.20 SDMMC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2462
55 Controller area network with flexible data rate (FDCAN) . . . . . . . . 2465
55.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2465
55.2 FDCAN main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2468
55.3 FDCAN functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2469
55.3.1 Operating modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2470
55.3.2 Message RAM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2479
55.3.3 FIFO acknowledge handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2490
55.3.4 Bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2491
55.3.5 Clock calibration on CAN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2492
55.3.6 Application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2496
55.3.7 TTCAN operations (FDCAN1 only) . . . . . . . . . . . . . . . . . . . . . . . . . . 2497
55.3.8 TTCAN configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2498
55.3.9 Message scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2500
55.3.10 TTCAN gap control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2507
55.3.11 Stop watch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2508
55.3.12 Local time, cycle time, global time,
and external clock synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . 2508
55.3.13 TTCAN error level . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2511
55.3.14 TTCAN message handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2512
55.3.15 TTCAN interrupt and error handling . . . . . . . . . . . . . . . . . . . . . . . . . 2515
55.3.16 Level 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2516
55.3.17 Synchronization to external time schedule . . . . . . . . . . . . . . . . . . . . 2518
55.3.18 FDCAN Rx buffer and FIFO element . . . . . . . . . . . . . . . . . . . . . . . . . 2519
55.3.19 FDCAN Tx buffer element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2521
55.3.20 FDCAN Tx event FIFO element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2523
55.3.21 FDCAN standard message ID filter element . . . . . . . . . . . . . . . . . . . 2524
55.3.22 FDCAN extended message ID filter element . . . . . . . . . . . . . . . . . . . 2526
55.3.23 FDCAN trigger memory element . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2527
55.4 FDCAN registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2529
55.4.1 FDCAN core release register (FDCAN_CREL) . . . . . . . . . . . . . . . . . 2529
Contents RM0433
60/3289 RM0433 Rev 6
55.4.2 FDCAN Endian register (FDCAN_ENDN) . . . . . . . . . . . . . . . . . . . . . 2529
55.4.3 FDCAN data bit timing and prescaler register (FDCAN_DBTP) . . . . 2529
55.4.4 FDCAN test register (FDCAN_TEST) . . . . . . . . . . . . . . . . . . . . . . . . 2530
55.4.5 FDCAN RAM watchdog register (FDCAN_RWD) . . . . . . . . . . . . . . . 2531
55.4.6 FDCAN CC control register (FDCAN_CCCR) . . . . . . . . . . . . . . . . . . 2532
55.4.7 FDCAN nominal bit timing and prescaler register (FDCAN_NBTP) . 2534
55.4.8 FDCAN timestamp counter configuration register (FDCAN_TSCC) . 2535
55.4.9 FDCAN timestamp counter value register (FDCAN_TSCV) . . . . . . . 2535
55.4.10 FDCAN timeout counter configuration register (FDCAN_TOCC) . . . 2536
55.4.11 FDCAN timeout counter value register (FDCAN_TOCV) . . . . . . . . . 2537
55.4.12 FDCAN error counter register (FDCAN_ECR) . . . . . . . . . . . . . . . . . 2537
55.4.13 FDCAN protocol status register (FDCAN_PSR) . . . . . . . . . . . . . . . . 2538
55.4.14 FDCAN transmitter delay compensation register (FDCAN_TDCR) . . 2540
55.4.15 FDCAN interrupt register (FDCAN_IR) . . . . . . . . . . . . . . . . . . . . . . . 2541
55.4.16 FDCAN interrupt enable register (FDCAN_IE) . . . . . . . . . . . . . . . . . 2544
55.4.17 FDCAN interrupt line select register (FDCAN_ILS) . . . . . . . . . . . . . . 2546
55.4.18 FDCAN interrupt line enable register (FDCAN_ILE) . . . . . . . . . . . . . 2547
55.4.19 FDCAN global filter configuration register (FDCAN_GFC) . . . . . . . . 2548
55.4.20 FDCAN standard ID filter configuration register (FDCAN_SIDFC) . . 2549
55.4.21 FDCAN extended ID filter configuration register (FDCAN_XIDFC) . . 2549
55.4.22 FDCAN extended ID and mask register (FDCAN_XIDAM) . . . . . . . . 2550
55.4.23 FDCAN high priority message status register (FDCAN_HPMS) . . . . 2551
55.4.24 FDCAN new data 1 register (FDCAN_NDAT1) . . . . . . . . . . . . . . . . . 2551
55.4.25 FDCAN new data 2 register (FDCAN_NDAT2) . . . . . . . . . . . . . . . . . 2552
55.4.26 FDCAN Rx FIFO 0 configuration register (FDCAN_RXF0C) . . . . . . . 2552
55.4.27 FDCAN Rx FIFO 0 status register (FDCAN_RXF0S) . . . . . . . . . . . . 2553
55.4.28 FDCAN Rx FIFO 0 acknowledge register (FDCAN_RXF0A) . . . . . . 2554
55.4.29 FDCAN Rx buffer configuration register (FDCAN_RXBC) . . . . . . . . . 2554
55.4.30 FDCAN Rx FIFO 1 configuration register (FDCAN_RXF1C) . . . . . . . 2555
55.4.31 FDCAN Rx FIFO 1 status register (FDCAN_RXF1S) . . . . . . . . . . . . 2556
55.4.32 FDCAN Rx FIFO 1 acknowledge register (FDCAN_RXF1A) . . . . . . 2557
55.4.33 FDCAN Rx buffer element size configuration register
(FDCAN_RXESC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2557
55.4.34 FDCAN Tx buffer configuration register (FDCAN_TXBC) . . . . . . . . . 2558
55.4.35 FDCAN Tx FIFO/queue status register (FDCAN_TXFQS) . . . . . . . . 2559
55.4.36 FDCAN Tx buffer element size configuration register
(FDCAN_TXESC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2560
55.4.37 FDCAN Tx buffer request pending register (FDCAN_TXBRP) . . . . . 2561
RM0433 Rev 6 61/3289
RM0433 Contents
68
55.4.38 FDCAN Tx buffer add request register (FDCAN_TXBAR) . . . . . . . . . 2562
55.4.39 FDCAN Tx buffer cancellation request register (FDCAN_TXBCR) . . 2562
55.4.40 FDCAN Tx buffer transmission occurred register (FDCAN_TXBTO) 2563
55.4.41 FDCAN Tx buffer cancellation finished register (FDCAN_TXBCF) . . 2563
55.4.42 FDCAN Tx buffer transmission interrupt enable register
(FDCAN_TXBTIE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2563
55.4.43 FDCAN Tx buffer cancellation finished interrupt enable register
(FDCAN_ TXBCIE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2564
55.4.44 FDCAN Tx event FIFO configuration register (FDCAN_TXEFC) . . . 2564
55.4.45 FDCAN Tx event FIFO status register (FDCAN_TXEFS) . . . . . . . . . 2565
55.4.46 FDCAN Tx event FIFO acknowledge register (FDCAN_TXEFA) . . . 2566
55.4.47 FDCAN TT trigger memory configuration register (FDCAN_TTTMC) 2566
55.4.48 FDCAN TT reference message configuration register
(FDCAN_TTRMC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2567
55.4.49 FDCAN TT operation configuration register (FDCAN_TTOCF) . . . . . 2568
55.4.50 FDCAN TT matrix limits register (FDCAN_TTMLM) . . . . . . . . . . . . . 2569
55.4.51 FDCAN TUR configuration register (FDCAN_TURCF) . . . . . . . . . . . 2570
55.4.52 FDCAN TT operation control register (FDCAN_TTOCN) . . . . . . . . . 2572
55.4.53 FDCAN TT global time preset register (FDCAN_TTGTP) . . . . . . . . . 2574
55.4.54 FDCAN TT time mark register (FDCAN_TTTMK) . . . . . . . . . . . . . . . 2574
55.4.55 FDCAN TT interrupt register (FDCAN_TTIR) . . . . . . . . . . . . . . . . . . 2575
55.4.56 FDCAN TT interrupt enable register (FDCAN_TTIE) . . . . . . . . . . . . . 2577
55.4.57 FDCAN TT interrupt line select register (FDCAN_TTILS) . . . . . . . . . 2579
55.4.58 FDCAN TT operation status register (FDCAN_TTOST) . . . . . . . . . . 2581
55.4.59 FDCAN TUR numerator actual register (FDCAN_TURNA) . . . . . . . . 2582
55.4.60 FDCAN TT local and global time register (FDCAN_TTLGT) . . . . . . . 2583
55.4.61 FDCAN TT cycle time and count register (FDCAN_TTCTC) . . . . . . . 2583
55.4.62 FDCAN TT capture time register (FDCAN_TTCPT) . . . . . . . . . . . . . 2584
55.4.63 FDCAN TT cycle sync mark register (FDCAN_TTCSM) . . . . . . . . . . 2584
55.4.64 FDCAN TT trigger select register (FDCAN_TTTS) . . . . . . . . . . . . . . 2585
55.4.65 FDCAN register map and reset value table . . . . . . . . . . . . . . . . . . . . 2586
55.5 CCU registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2591
55.5.1 Clock calibration unit core release register (FDCAN_CCU_CREL) . . 2591
55.5.2 Calibration configuration register (FDCAN_CCU_CCFG) . . . . . . . . . 2591
55.5.3 Calibration status register (FDCAN_CCU_CSTAT) . . . . . . . . . . . . . . 2593
55.5.4 Calibration watchdog register (FDCAN_CCU_CWD) . . . . . . . . . . . . 2593
55.5.5 Clock calibration unit interrupt register (FDCAN_CCU_IR) . . . . . . . . 2594
55.5.6 Clock calibration unit interrupt enable register (FDCAN_CCU_IE) . . 2595
Contents RM0433
62/3289 RM0433 Rev 6
55.5.7 CCU register map and reset value table . . . . . . . . . . . . . . . . . . . . . . 2596
56 USB on-the-go high-speed (OTG_HS) . . . . . . . . . . . . . . . . . . . . . . . . 2597
56.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2597
56.2 OTG main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2598
56.2.1 General features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2599
56.2.2 Host-mode features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2600
56.2.3 Peripheral-mode features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2600
56.3 OTG implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2601
56.4 OTG functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2601
56.4.1 OTG block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2601
56.4.2 USB OTG pin and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . 2603
56.4.3 OTG core . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2603
56.4.4 Embedded full speed OTG PHY . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2604
56.4.5 High-speed OTG PHY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2604
56.5 OTG dual role device (DRD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2604
56.5.1 ID line detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2604
56.5.2 HNP dual role device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2605
56.5.3 SRP dual role device . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2605
56.6 USB peripheral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2605
56.6.1 SRP-capable peripheral . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2606
56.6.2 Peripheral states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2606
56.6.3 Peripheral endpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2607
56.7 USB host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2609
56.7.1 SRP-capable host . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2609
56.7.2 USB host states . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2610
56.7.3 Host channels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2611
56.7.4 Host scheduler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2612
56.8 SOF trigger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2613
56.8.1 Host SOFs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2614
56.8.2 Peripheral SOFs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2614
56.9 OTG low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2614
56.10 Dynamic update of the OTG_HFIR register . . . . . . . . . . . . . . . . . . . . . 2615
56.11 USB data FIFOs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2616
56.11.1 Peripheral FIFO architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2617
56.11.2 Host FIFO architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2618
RM0433 Rev 6 63/3289
RM0433 Contents
68
56.11.3 FIFO RAM allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2619
56.12 OTG_HS interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2621
56.13 OTG_HS control and status registers . . . . . . . . . . . . . . . . . . . . . . . . . 2623
56.13.1 CSR memory map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2623
56.14 OTG_HS registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2628
56.14.1 OTG control and status register (OTG_GOTGCTL) . . . . . . . . . . . . . 2628
56.14.2 OTG interrupt register (OTG_GOTGINT) . . . . . . . . . . . . . . . . . . . . . 2631
56.14.3 OTG AHB configuration register (OTG_GAHBCFG) . . . . . . . . . . . . . 2633
56.14.4 OTG USB configuration register (OTG_GUSBCFG) . . . . . . . . . . . . . 2634
56.14.5 OTG reset register (OTG_GRSTCTL) . . . . . . . . . . . . . . . . . . . . . . . . 2638
56.14.6 OTG core interrupt register (OTG_GINTSTS) . . . . . . . . . . . . . . . . . . 2640
56.14.7 OTG interrupt mask register (OTG_GINTMSK) . . . . . . . . . . . . . . . . . 2644
56.14.8 OTG receive status debug read register (OTG_GRXSTSR) . . . . . . . 2647
56.14.9 OTG receive status debug read [alternate] (OTG_GRXSTSR) . . . . . 2648
56.14.10 OTG status read and pop registers (OTG_GRXSTSP) . . . . . . . . . . . 2649
56.14.11 OTG status read and pop registers [alternate] (OTG_GRXSTSP) . . 2650
56.14.12 OTG receive FIFO size register (OTG_GRXFSIZ) . . . . . . . . . . . . . . 2651
56.14.13 OTG host non-periodic transmit FIFO size register
(OTG_HNPTXFSIZ)/Endpoint 0 Transmit FIFO size
(OTG_DIEPTXF0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2651
56.14.14 OTG non-periodic transmit FIFO/queue status register
(OTG_HNPTXSTS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2652
56.14.15 OTG general core configuration register (OTG_GCCFG) . . . . . . . . . 2653
56.14.16 OTG core ID register (OTG_CID) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2655
56.14.17 OTG core LPM configuration register (OTG_GLPMCFG) . . . . . . . . . 2655
56.14.18 OTG host periodic transmit FIFO size register
(OTG_HPTXFSIZ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2659
56.14.19 OTG device IN endpoint transmit FIFO x size register
(OTG_DIEPTXFx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2659
56.14.20 Host-mode registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2660
56.14.21 OTG host configuration register (OTG_HCFG) . . . . . . . . . . . . . . . . . 2660
56.14.22 OTG host frame interval register (OTG_HFIR) . . . . . . . . . . . . . . . . . 2661
56.14.23 OTG host frame number/frame time remaining register
(OTG_HFNUM) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2662
56.14.24 OTG_Host periodic transmit FIFO/queue status register
(OTG_HPTXSTS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2662
56.14.25 OTG host all channels interrupt register (OTG_HAINT) . . . . . . . . . . 2663
56.14.26 OTG host all channels interrupt mask register
(OTG_HAINTMSK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2664
Contents RM0433
64/3289 RM0433 Rev 6
56.14.27 OTG host port control and status register (OTG_HPRT) . . . . . . . . . . 2665
56.14.28 OTG host channel x characteristics register (OTG_HCCHARx) . . . . 2667
56.14.29 OTG host channel x split control register (OTG_HCSPLTx) . . . . . . . 2668
56.14.30 OTG host channel x interrupt register (OTG_HCINTx) . . . . . . . . . . . 2669
56.14.31 OTG host channel x interrupt mask register (OTG_HCINTMSKx) . . 2670
56.14.32 OTG host channel x transfer size register (OTG_HCTSIZx) . . . . . . . 2671
56.14.33 OTG host channel x DMA address register (OTG_HCDMAx) . . . . . . 2672
56.14.34 Device-mode registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2672
56.14.35 OTG device configuration register (OTG_DCFG) . . . . . . . . . . . . . . . 2673
56.14.36 OTG device control register (OTG_DCTL) . . . . . . . . . . . . . . . . . . . . 2674
56.14.37 OTG device status register (OTG_DSTS) . . . . . . . . . . . . . . . . . . . . . 2676
56.14.38 OTG device IN endpoint common interrupt mask register
(OTG_DIEPMSK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2677
56.14.39 OTG device OUT endpoint common interrupt mask register
(OTG_DOEPMSK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2678
56.14.40 OTG device all endpoints interrupt register (OTG_DAINT) . . . . . . . . 2680
56.14.41 OTG all endpoints interrupt mask register
(OTG_DAINTMSK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2680
56.14.42 OTG device VBUS discharge time register
(OTG_DVBUSDIS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2681
56.14.43 OTG device VBUS pulsing time register
(OTG_DVBUSPULSE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2681
56.14.44 OTG device threshold control register (OTG_DTHRCTL) . . . . . . . . . 2682
56.14.45 OTG device IN endpoint FIFO empty interrupt mask register
(OTG_DIEPEMPMSK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2683
56.14.46 OTG device each endpoint interrupt register (OTG_DEACHINT) . . . 2683
56.14.47 OTG device each endpoint interrupt mask register
(OTG_DEACHINTMSK) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2684
56.14.48 OTG device each IN endpoint-1 interrupt mask register
(OTG_HS_DIEPEACHMSK1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2684
56.14.49 OTG device each OUT endpoint-1 interrupt mask register
(OTG_HS_DOEPEACHMSK1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2685
56.14.50 OTG device IN endpoint x control register (OTG_DIEPCTLx) . . . . . 2687
56.14.51 OTG device IN endpoint x interrupt register (OTG_DIEPINTx) . . . . . 2689
56.14.52 OTG device IN endpoint 0 transfer size register
(OTG_DIEPTSIZ0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2691
56.14.53 OTG device IN endpoint x DMA address register
(OTG_DIEPDMAx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2691
56.14.54 OTG device IN endpoint transmit FIFO status register
(OTG_DTXFSTSx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2692
56.14.55 OTG device IN endpoint x transfer size register (OTG_DIEPTSIZx) . 2692
RM0433 Rev 6 65/3289
RM0433 Contents
68
56.14.56 OTG device control OUT endpoint 0 control register
(OTG_DOEPCTL0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2693
56.14.57 OTG device OUT endpoint x interrupt register (OTG_DOEPINTx) . . 2695
56.14.58 OTG device OUT endpoint 0 transfer size register
(OTG_DOEPTSIZ0) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2697
56.14.59 OTG device OUT endpoint x DMA address register
(OTG_DOEPDMAx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2698
56.14.60 OTG device OUT endpoint x control register
(OTG_DOEPCTLx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2698
56.14.61 OTG device OUT endpoint x transfer size register
(OTG_DOEPTSIZx) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2701
56.14.62 OTG power and clock gating control register (OTG_PCGCCTL) . . . 2702
56.14.63 OTG_HS register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2703
56.15 OTG_HS programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2713
56.15.1 Core initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2713
56.15.2 Host initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2713
56.15.3 Device initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2714
56.15.4 DMA mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2715
56.15.5 Host programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2715
56.15.6 Device programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2747
56.15.7 Worst case response time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2765
56.15.8 OTG programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2767
57 Ethernet (ETH): media access control
 (MAC) with DMA controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2773
57.1 Ethernet introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2773
57.2 Ethernet main features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2773
57.2.1 MAC core features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2773
57.2.2 DMA features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2776
57.2.3 Bus interface features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2776
57.3 Ethernet pins and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2777
57.4 Ethernet architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2779
57.4.1 DMA controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2780
57.4.2 MTL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2786
57.4.3 MAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2787
57.5 Ethernet functional description: MAC . . . . . . . . . . . . . . . . . . . . . . . . . . 2792
57.5.1 Double VLAN processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2792
57.5.2 Source Address and VLAN insertion, replacement, or deletion . . . . . 2793
Contents RM0433
66/3289 RM0433 Rev 6
57.5.3 Packet filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2795
57.5.4 IEEE 1588 timestamps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2802
57.5.5 IPv4 ARP offload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2815
57.5.6 TCP segmentation offload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2815
57.5.7 Loopback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2819
57.5.8 Flow control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2819
57.5.9 Checksum offload engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2821
57.5.10 MAC management counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2826
57.5.11 Interrupts generated by the MAC . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2826
57.5.12 MAC and MMC register descriptions . . . . . . . . . . . . . . . . . . . . . . . . . 2826
57.6 Ethernet functional description: PHY interfaces . . . . . . . . . . . . . . . . . . 2827
57.6.1 Station management agent (SMA) . . . . . . . . . . . . . . . . . . . . . . . . . . 2827
57.6.2 Media Independent Interface (MII) . . . . . . . . . . . . . . . . . . . . . . . . . . . 2830
57.6.3 Reduced media independent interface (RMII) . . . . . . . . . . . . . . . . . . 2832
57.7 Ethernet low-power modes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2835
57.7.1 Energy Efficient Ethernet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2835
57.7.2 Power management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2836
57.7.3 Power-down and wakeup sequence . . . . . . . . . . . . . . . . . . . . . . . . . 2838
57.8 Ethernet interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2839
57.8.1 DMA interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2839
57.8.2 MTL interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2840
57.8.3 MAC Interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2841
57.9 Ethernet programming model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2842
57.9.1 DMA initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2842
57.9.2 MTL initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2843
57.9.3 MAC initialization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2843
57.9.4 Performing normal receive and transmit operation . . . . . . . . . . . . . . 2844
57.9.5 Stopping and starting transmission . . . . . . . . . . . . . . . . . . . . . . . . . . 2844
57.9.6 Programming guidelines for MII link state transitions . . . . . . . . . . . . 2845
57.9.7 Programming guidelines for IEEE 1588 timestamping . . . . . . . . . . . 2846
57.9.8 Programming guidelines for Energy Efficient Ethernet (EEE) . . . . . . 2847
57.9.9 Programming guidelines for flexible pulse-per-second (PPS) output 2848
57.9.10 Programming guidelines for TSO . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2849
57.9.11 Programming guidelines to perform VLAN filtering on the receive . . 2850
57.10 Descriptors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2851
57.10.1 Descriptor overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2851
RM0433 Rev 6 67/3289
RM0433 Contents
68
57.10.2 Descriptor structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2851
57.10.3 Transmit descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2853
57.10.4 Receive descriptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2865
57.11 Ethernet registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2877
57.11.1 Ethernet registers maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2877
57.11.2 Ethernet DMA registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2877
57.11.3 Ethernet MTL registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2902
57.11.4 Ethernet MAC and MMC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . 2914
58 HDMI-CEC controller (CEC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3013
58.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3013
58.2 HDMI-CEC controller main features . . . . . . . . . . . . . . . . . . . . . . . . . . . 3013
58.3 HDMI-CEC functional description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3014
58.3.1 HDMI-CEC pin and internal signals . . . . . . . . . . . . . . . . . . . . . . . . . . 3014
58.3.2 HDMI-CEC block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3015
58.3.3 Message description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3015
58.3.4 Bit timing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3016
58.4 Arbitration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3016
58.4.1 SFT option bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3018
58.5 Error handling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3018
58.5.1 Bit error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3018
58.5.2 Message error . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3019
58.5.3 Bit Rising Error (BRE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3019
58.5.4 Short Bit Period Error (SBPE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3019
58.5.5 Long Bit Period Error (LBPE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3019
58.5.6 Transmission Error Detection (TXERR) . . . . . . . . . . . . . . . . . . . . . . . 3022
58.6 HDMI-CEC interrupts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3023
58.7 HDMI-CEC registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3024
58.7.1 CEC control register (CEC_CR) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3024
58.7.2 CEC configuration register (CEC_CFGR) . . . . . . . . . . . . . . . . . . . . . 3025
58.7.3 CEC Tx data register (CEC_TXDR) . . . . . . . . . . . . . . . . . . . . . . . . . . 3028
58.7.4 CEC Rx data register (CEC_RXDR) . . . . . . . . . . . . . . . . . . . . . . . . . 3028
58.7.5 CEC Interrupt and Status Register (CEC_ISR) . . . . . . . . . . . . . . . . . 3028
58.7.6 CEC interrupt enable register (CEC_IER) . . . . . . . . . . . . . . . . . . . . . 3030
58.7.7 HDMI-CEC register map . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3032
Contents RM0433
68/3289 RM0433 Rev 6
59 Debug infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3033
59.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3033
59.2 Debug infrastructure features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3034
59.3 Debug infrastructure functional description . . . . . . . . . . . . . . . . . . . . . 3034
59.3.1 Debug infrastructure block diagram . . . . . . . . . . . . . . . . . . . . . . . . . . 3034
59.3.2 Debug infrastructure pins and internal signals . . . . . . . . . . . . . . . . . . 3035
59.3.3 Debug infrastructure powering, clocking and reset . . . . . . . . . . . . . . 3036
59.4 Debug access port functional description . . . . . . . . . . . . . . . . . . . . . . . 3038
59.4.1 Serial-wire and JTAG debug port (SWJ-DP) . . . . . . . . . . . . . . . . . . . 3038
59.4.2 Access ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3052
59.5 Trace and debug subsystem functional description . . . . . . . . . . . . . . . 3058
59.5.1 System ROM tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3058
59.5.2 Global timestamp generator (TSG) . . . . . . . . . . . . . . . . . . . . . . . . . . 3066
59.5.3 Cross trigger interfaces (CTI) and matrix (CTM) . . . . . . . . . . . . . . . . 3073
59.5.4 Trace funnel (CSTF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3093
59.5.5 Embedded trace FIFO (ETF) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3103
59.5.6 Trace port interface unit (TPIU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3125
59.5.7 Serial wire output (SWO) and SWO trace funnel (SWTF) . . . . . . . . . 3143
59.5.8 Microcontroller debug unit (DBGMCU) . . . . . . . . . . . . . . . . . . . . . . . 3166
59.6 Cortex-M7 debug functional description . . . . . . . . . . . . . . . . . . . . . . . . 3173
59.6.1 Cortex-M7 ROM tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3174
59.6.2 Cortex-M7 data watchpoint and trace unit (DWT) . . . . . . . . . . . . . . . 3186
59.6.3 Cortex-M7 instrumentation trace macrocell (ITM) . . . . . . . . . . . . . . . 3199
59.6.4 Cortex-M7 breakpoint unit (FPB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3208
59.6.5 Cortex-M7 embedded trace macrocell (ETM) . . . . . . . . . . . . . . . . . . 3216
59.6.6 Cortex-M7 cross trigger interface (CTI) . . . . . . . . . . . . . . . . . . . . . . . 3248
59.7 References for debug infrastructure . . . . . . . . . . . . . . . . . . . . . . . . . . . 3248
60 Device electronic signature . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3249
60.1 Unique device ID register (96 bits) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3249
60.2 Flash size . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3250
60.3 Package data register . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3250
61 Revision history . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3251

标签: STM32H7 STM32 STM3 stm 32

实例下载地址

网友评论

发表评论

(您的评论需要经过审核才能显示)

查看所有0条评论>>

小贴士

感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。

  • 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
  • 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
  • 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
  • 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。

关于好例子网

本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明

;
报警