RM0402-STM32F412

This reference manual targets application developers. It provides complete information on how to use the memory and the peripherals of the STM32F412 microcontrollers.

The STM32F412 is a line of microcontrollers with different memory sizes, packages and peripherals.

For ordering information, mechanical and electrical device characteristics refer to the datasheet.

For information on the Arm ® Cortex ® -M4 with FPU core, refer to the Cortex ® -M4 with FPU Technical Reference Manual.

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

Available from STMicroelectronics web site www.st.com :

Contents

3.5.2Program/erase parallelism . . . . .64
3.5.3Erase . . . . .64
3.5.4Programming . . . . .65
3.5.5Interrupts . . . . .66
3.6Option bytes . . . . .66
3.6.1Description of user option bytes . . . . .66
3.6.2Programming user option bytes . . . . .68
3.6.3Read protection (RDP) . . . . .68
3.6.4Write protections . . . . .70
3.6.5Proprietary code readout protection (PCROP) . . . . .71
3.7One-time programmable bytes . . . . .73
3.8Flash interface registers . . . . .74
3.8.1Flash access control register (FLASH_ACR) . . . . .74
3.8.2Flash key register (FLASH_KEYR) . . . . .75
3.8.3Flash option key register (FLASH_OPTKEYR) . . . . .75
3.8.4Flash status register (FLASH_SR) . . . . .76
3.8.5Flash control register (FLASH_CR) . . . . .77
3.8.6Flash option control register (FLASH_OPTCR) . . . . .78
3.8.7Flash interface register map . . . . .81
4CRC calculation unit . . . . .82
4.1CRC introduction . . . . .82
4.2CRC main features . . . . .82
4.3CRC functional description . . . . .82
4.4CRC registers . . . . .83
4.4.1Data register (CRC_DR) . . . . .83
4.4.2Independent data register (CRC_IDR) . . . . .84
4.4.3Control register (CRC_CR) . . . . .84
4.4.4CRC register map . . . . .85
5Power controller (PWR) . . . . .86
5.1Power supplies . . . . .86
5.1.1Independent A/D converter supply and reference voltage . . . . .87
5.1.2Battery backup domain . . . . .87
5.1.3Voltage regulator . . . . .89
5.2Power supply supervisor . . . . .90
6.3.3RCC clock configuration register (RCC_CFGR) . . . . .125
6.3.4RCC clock interrupt register (RCC_CIR) . . . . .128
6.3.5RCC AHB1 peripheral reset register (RCC_AHB1RSTR) . . . . .130
6.3.6RCC AHB2 peripheral reset register (RCC_AHB2RSTR) . . . . .132
6.3.7RCC AHB3 peripheral reset register (RCC_AHB3RSTR) . . . . .133
6.3.8RCC APB1 peripheral reset register for (RCC_APB1RSTR) . . . . .133
6.3.9RCC APB2 peripheral reset register (RCC_APB2RSTR) . . . . .136
6.3.10RCC AHB1 peripheral clock enable register (RCC_AHB1ENR) . . . . .138
6.3.11RCC AHB2 peripheral clock enable register (RCC_AHB2ENR) . . . . .140
6.3.12RCC AHB3 peripheral clock enable register (RCC_AHB3ENR) . . . . .141
6.3.13RCC APB1 peripheral clock enable register (RCC_APB1ENR) . . . . .141
6.3.14RCC APB2 peripheral clock enable register
(RCC_APB2ENR) . . . . .
144
6.3.15RCC AHB1 peripheral clock enable in low power mode register
(RCC_AHB1LPENR) . . . . .
146
6.3.16RCC AHB2 peripheral clock enable in low power mode register
(RCC_AHB2LPENR) . . . . .
148
6.3.17RCC AHB3 peripheral clock enable in low power mode register
(RCC_AHB3LPENR) . . . . .
148
6.3.18RCC APB1 peripheral clock enable in low power mode register
(RCC_APB1LPENR) . . . . .
150
6.3.19RCC APB2 peripheral clock enabled in low power mode register
(RCC_APB2LPENR) . . . . .
153
6.3.20RCC Backup domain control register (RCC_BDCR) . . . . .155
6.3.21RCC clock control & status register (RCC_CSR) . . . . .156
6.3.22RCC spread spectrum clock generation register (RCC_SSCGR) . . . . .159
6.3.23RCC PLLI2S configuration register (RCC_PLLI2SCFGR) . . . . .160
6.3.24RCC Dedicated Clocks Configuration Register (RCC_DCKCFGR) . . . . .162
6.3.25RCC clocks gated enable register (CKGATENR) . . . . .163
6.3.26RCC Dedicated Clocks Configuration Register (RCC_DCKCFGR2) . . . . .164
6.3.27RCC register map . . . . .165
7General-purpose I/Os (GPIO) . . . . .168
7.1GPIO introduction . . . . .168
7.2GPIO main features . . . . .168
7.3GPIO functional description . . . . .168
7.3.1General-purpose I/O (GPIO) . . . . .170
7.3.2I/O pin multiplexer and mapping . . . . .171
7.3.3I/O port control registers . . . . .174
7.3.4I/O port data registers . . . . .174
7.3.5I/O data bitwise handling . . . . .174
7.3.6GPIO locking mechanism . . . . .174
7.3.7I/O alternate function input/output . . . . .175
7.3.8External interrupt/wakeup lines . . . . .175
7.3.9Input configuration . . . . .175
7.3.10Output configuration . . . . .176
7.3.11Alternate function configuration . . . . .177
7.3.12Analog configuration . . . . .178
7.3.13Using the OSC32_IN/OSC32_OUT pins as GPIO PC14/PC15
port pins . . . . .
178
7.3.14Using the OSC_IN/OSC_OUT pins as GPIO PH0/PH1 port pins . . . . .178
7.3.15Selection of RTC additional functions . . . . .179
7.4GPIO registers . . . . .180
7.4.1GPIO port mode register (GPIOx_MODER) (x = A...H) . . . . .180
7.4.2GPIO port output type register (GPIOx_OTYPER)
(x = A...H) . . . . .
180
7.4.3GPIO port output speed register (GPIOx_OSPEEDR)
(x = A...H) . . . . .
181
7.4.4GPIO port pull-up/pull-down register (GPIOx_PUPDR)
(x = A...H) . . . . .
181
7.4.5GPIO port input data register (GPIOx_IDR) (x = A...H) . . . . .182
7.4.6GPIO port output data register (GPIOx_ODR) (x = A...H) . . . . .182
7.4.7GPIO port bit set/reset register (GPIOx_BSRR) (x = A...H) . . . . .182
7.4.8GPIO port configuration lock register (GPIOx_LCKR)
(x = A...H) . . . . .
183
7.4.9GPIO alternate function low register (GPIOx_AFRL) (x = A...H) . . . . .184
7.4.10GPIO alternate function high register (GPIOx_AFRH)
(x = A...H) . . . . .
185
7.4.11GPIO register map . . . . .185
8System configuration controller (SYSCFG) . . . . .188
8.1I/O compensation cell . . . . .188
8.2SYSCFG registers . . . . .188
8.2.1SYSCFG memory remap register (SYSCFG_MEMRMP) . . . . .188
8.2.2SYSCFG peripheral mode configuration register (SYSCFG_PMC) . . . . .189
8.2.3SYSCFG external interrupt configuration register 1
(SYSCFG_EXTICR1) . . . . .
190
8.2.4SYSCFG external interrupt configuration register 2 (SYSCFG_EXTICR2) .....190
8.2.5SYSCFG external interrupt configuration register 3 (SYSCFG_EXTICR3) .....191
8.2.6SYSCFG external interrupt configuration register 4 (SYSCFG_EXTICR4) .....192
8.2.7SYSCFG configuration register 2 (SYSCFG_CFGR2) .....192
8.2.8Compensation cell control register (SYSCFG_CMPCR) .....193
8.2.9SYSCFG configuration register (SYSCFG_CFGR) .....194
8.2.10SYSCFG register map .....195
9Direct memory access controller (DMA) .....196
9.1DMA introduction .....196
9.2DMA main features .....196
9.3DMA functional description .....198
9.3.1DMA block diagram .....198
9.3.2DMA overview .....198
9.3.3DMA transactions .....199
9.3.4Channel selection .....199
9.3.5Arbiter .....201
9.3.6DMA streams .....201
9.3.7Source, destination and transfer modes .....201
9.3.8Pointer incrementation .....205
9.3.9Circular mode .....206
9.3.10Double-buffer mode .....206
9.3.11Programmable data width, packing/unpacking, endianness .....207
9.3.12Single and burst transfers .....208
9.3.13FIFO .....209
9.3.14DMA transfer completion .....212
9.3.15DMA transfer suspension .....213
9.3.16Flow controller .....214
9.3.17Summary of the possible DMA configurations .....215
9.3.18Stream configuration procedure .....215
9.3.19Error management .....216
9.4DMA interrupts .....217
9.5DMA registers .....218
9.5.1DMA low interrupt status register (DMA_LISR) .....218

10 Interrupts and events . . . . . 231

11 Flexible static memory controller (FSMC) . . . . . 246

11.4AHB interface . . . . .247
11.4.1Supported memories and transactions . . . . .248
11.5External device address mapping . . . . .249
11.5.1NOR/PSRAM address mapping . . . . .249
11.6NOR flash/PSRAM controller . . . . .250
11.6.1External memory interface signals . . . . .251
11.6.2Supported memories and transactions . . . . .253
11.6.3General timing rules . . . . .254
11.6.4NOR flash/PSRAM controller asynchronous transactions . . . . .254
11.6.5Synchronous transactions . . . . .272
11.6.6NOR/PSRAM controller registers . . . . .279
11.6.7FSMC register map . . . . .286
12Quad-SPI interface (QUADSPI) . . . . .288
12.1Introduction . . . . .288
12.2QUADSPI main features . . . . .288
12.3QUADSPI functional description . . . . .288
12.3.1QUADSPI block diagram . . . . .288
12.3.2QUADSPI pins . . . . .289
12.3.3QUADSPI command sequence . . . . .289
12.3.4QUADSPI signal interface protocol modes . . . . .292
12.3.5QUADSPI indirect mode . . . . .294
12.3.6QUADSPI automatic status-polling mode . . . . .296
12.3.7QUADSPI memory-mapped mode . . . . .296
12.3.8QUADSPI flash memory configuration . . . . .297
12.3.9QUADSPI delayed data sampling . . . . .297
12.3.10QUADSPI configuration . . . . .297
12.3.11QUADSPI use . . . . .298
12.3.12Sending the instruction only once . . . . .300
12.3.13QUADSPI error management . . . . .300
12.3.14QUADSPI busy bit and abort functionality . . . . .300
12.3.15NCS behavior . . . . .301
12.4QUADSPI interrupts . . . . .303
12.5QUADSPI registers . . . . .303
12.5.1QUADSPI control register (QUADSPI_CR) . . . . .303
12.5.2QUADSPI device configuration register (QUADSPI_DCR) . . . . .306
13.10Battery charge monitoring . . . . .329
13.11ADC interrupts . . . . .330
13.12ADC registers . . . . .331
13.12.1ADC status register (ADC_SR) . . . . .331
13.12.2ADC control register 1 (ADC_CR1) . . . . .332
13.12.3ADC control register 2 (ADC_CR2) . . . . .334
13.12.4ADC sample time register 1 (ADC_SMPR1) . . . . .336
13.12.5ADC sample time register 2 (ADC_SMPR2) . . . . .337
13.12.6ADC injected channel data offset register x (ADC_JOFRx) (x=1..4) . . . . .337
13.12.7ADC watchdog higher threshold register (ADC_HTR) . . . . .337
13.12.8ADC watchdog lower threshold register (ADC_LTR) . . . . .338
13.12.9ADC regular sequence register 1 (ADC_SQR1) . . . . .338
13.12.10ADC regular sequence register 2 (ADC_SQR2) . . . . .339
13.12.11ADC regular sequence register 3 (ADC_SQR3) . . . . .340
13.12.12ADC injected sequence register (ADC_JSQR) . . . . .341
13.12.13ADC injected data register x (ADC_JDRx) (x= 1..4) . . . . .341
13.12.14ADC regular data register (ADC_DR) . . . . .342
13.12.15ADC Common status register (ADC_CSR) . . . . .342
13.12.16ADC common control register (ADC_CCR) . . . . .343
13.12.17ADC register map . . . . .344
14Digital filter for sigma delta modulators (DFSDM) . . . . .346
14.1Introduction . . . . .346
14.2DFSDM main features . . . . .347
14.3DFSDM implementation . . . . .348
14.4DFSDM functional description . . . . .349
14.4.1DFSDM block diagram . . . . .349
14.4.2DFSDM pins and internal signals . . . . .350
14.4.3DFSDM reset and clocks . . . . .351
14.4.4Serial channel transceivers . . . . .352
14.4.5Configuring the input serial interface . . . . .362
14.4.6Parallel data inputs . . . . .362
14.4.7Channel selection . . . . .364
14.4.8Digital filter configuration . . . . .364
14.4.9Integrator unit . . . . .366
14.4.10Analog watchdog . . . . .366
14.4.11Short-circuit detector . . . . .369
14.4.12Extreme detector . . . . .369
14.4.13Data unit block . . . . .370
14.4.14Signed data format . . . . .371
14.4.15Launching conversions . . . . .371
14.4.16Continuous and fast continuous modes . . . . .372
14.4.17Request precedence . . . . .372
14.4.18Power optimization in run mode . . . . .373
14.5DFSDM interrupts . . . . .373
14.6DFSDM DMA transfer . . . . .375
14.7DFSDM channel y registers (y=0..3) . . . . .375
14.7.1DFSDM channel y configuration register (DFSDM_CHyCFGR1) . . . . .375
14.7.2DFSDM channel y configuration register (DFSDM_CHyCFGR2) . . . . .378
14.7.3DFSDM channel y analog watchdog and short-circuit detector register
(DFSDM_CHyAWSCDR) . . . . .
378
14.7.4DFSDM channel y watchdog filter data register
(DFSDM_CHyWDATR) . . . . .
379
14.7.5DFSDM channel y data input register (DFSDM_CHyDATINR) . . . . .380
14.8DFSDM filter x module registers (x=0..1) . . . . .381
14.8.1DFSDM filter x control register 1 (DFSDM_FLTxCR1) . . . . .381
14.8.2DFSDM filter x control register 2 (DFSDM_FLTxCR2) . . . . .383
14.8.3DFSDM filter x interrupt and status register (DFSDM_FLTxISR) . . . . .385
14.8.4DFSDM filter x interrupt flag clear register (DFSDM_FLTxICR) . . . . .386
14.8.5DFSDM filter x injected channel group selection register
(DFSDM_FLTxJCHGR) . . . . .
387
14.8.6DFSDM filter x control register (DFSDM_FLTxFCR) . . . . .388
14.8.7DFSDM filter x data register for injected group
(DFSDM_FLTxJDATAR) . . . . .
389
14.8.8DFSDM filter x data register for the regular channel
(DFSDM_FLTxRDATAR) . . . . .
390
14.8.9DFSDM filter x analog watchdog high threshold register
(DFSDM_FLTxAWHTR) . . . . .
390
14.8.10DFSDM filter x analog watchdog low threshold register
(DFSDM_FLTxAWLTR) . . . . .
391
14.8.11DFSDM filter x analog watchdog status register
(DFSDM_FLTxAWSR) . . . . .
392
14.8.12DFSDM filter x analog watchdog clear flag register
(DFSDM_FLTxAWCFR) . . . . .
392
14.8.13DFSDM filter x extremes detector maximum register (DFSDM_FLTxEXMAX) . . . . .393
14.8.14DFSDM filter x extremes detector minimum register (DFSDM_FLTxEXMIN) . . . . .393
14.8.15DFSDM filter x conversion timer register (DFSDM_FLTxCNVTIMR) . . . . .394
14.8.16DFSDM register map . . . . .395
15True random number generator (RNG) . . . . .400
15.1Introduction . . . . .400
15.2RNG main features . . . . .400
15.3RNG functional description . . . . .401
15.3.1RNG block diagram . . . . .401
15.3.2RNG internal signals . . . . .401
15.3.3Random number generation . . . . .402
15.3.4RNG initialization . . . . .404
15.3.5RNG operation . . . . .404
15.3.6RNG clocking . . . . .405
15.3.7Error management . . . . .405
15.3.8RNG low-power use . . . . .406
15.4RNG interrupts . . . . .406
15.5RNG processing time . . . . .406
15.6RNG entropy source validation . . . . .406
15.6.1Introduction . . . . .406
15.6.2Validation conditions . . . . .407
15.6.3Data collection . . . . .407
15.7RNG registers . . . . .407
15.7.1RNG control register (RNG_CR) . . . . .407
15.7.2RNG status register (RNG_SR) . . . . .408
15.7.3RNG data register (RNG_DR) . . . . .409
15.7.4RNG register map . . . . .410
16Advanced-control timers (TIM1&TIM8) . . . . .411
16.1TIM1&TIM8 introduction . . . . .411
16.2TIM1&TIM8 main features . . . . .411
16.3TIM1&TIM8 functional description . . . . .413
16.3.1Time-base unit . . . . .413
16.3.2Counter modes . . . . .415
16.3.3Repetition counter . . . . .424
16.3.4Clock selection . . . . .426
16.3.5Capture/compare channels . . . . .429
16.3.6Input capture mode . . . . .432
16.3.7PWM input mode . . . . .433
16.3.8Forced output mode . . . . .433
16.3.9Output compare mode . . . . .434
16.3.10PWM mode . . . . .435
16.3.11Complementary outputs and dead-time insertion . . . . .438
16.3.12Using the break function . . . . .440
16.3.13Clearing the OCxREF signal on an external event . . . . .443
16.3.146-step PWM generation . . . . .444
16.3.15One-pulse mode . . . . .445
16.3.16Encoder interface mode . . . . .446
16.3.17Timer input XOR function . . . . .449
16.3.18Interfacing with Hall sensors . . . . .449
16.3.19TIMx and external trigger synchronization . . . . .451
16.3.20Timer synchronization . . . . .454
16.3.21Debug mode . . . . .454
16.4TIM1&TIM8 registers . . . . .455
16.4.1TIM1&TIM8 control register 1 (TIMx_CR1) . . . . .455
16.4.2TIM1&TIM8 control register 2 (TIMx_CR2) . . . . .456
16.4.3TIM1&TIM8 slave mode control register (TIMx_SMCR) . . . . .458
16.4.4TIM1&TIM8 DMA/interrupt enable register (TIMx_DIER) . . . . .460
16.4.5TIM1&TIM8 status register (TIMx_SR) . . . . .462
16.4.6TIM1&TIM8 event generation register (TIMx_EGR) . . . . .463
16.4.7TIM1&TIM8 capture/compare mode register 1 (TIMx_CCMR1) . . . . .464
16.4.8TIM1&TIM8 capture/compare mode register 2 (TIMx_CCMR2) . . . . .467
16.4.9TIM1&TIM8 capture/compare enable register (TIMx_CCER) . . . . .469
16.4.10TIM1&TIM8 counter (TIMx_CNT) . . . . .473
16.4.11TIM1&TIM8 prescaler (TIMx_PSC) . . . . .473
16.4.12TIM1&TIM8 auto-reload register (TIMx_ARR) . . . . .473
16.4.13TIM1&TIM8 repetition counter register (TIMx_RCR) . . . . .473
16.4.14TIM1&TIM8 capture/compare register 1 (TIMx_CCR1) . . . . .474
16.4.15TIM1&TIM8 capture/compare register 2 (TIMx_CCR2) . . . . .474
16.4.16TIM1&TIM8 capture/compare register 3 (TIMx_CCR3) . . . . .475
16.4.17TIM1&TIM8 capture/compare register 4 (TIMx_CCR4) . . . . .475
16.4.18TIM1&TIM8 break and dead-time register (TIMx_BDTR) . . . . .475
16.4.19TIM1&TIM8 DMA control register (TIMx_DCR) . . . . .477
16.4.20TIM1&TIM8 DMA address for full transfer (TIMx_DMAR) . . . . .478
16.4.21TIM1&TIM8 register map . . . . .479
17General-purpose timers (TIM2 to TIM5) . . . . .481
17.1TIM2 to TIM5 introduction . . . . .481
17.2TIM2 to TIM5 main features . . . . .481
17.3TIM2 to TIM5 functional description . . . . .482
17.3.1Time-base unit . . . . .482
17.3.2Counter modes . . . . .484
17.3.3Clock selection . . . . .493
17.3.4Capture/compare channels . . . . .496
17.3.5Input capture mode . . . . .498
17.3.6PWM input mode . . . . .499
17.3.7Forced output mode . . . . .500
17.3.8Output compare mode . . . . .500
17.3.9PWM mode . . . . .502
17.3.10One-pulse mode . . . . .505
17.3.11Clearing the OCxREF signal on an external event . . . . .506
17.3.12Encoder interface mode . . . . .507
17.3.13Timer input XOR function . . . . .509
17.3.14Timers and external trigger synchronization . . . . .509
17.3.15Timer synchronization . . . . .513
17.3.16Debug mode . . . . .518
17.4TIM2 to TIM5 registers . . . . .519
17.4.1TIMx control register 1 (TIMx_CR1) . . . . .519
17.4.2TIMx control register 2 (TIMx_CR2) . . . . .521
17.4.3TIMx slave mode control register (TIMx_SMCR) . . . . .522
17.4.4TIMx DMA/Interrupt enable register (TIMx_DIER) . . . . .524
17.4.5TIMx status register (TIMx_SR) . . . . .525
17.4.6TIMx event generation register (TIMx_EGR) . . . . .527
17.4.7TIMx capture/compare mode register 1 (TIMx_CCMR1) . . . . .528
17.4.8TIMx capture/compare mode register 2 (TIMx_CCMR2) . . . . .531
17.4.9TIMx capture/compare enable register (TIMx_CCER) . . . . .532
17.4.10TIMx counter (TIMx_CNT) . . . . .534
17.4.11TIMx prescaler (TIMx_PSC) . . . . .534
17.4.12TIMx auto-reload register (TIMx_ARR) . . . . .534
17.4.13TIMx capture/compare register 1 (TIMx_CCR1) . . . . .535
17.4.14TIMx capture/compare register 2 (TIMx_CCR2) . . . . .535
17.4.15TIMx capture/compare register 3 (TIMx_CCR3) . . . . .536
17.4.16TIMx capture/compare register 4 (TIMx_CCR4) . . . . .536
17.4.17TIMx DMA control register (TIMx_DCR) . . . . .537
17.4.18TIMx DMA address for full transfer (TIMx_DMAR) . . . . .537
17.4.19TIM2 option register (TIM2_OR) . . . . .538
17.4.20TIM5 option register (TIM5_OR) . . . . .539
17.4.21TIMx register map . . . . .540
18General-purpose timers (TIM9 to TIM14) . . . . .542
18.1TIM9 to TIM14 introduction . . . . .542
18.2TIM9 to TIM14 main features . . . . .542
18.2.1TIM9/TIM12 main features . . . . .542
18.2.2TIM10/TIM11 and TIM13/TIM14 main features . . . . .543
18.3TIM9 to TIM14 functional description . . . . .545
18.3.1Time-base unit . . . . .545
18.3.2Counter modes . . . . .547
18.3.3Clock selection . . . . .550
18.3.4Capture/compare channels . . . . .552
18.3.5Input capture mode . . . . .553
18.3.6PWM input mode (only for TIM9/12) . . . . .554
18.3.7Forced output mode . . . . .555
18.3.8Output compare mode . . . . .556
18.3.9PWM mode . . . . .557
18.3.10One-pulse mode . . . . .558
18.3.11TIM9/12 external trigger synchronization . . . . .560
18.3.12Timer synchronization (TIM9/12) . . . . .563
18.3.13Debug mode . . . . .563
18.4TIM9 and TIM12 registers . . . . .563
18.4.1TIM9/12 control register 1 (TIMx_CR1) . . . . .563
18.4.2TIM9/12 slave mode control register (TIMx_SMCR) . . . . .565
18.4.3TIM9/12 Interrupt enable register (TIMx_DIER) . . . . .566
18.4.4TIM9/12 status register (TIMx_SR) . . . . .567
18.4.5TIM9/12 event generation register (TIMx_EGR) . . . . .569
18.4.6TIM9/12 capture/compare mode register 1 (TIMx_CCMR1) . . . . .569
18.4.7TIM9/12 capture/compare enable register (TIMx_CCER) . . . . .573
18.4.8TIM9/12 counter (TIMx_CNT) . . . . .574
18.4.9TIM9/12 prescaler (TIMx_PSC) . . . . .574
18.4.10TIM9/12 auto-reload register (TIMx_ARR) . . . . .574
18.4.11TIM9/12 capture/compare register 1 (TIMx_CCR1) . . . . .575
18.4.12TIM9/12 capture/compare register 2 (TIMx_CCR2) . . . . .575
18.4.13TIM9/12 register map . . . . .576
18.5TIM10/11/13/14 registers . . . . .578
18.5.1TIM10/11/13/14 control register 1 (TIMx_CR1) . . . . .578
18.5.2TIM10/11/13/14 Interrupt enable register (TIMx_DIER) . . . . .579
18.5.3TIM10/11/13/14 status register (TIMx_SR) . . . . .579
18.5.4TIM10/11/13/14 event generation register (TIMx_EGR) . . . . .580
18.5.5TIM10/11/13/14 capture/compare mode register 1
(TIMx_CCMR1) . . . . .
581
18.5.6TIM10/11/13/14 capture/compare enable register
(TIMx_CCER) . . . . .
584
18.5.7TIM10/11/13/14 counter (TIMx_CNT) . . . . .585
18.5.8TIM10/11/13/14 prescaler (TIMx_PSC) . . . . .585
18.5.9TIM10/11/13/14 auto-reload register (TIMx_ARR) . . . . .585
18.5.10TIM10/11/13/14 capture/compare register 1 (TIMx_CCR1) . . . . .586
18.5.11TIM11 option register 1 (TIM11_OR) . . . . .586
18.5.12TIM10/11/13/14 register map . . . . .587
19Basic timers (TIM6/7) . . . . .589
19.1Introduction . . . . .589
19.2TIM6/7 main features . . . . .589
19.3TIM6/7 functional description . . . . .590
19.3.1Time-base unit . . . . .590
19.3.2Counting mode . . . . .592
19.3.3Clock source . . . . .595
19.3.4Debug mode . . . . .596
19.4TIM6/7 registers . . . . .597
19.4.1TIM6/7 control register 1 (TIMx_CR1) . . . . .597
19.4.2TIM6/7 control register 2 (TIMx_CR2) . . . . .598
19.4.3TIM6/7 DMA/Interrupt enable register (TIMx_DIER) . . . . .598
19.4.4TIM6/7 status register (TIMx_SR) . . . . .599
19.4.5TIM6/7 event generation register (TIMx_EGR) . . . . .599
22.3.2Real-time clock and calendar . . . . .617
22.3.3Programmable alarms . . . . .618
22.3.4Periodic auto-wakeup . . . . .618
22.3.5RTC initialization and configuration . . . . .619
22.3.6Reading the calendar . . . . .621
22.3.7Resetting the RTC . . . . .622
22.3.8RTC synchronization . . . . .622
22.3.9RTC reference clock detection . . . . .623
22.3.10RTC coarse digital calibration . . . . .623
22.3.11RTC smooth digital calibration . . . . .624
22.3.12Timestamp function . . . . .626
22.3.13Tamper detection . . . . .627
22.3.14Calibration clock output . . . . .628
22.3.15Alarm output . . . . .629
22.4RTC and low power modes . . . . .629
22.5RTC interrupts . . . . .630
22.6RTC registers . . . . .631
22.6.1RTC time register (RTC_TR) . . . . .631
22.6.2RTC date register (RTC_DR) . . . . .632
22.6.3RTC control register (RTC_CR) . . . . .633
22.6.4RTC initialization and status register (RTC_ISR) . . . . .635
22.6.5RTC prescaler register (RTC_PRER) . . . . .637
22.6.6RTC wakeup timer register (RTC_WUTR) . . . . .638
22.6.7RTC calibration register (RTC_CALIBR) . . . . .639
22.6.8RTC alarm A register (RTC_ALRMAR) . . . . .640
22.6.9RTC alarm B register (RTC_ALRMBR) . . . . .641
22.6.10RTC write protection register (RTC_WPR) . . . . .642
22.6.11RTC sub second register (RTC_SSR) . . . . .642
22.6.12RTC shift control register (RTC_SHIFT) . . . . .643
22.6.13RTC time stamp time register (RTC_TSTR) . . . . .644
22.6.14RTC time stamp date register (RTC_TSDR) . . . . .644
22.6.15RTC timestamp sub second register (RTC_TSSSR) . . . . .645
22.6.16RTC calibration register (RTC_CALR) . . . . .645
22.6.17RTC tamper and alternate function configuration register
(RTC_TAFCR) . . . . .
646
22.6.18RTC alarm A sub second register (RTC_ALRMASSR) . . . . .648
22.6.19RTC alarm B sub second register (RTC_ALRMBSSR) . . . . .649
22.6.20RTC backup registers (RTC_BKPxR) . . . . .650
22.6.21RTC register map . . . . .650
23Fast-mode Plus Inter-integrated circuit interface (FMPI2C) . . . . .653
23.1Introduction . . . . .653
23.2FMPI2C main features . . . . .653
23.3FMPI2C implementation . . . . .654
23.4FMPI2C functional description . . . . .654
23.4.1FMPI2C block diagram . . . . .655
23.4.2FMPI2C pins and internal signals . . . . .655
23.4.3FMPI2C clock requirements . . . . .656
23.4.4FMPI2C mode selection . . . . .656
23.4.5FMPI2C initialization . . . . .657
23.4.6FMPI2C reset . . . . .661
23.4.7FMPI2C data transfer . . . . .662
23.4.8FMPI2C target mode . . . . .664
23.4.9FMPI2C controller mode . . . . .673
23.4.10FMPI2C_TIMINGR register configuration examples . . . . .684
23.4.11SMBus specific features . . . . .686
23.4.12SMBus initialization . . . . .688
23.4.13SMBus FMPI2C_TIMEOUTR register configuration examples . . . . .690
23.4.14SMBus target mode . . . . .691
23.4.15SMBus controller mode . . . . .694
23.4.16Error conditions . . . . .697
23.5FMPI2C in low-power modes . . . . .699
23.6FMPI2C interrupts . . . . .699
23.7FMPI2C DMA requests . . . . .700
23.7.1Transmission using DMA . . . . .700
23.7.2Reception using DMA . . . . .700
23.8FMPI2C debug modes . . . . .701
23.9FMPI2C registers . . . . .701
23.9.1FMPI2C control register 1 (FMPI2C_CR1) . . . . .701
23.9.2FMPI2C control register 2 (FMPI2C_CR2) . . . . .704
23.9.3FMPI2C own address 1 register (FMPI2C_OAR1) . . . . .706
23.9.4FMPI2C own address 2 register (FMPI2C_OAR2) . . . . .706
23.9.5FMPI2C timing register (FMPI2C_TIMINGR) . . . . .707
23.9.6FMPI2C timeout register (FMPI2C_TIMEOUTR) . . . . .708
23.9.7FMPI2C interrupt and status register (FMPI2C_ISR) . . . . .709
23.9.8FMPI2C interrupt clear register (FMPI2C_ICR) . . . . .712
23.9.9FMPI2C PEC register (FMPI2C_PECR) . . . . .713
23.9.10FMPI2C receive data register (FMPI2C_RXDR) . . . . .713
23.9.11FMPI2C transmit data register (FMPI2C_TXDR) . . . . .714
23.9.12FMPI2C register map . . . . .715
24Inter-integrated circuit (I 2 C) interface . . . . .716
24.1I 2 C introduction . . . . .716
24.2I 2 C main features . . . . .717
24.3I 2 C functional description . . . . .718
24.3.1Mode selection . . . . .718
24.3.2I2C target mode . . . . .719
24.3.3I2C controller mode . . . . .721
24.3.4Error conditions . . . . .726
24.3.5Programmable noise filter . . . . .727
24.3.6SDA/SCL line control . . . . .728
24.3.7SMBus . . . . .728
24.3.8DMA requests . . . . .730
24.3.9Packet error checking . . . . .732
24.4I 2 C interrupts . . . . .733
24.5I 2 C debug mode . . . . .734
24.6I 2 C registers . . . . .735
24.6.1I 2 C control register 1 (I2C_CR1) . . . . .735
24.6.2I 2 C control register 2 (I2C_CR2) . . . . .737
24.6.3I 2 C own address register 1 (I2C_OAR1) . . . . .738
24.6.4I 2 C own address register 2 (I2C_OAR2) . . . . .739
24.6.5I 2 C data register (I2C_DR) . . . . .739
24.6.6I 2 C status register 1 (I2C_SR1) . . . . .739
24.6.7I 2 C status register 2 (I2C_SR2) . . . . .742
24.6.8I 2 C clock control register (I2C_CCR) . . . . .743
24.6.9I 2 C TRISE register (I2C_TRISE) . . . . .744
24.6.10I 2 C FLTR register (I2C_FLTR) . . . . .745
24.6.11I2C register map . . . . .746

25 Universal synchronous receiver transmitter (USART)
/universal asynchronous receiver transmitter (UART) . . . . . 747

25.1 USART introduction . . . . . 747

25.2 USART main features . . . . . 748

25.3 USART implementation . . . . . 749

25.4 USART functional description . . . . . 749

25.4.1 USART character description . . . . . 752

25.4.2 Transmitter . . . . . 753

25.4.3 Receiver . . . . . 756

25.4.4 Fractional baud rate generation . . . . . 761

25.4.5 USART receiver tolerance to clock deviation . . . . . 771

25.4.6 Multiprocessor communication . . . . . 772

25.4.7 Parity control . . . . . 774

25.4.8 LIN (local interconnection network) mode . . . . . 775

25.4.9 USART synchronous mode . . . . . 777

25.4.10 Single-wire half-duplex communication . . . . . 779

25.4.11 Smartcard . . . . . 780

25.4.12 IrDA SIR ENDEC block . . . . . 782

25.4.13 Continuous communication using DMA . . . . . 784

25.4.14 Hardware flow control . . . . . 786

25.5 USART interrupts . . . . . 788

25.6 USART registers . . . . . 789

25.6.1 Status register (USART_SR) . . . . . 789

25.6.2 Data register (USART_DR) . . . . . 792

25.6.3 Baud rate register (USART_BRR) . . . . . 792

25.6.4 Control register 1 (USART_CR1) . . . . . 793

25.6.5 Control register 2 (USART_CR2) . . . . . 795

25.6.6 Control register 3 (USART_CR3) . . . . . 796

25.6.7 Guard time and prescaler register (USART_GTPR) . . . . . 798

25.6.8 USART register map . . . . . 799

26 Serial peripheral interface/ inter-IC sound (SPI/I2S) . . . . . 800

26.1 Introduction . . . . . 800

26.1.1 SPI main features . . . . . 801

26.1.2 SPI extended features . . . . . 802

26.1.3 I2S features . . . . . 802

26.2SPI/I2S implementation . . . . .802
26.3SPI functional description . . . . .803
26.3.1General description . . . . .803
26.3.2Communications between one master and one slave . . . . .804
26.3.3Standard multislave communication . . . . .807
26.3.4Multimaster communication . . . . .808
26.3.5Slave select (NSS) pin management . . . . .808
26.3.6Communication formats . . . . .810
26.3.7SPI configuration . . . . .812
26.3.8Procedure for enabling SPI . . . . .812
26.3.9Data transmission and reception procedures . . . . .813
26.3.10Procedure for disabling the SPI . . . . .815
26.3.11Communication using DMA (direct memory addressing) . . . . .816
26.3.12SPI status flags . . . . .818
26.3.13SPI error flags . . . . .819
26.4SPI special features . . . . .820
26.4.1TI mode . . . . .820
26.4.2CRC calculation . . . . .821
26.5SPI interrupts . . . . .823
26.6I 2 S functional description . . . . .824
26.6.1I 2 S general description . . . . .824
26.6.2I2S full-duplex . . . . .825
26.6.3Supported audio protocols . . . . .826
26.6.4Clock generator . . . . .832
26.6.5I 2 S master mode . . . . .835
26.6.6I 2 S slave mode . . . . .837
26.6.7I 2 S status flags . . . . .838
26.6.8I 2 S error flags . . . . .839
26.6.9I 2 S interrupts . . . . .840
26.6.10DMA features . . . . .840
26.7SPI and I 2 S registers . . . . .841
26.7.1SPI control register 1 (SPI_CR1) (not used in I 2 S mode) . . . . .841
26.7.2SPI control register 2 (SPI_CR2) . . . . .843
26.7.3SPI status register (SPI_SR) . . . . .844
26.7.4SPI data register (SPI_DR) . . . . .846
26.7.5SPI CRC polynomial register (SPI_CRCPR) (not used in I 2 S mode) . . . . .846
26.7.6SPI RX CRC register (SPI_RXCRCR) (not used in I 2 S mode) . . . . .847
26.7.7SPI TX CRC register (SPI_TXCRCR) (not used in I 2 S mode) . . . . .847
26.7.8SPI_I 2 S configuration register (SPI_I2SCFGR) . . . . .848
26.7.9SPI_I 2 S prescaler register (SPI_I2SPR) . . . . .849
26.7.10SPI register map . . . . .851
27Secure digital input/output interface (SDIO) . . . . .852
27.1SDIO main features . . . . .852
27.2SDIO bus topology . . . . .852
27.3SDIO functional description . . . . .854
27.3.1SDIO adapter . . . . .856
27.3.2SDIO APB2 interface . . . . .867
27.4Card functional description . . . . .868
27.4.1Card identification mode . . . . .868
27.4.2Card reset . . . . .869
27.4.3Operating voltage range validation . . . . .869
27.4.4Card identification process . . . . .869
27.4.5Block write . . . . .870
27.4.6Block read . . . . .871
27.4.7Stream access, stream write and stream read
(MultiMediaCard only) . . . . .
871
27.4.8Erase: group erase and sector erase . . . . .873
27.4.9Wide bus selection or deselection . . . . .873
27.4.10Protection management . . . . .873
27.4.11Card status register . . . . .877
27.4.12SD status register . . . . .880
27.4.13SD I/O mode . . . . .884
27.4.14Commands and responses . . . . .885
27.5Response formats . . . . .888
27.5.1R1 (normal response command) . . . . .889
27.5.2R1b . . . . .889
27.5.3R2 (CID, CSD register) . . . . .889
27.5.4R3 (OCR register) . . . . .890
27.5.5R4 (Fast I/O) . . . . .890
27.5.6R4b . . . . .890
27.5.7R5 (interrupt request) . . . . .891
27.5.8R6 . . . . .891
27.6SDIO I/O card-specific operations . . . . .892
27.6.1SDIO I/O read wait operation by SDIO_D2 signalling . . . . .892
27.6.2SDIO read wait operation by stopping SDIO_CK . . . . .893
27.6.3SDIO suspend/resume operation . . . . .893
27.6.4SDIO interrupts . . . . .893
27.7HW flow control . . . . .893
27.8SDIO registers . . . . .894
27.8.1SDIO power control register (SDIO_POWER) . . . . .894
27.8.2SDIO clock control register (SDIO_CLKCR) . . . . .894
27.8.3SDIO argument register (SDIO_ARG) . . . . .896
27.8.4SDIO command register (SDIO_CMD) . . . . .896
27.8.5SDIO command response register (SDIO_RESPCMD) . . . . .897
27.8.6SDIO response 1..4 register (SDIO_RESPx) . . . . .897
27.8.7SDIO data timer register (SDIO_DTIMER) . . . . .898
27.8.8SDIO data length register (SDIO_DLEN) . . . . .899
27.8.9SDIO data control register (SDIO_DCTRL) . . . . .899
27.8.10SDIO data counter register (SDIO_DCOUNT) . . . . .902
27.8.11SDIO status register (SDIO_STA) . . . . .902
27.8.12SDIO interrupt clear register (SDIO_ICR) . . . . .903
27.8.13SDIO mask register (SDIO_MASK) . . . . .905
27.8.14SDIO FIFO counter register (SDIO_FIFOCNT) . . . . .907
27.8.15SDIO data FIFO register (SDIO_FIFO) . . . . .908
27.8.16SDIO register map . . . . .909
28Controller area network (bxCAN) . . . . .911
28.1Introduction . . . . .911
28.2bxCAN main features . . . . .911
28.3bxCAN general description . . . . .912
28.3.1CAN 2.0B active core . . . . .912
28.3.2Control, status, and configuration registers . . . . .912
28.3.3Tx mailboxes . . . . .912
28.3.4Acceptance filters . . . . .913
28.4bxCAN operating modes . . . . .914
28.4.1Initialization mode . . . . .914
28.4.2Normal mode . . . . .914
28.4.3Sleep mode (low-power) . . . . .915
29.5.1ID line detection . . . . .961
29.5.2HNP dual role device . . . . .962
29.5.3SRP dual role device . . . . .962
29.6OTG_FS as a USB peripheral . . . . .962
29.6.1SRP-capable peripheral . . . . .963
29.6.2Peripheral states . . . . .963
29.6.3Peripheral endpoints . . . . .964
29.7OTG_FS as a USB host . . . . .966
29.7.1SRP-capable host . . . . .967
29.7.2USB host states . . . . .967
29.7.3Host channels . . . . .969
29.7.4Host scheduler . . . . .970
29.8OTG_FS SOF trigger . . . . .971
29.8.1Host SOFs . . . . .971
29.8.2Peripheral SOFs . . . . .971
29.9OTG_FS low-power modes . . . . .972
29.10OTG_FS Dynamic update of the OTG_HFIR register . . . . .973
29.11OTG_FS data FIFOs . . . . .973
29.11.1Peripheral FIFO architecture . . . . .974
29.11.2Host FIFO architecture . . . . .975
29.11.3FIFO RAM allocation . . . . .976
29.12OTG_FS system performance . . . . .978
29.13OTG_FS interrupts . . . . .978
29.14OTG_FS control and status registers . . . . .980
29.14.1CSR memory map . . . . .980
29.15OTG_FS registers . . . . .984
29.15.1OTG control and status register (OTG_GOTGCTL) . . . . .985
29.15.2OTG interrupt register (OTG_GOTGINT) . . . . .988
29.15.3OTG AHB configuration register (OTG_GAHBCFG) . . . . .989
29.15.4OTG USB configuration register (OTG_GUSBCFG) . . . . .990
29.15.5OTG reset register (OTG_GRSTCTL) . . . . .992
29.15.6OTG core interrupt register (OTG_GINTSTS) . . . . .994
29.15.7OTG interrupt mask register (OTG_GINTMSK) . . . . .998
29.15.8OTG receive status debug read register (OTG_GRXSTSR) . . . . .1001
29.15.9OTG receive status debug read [alternate] (OTG_GRXSTSR) . . . . .1002
29.15.10OTG status read and pop registers (OTG_GRXSTSP) . . . . .1003
29.15.11OTG status read and pop registers [alternate] (OTG_GRXSTSP) . . .1004
29.15.12OTG receive FIFO size register (OTG_GRXFSIZ) . . . . .1005
29.15.13OTG host non-periodic transmit FIFO size register
(OTG_HNPTXFSIZ)/Endpoint 0 Transmit FIFO size
(OTG_DIEPTXF0) . . . . .
1005
29.15.14OTG non-periodic transmit FIFO/queue status register
(OTG_HNPTXSTS) . . . . .
1006
29.15.15OTG general core configuration register (OTG_GCCFG) . . . . .1007
29.15.16OTG core ID register (OTG_CID) . . . . .1009
29.15.17OTG core LPM configuration register (OTG_GLPMCFG) . . . . .1009
29.15.18OTG host periodic transmit FIFO size register
(OTG_HPTXFSIZ) . . . . .
1013
29.15.19OTG device IN endpoint transmit FIFO x size register
(OTG_DIEPTXFx) . . . . .
1013
29.15.20Host-mode registers . . . . .1014
29.15.21OTG host configuration register (OTG_HCFG) . . . . .1014
29.15.22OTG host frame interval register (OTG_HFIR) . . . . .1015
29.15.23OTG host frame number/frame time remaining register
(OTG_HFNUM) . . . . .
1016
29.15.24OTG_Host periodic transmit FIFO/queue status register
(OTG_HPTXSTS) . . . . .
1016
29.15.25OTG host all channels interrupt register (OTG_HAINT) . . . . .1017
29.15.26OTG host all channels interrupt mask register
(OTG_HAINTMSK) . . . . .
1018
29.15.27OTG host port control and status register (OTG_HPRT) . . . . .1019
29.15.28OTG host channel x characteristics register (OTG_HCCHARx) . . . . .1021
29.15.29OTG host channel x interrupt register (OTG_HCINTx) . . . . .1022
29.15.30OTG host channel x interrupt mask register (OTG_HCINTMSKx) . . . . .1023
29.15.31OTG host channel x transfer size register (OTG_HCTSIZx) . . . . .1024
29.15.32Device-mode registers . . . . .1025
29.15.33OTG device configuration register (OTG_DCFG) . . . . .1025
29.15.34OTG device control register (OTG_DCTL) . . . . .1026
29.15.35OTG device status register (OTG_DSTS) . . . . .1029
29.15.36OTG device IN endpoint common interrupt mask register
(OTG_DIEPMSK) . . . . .
1030
29.15.37OTG device OUT endpoint common interrupt mask register
(OTG_DOEPMSK) . . . . .
1031
29.15.38OTG device all endpoints interrupt register (OTG_DAINT) . . . . .1032
29.15.39OTG all endpoints interrupt mask register
(OTG_DaintMSK) . . . . .
1033
29.15.40OTG device V BUS discharge time register (OTG_DVBUSDIS) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
30.4Pinout and debug port pins . . . . .1113
30.4.1SWJ debug port pins . . . . .1114
30.4.2Flexible SWJ-DP pin assignment . . . . .1114
30.4.3Internal pull-up and pull-down on JTAG pins . . . . .1114
30.4.4Using serial wire and releasing the unused debug pins as GPIOs . . . . .1116
30.5JTAG TAP connection . . . . .1116
30.6ID codes and locking mechanism . . . . .1118
30.6.1MCU device ID code . . . . .1118
30.6.2Boundary scan TAP . . . . .1118
30.6.3Cortex ® -M4 with FPU TAP . . . . .1118
30.6.4Cortex ® -M4 with FPU JEDEC-106 ID code . . . . .1119
30.7JTAG debug port . . . . .1119
30.8SW debug port . . . . .1121
30.8.1SW protocol introduction . . . . .1121
30.8.2SW protocol sequence . . . . .1121
30.8.3SW-DP state machine (reset, idle states, ID code) . . . . .1122
30.8.4DP and AP read/write accesses . . . . .1122
30.8.5SW-DP registers . . . . .1123
30.8.6SW-AP registers . . . . .1124
30.9AHB-AP (AHB access port) - valid for both JTAG-DP
and SW-DP . . . . .
1124
30.10Core debug . . . . .1125
30.11Capability of the debugger host to connect under system reset . . . . .1126
30.12FPB (flash patch breakpoint) . . . . .1126
30.13DWT (data watchpoint trigger) . . . . .1127
30.14ITM (instrumentation trace macrocell) . . . . .1127
30.14.1General description . . . . .1127
30.14.2Time stamp packets, synchronization and overflow packets . . . . .1127
30.15ETM (Embedded trace macrocell) . . . . .1129
30.15.1General description . . . . .1129
30.15.2Signal protocol, packet types . . . . .1129
30.15.3Main ETM registers . . . . .1129
30.15.4Configuration example . . . . .1130
30.16MCU debug component (DBGMCU) . . . . .1130
30.16.1Debug support for low-power modes . . . . .1130
30.16.2Debug support for timers, watchdog, bxCAN and I 2 C . . . . .1131
30.16.3Debug MCU configuration register . . . . .1131
30.16.4Debug MCU APB1 freeze register (DBGMCU_APB1_FZ) . . . . .1132
30.16.5Debug MCU APB2 Freeze register (DBGMCU_APB2_FZ) . . . . .1134
30.17TPIU (trace port interface unit) . . . . .1134
30.17.1Introduction . . . . .1134
30.17.2TRACE pin assignment . . . . .1136
30.17.3TPUI formatter . . . . .1137
30.17.4TPUI frame synchronization packets . . . . .1138
30.17.5Transmission of the synchronization frame packet . . . . .1138
30.17.6Synchronous mode . . . . .1138
30.17.7Asynchronous mode . . . . .1139
30.17.8TRACECLKIN connection . . . . .1139
30.17.9TPIU registers . . . . .1139
30.17.10Example of configuration . . . . .1140
30.18DBG register map . . . . .1141
31Device electronic signature . . . . .1142
31.1Unique device ID register (96 bits) . . . . .1142
31.2Flash size . . . . .1143
31.3Package data register . . . . .1143
32Important security notice . . . . .1145
33Revision history . . . . .1146

List of tables

Table 1.Register boundary addresses . . . . .51
Table 2.Boot modes . . . . .55
Table 3.Embedded bootloader interfaces . . . . .56
Table 4.Memory mapping vs. Boot mode/physical remap in STM32F412xx. . . . .56
Table 5.Flash module organization . . . . .59
Table 6.Number of wait states according to CPU clock (HCLK) frequency. . . . .60
Table 7.Maximum program/erase parallelism . . . . .64
Table 8.Flash interrupt request . . . . .66
Table 9.Option byte organization. . . . .66
Table 10.Description of the option bytes . . . . .67
Table 11.Access versus read protection level . . . . .70
Table 12.OTP area organization . . . . .73
Table 13.Flash register map and reset values. . . . .81
Table 14.CRC calculation unit register map and reset values. . . . .85
Table 15.Low-power mode summary . . . . .94
Table 16.Sleep-now entry and exit . . . . .95
Table 17.Sleep-on-exit entry and exit . . . . .95
Table 18.BAM-now entry and exit . . . . .96
Table 19.BAM-on-exit entry and exit . . . . .97
Table 20.Stop operating modes. . . . .98
Table 21.Stop mode entry and exit . . . . .99
Table 22.Standby mode entry and exit . . . . .101
Table 23.PWR - register map and reset values. . . . .108
Table 24.RCC register map and reset values for STM32F412xx . . . . .165
Table 25.Port bit configuration table . . . . .169
Table 26.Flexible SWJ-DP pin assignment . . . . .172
Table 27.RTC additional functions. . . . .179
Table 28.GPIO register map and reset values . . . . .185
Table 29.SYSCFG register map and reset values. . . . .195
Table 30.DMA1 request mapping . . . . .200
Table 31.DMA2 request mapping . . . . .200
Table 32.Source and destination address . . . . .201
Table 33.Source and destination address registers in double-buffer mode (DBM = 1). . . . .207
Table 34.Packing/unpacking and endian behavior (bit PINC = MINC = 1) . . . . .208
Table 35.Restriction on NDT versus PSIZE and MSIZE . . . . .208
Table 36.FIFO threshold configurations . . . . .211
Table 37.Possible DMA configurations . . . . .215
Table 38.DMA interrupt requests. . . . .217
Table 39.DMA register map and reset values . . . . .227
Table 40.Vector table for STM32F412xx . . . . .232
Table 41.External interrupt/event controller register map and reset values. . . . .245
Table 42.NOR/PSRAM bank selection . . . . .249
Table 43.NOR/PSRAM External memory address . . . . .249
Table 44.Programmable NOR/PSRAM access parameters . . . . .251
Table 45.Non-multiplexed I/O NOR flash memory. . . . .251
Table 46.16-bit multiplexed I/O NOR flash memory . . . . .252
Table 47.Non-multiplexed I/Os PSRAM/SRAM . . . . .252
Table 48.16-Bit multiplexed I/O PSRAM . . . . .252
Table 49.NOR flash/PSRAM: example of supported memories and transactions . . . . .253
Table 50.FSMC_BCRx bitfields (mode 1) . . . . .256
Table 51.FSMC_BTRx bitfields (mode 1) . . . . .257
Table 52.FSMC_BCRx bitfields (mode A) . . . . .259
Table 53.FSMC_BTRx bitfields (mode A) . . . . .259
Table 54.FSMC_BWTRx bitfields (mode A) . . . . .260
Table 55.FSMC_BCRx bitfields (mode 2/B) . . . . .262
Table 56.FSMC_BTRx bitfields (mode 2/B) . . . . .262
Table 57.FSMC_BWTRx bitfields (mode 2/B) . . . . .263
Table 58.FSMC_BCRx bitfields (mode C) . . . . .264
Table 59.FSMC_BTRx bitfields (mode C) . . . . .265
Table 60.FSMC_BWTRx bitfields (mode C) . . . . .265
Table 61.FSMC_BCRx bitfields (mode D) . . . . .267
Table 62.FSMC_BTRx bitfields (mode D) . . . . .267
Table 63.FSMC_BWTRx bitfields (mode D) . . . . .268
Table 64.FSMC_BCRx bitfields (Muxed mode) . . . . .269
Table 65.FSMC_BTRx bitfields (Muxed mode) . . . . .270
Table 66.FSMC_BCRx bitfields (Synchronous multiplexed read mode) . . . . .275
Table 67.FSMC_BTRx bitfields (Synchronous multiplexed read mode) . . . . .276
Table 68.FSMC_BCRx bitfields (Synchronous multiplexed write mode) . . . . .277
Table 69.FSMC_BTRx bitfields (Synchronous multiplexed write mode) . . . . .278
Table 70.FSMC register map and reset values . . . . .286
Table 71.QUADSPI pins . . . . .289
Table 72.QUADSPI interrupt requests . . . . .303
Table 73.QUADSPI register map and reset values . . . . .314
Table 74.ADC pins . . . . .318
Table 75.Analog watchdog channel selection . . . . .321
Table 76.Configuring the trigger polarity . . . . .325
Table 77.External trigger for regular channels . . . . .325
Table 78.External trigger for injected channels . . . . .326
Table 79.ADC interrupts . . . . .330
Table 80.ADC global register map . . . . .344
Table 81.ADC register map and reset values . . . . .344
Table 82.ADC register map and reset values (common ADC registers) . . . . .345
Table 83.DFSDM1 implementation . . . . .348
Table 84.DFSDM external pins . . . . .350
Table 85.DFSDM internal signals . . . . .350
Table 86.DFSDM triggers connection . . . . .350
Table 87.DFSDM break connection . . . . .351
Table 88.Filter maximum output resolution (peak data values from filter output) for some FOSR values . . . . .366
Table 89.Integrator maximum output resolution (peak data values from integrator output) for some IOSR values and FOSR = 256 and Sinc3 filter type (largest data) . . . . .366
Table 90.DFSDM interrupt requests . . . . .374
Table 91.DFSDM register map and reset values . . . . .395
Table 92.RNG internal input/output signals . . . . .401
Table 93.RNG interrupt requests . . . . .406
Table 94.RNG configurations . . . . .407
Table 95.RNG register map and reset map . . . . .410
Table 96.Counting direction versus encoder signals . . . . .447
Table 97.TIMx Internal trigger connection . . . . .460
Table 98.Output control bits for complementary OCx and OCxN channels with break feature . . . . .472
Table 99.TIM1&TIM8 register map and reset values. . . . .479
Table 100.Counting direction versus encoder signals . . . . .508
Table 101.TIMx internal trigger connections . . . . .523
Table 102.Output control bit for standard OCx channels. . . . .533
Table 103.TIM2 to TIM5 register map and reset values . . . . .540
Table 104.TIMx internal trigger connections . . . . .566
Table 105.Output control bit for standard OCx channels. . . . .574
Table 106.TIM9/12 register map and reset values . . . . .576
Table 107.Output control bit for standard OCx channels. . . . .584
Table 108.TIM10/11/13/14 register map and reset values . . . . .587
Table 109.TIM6/7 register map and reset values . . . . .601
Table 110.Min/max IWDG timeout periods (ms) at 32 kHz (LSI). . . . .603
Table 111.IWDG register map and reset values . . . . .607
Table 112.WWDG register map and reset values . . . . .614
Table 113.Effect of low power modes on RTC . . . . .629
Table 114.Interrupt control bits . . . . .630
Table 115.RTC register map and reset values . . . . .650
Table 116.FMPI2C implementation . . . . .654
Table 117.FMPI2C input/output pins . . . . .655
Table 118.FMPI2C internal input/output signals . . . . .655
Table 119.Comparison of analog and digital filters . . . . .658
Table 120.I 2 C-bus and SMBus specification data setup and hold times . . . . .660
Table 121.FMPI2C configuration . . . . .664
Table 122.I 2 C-bus and SMBus specification clock timings . . . . .675
Table 123.Timing settings for f I2CCLK of 8 MHz. . . . .685
Table 124.Timing settings for f I2CCLK of 16 MHz. . . . .685
Table 125.SMBus timeout specifications . . . . .687
Table 126.SMBus with PEC configuration . . . . .689
Table 127.TIMEOUTA[11:0] for maximum t TIMEOUT of 25 ms. . . . .690
Table 128.TIMEOUTB[11:0] for maximum t LOW:SEXT and t LOW:MEXT of 8 ms . . . . .690
Table 129.TIMEOUTA[11:0] for maximum t IDLE of 50 µs . . . . .690
Table 130.Effect of low-power modes to FMPI2C . . . . .699
Table 131.FMPI2C interrupt requests . . . . .699
Table 132.FMPI2C register map and reset values . . . . .715
Table 133.Maximum DNF[3:0] value to be compliant with Thd:dat(max) . . . . .727
Table 134.SMBus vs. I 2 C . . . . .728
Table 135.I 2 C interrupt requests . . . . .733
Table 136.I 2 C register map and reset values . . . . .746
Table 137.USART features . . . . .749
Table 138.Noise detection from sampled data . . . . .760
Table 139.Error calculation for programmed baud rates at f PCLK = 8 MHz or f PCLK = 12 MHz, oversampling by 16. . . . .763
Table 140.Error calculation for programmed baud rates at f PCLK = 8 MHz or f PCLK = 12 MHz, oversampling by 8. . . . .763
Table 141.Error calculation for programmed baud rates at f PCLK = 16 MHz or f PCLK = 24 MHz, oversampling by 16. . . . .764
Table 142.Error calculation for programmed baud rates at f PCLK = 16 MHz or f PCLK = 24 MHz, oversampling by 8. . . . .765
Table 143.Error calculation for programmed baud rates at f PCLK = 8 MHz or f PCLK = 16 MHz, oversampling by 16. . . . .765
Table 144.Error calculation for programmed baud rates at \( f_{PCLK} = 8 \) MHz or \( f_{PCLK} = 16 \) MHz, oversampling by 8. . . . .766
Table 145.Error calculation for programmed baud rates at \( f_{PCLK} = 30 \) MHz or \( f_{PCLK} = 60 \) MHz, oversampling by 16. . . . .767
Table 146.Error calculation for programmed baud rates at \( f_{PCLK} = 30 \) MHz or \( f_{PCLK} = 60 \) MHz, oversampling by 8 . . . . .767
Table 147.Error calculation for programmed baud rates at \( f_{PCLK} = 42 \) MHz or \( f_{PCLK} = 84 \) Hz, oversampling by 16. . . . .768
Table 148.Error calculation for programmed baud rates at \( f_{PCLK} = 42 \) MHz or \( f_{PCLK} = 84 \) MHz, oversampling by 8. . . . .769
Table 149.Error calculation for programmed baud rates at \( f_{PCLK} = 100 \) MHz or \( f_{PCLK} = 50 \) MHz, oversampling by 16. . . . .770
Table 150.Error calculation for programmed baud rates at \( f_{PCLK} = 100 \) MHz or \( f_{PCLK} = 50 \) MHz, oversampling by 8. . . . .771
Table 151.USART receiver tolerance when DIV fraction is 0 . . . . .772
Table 152.USART receiver tolerance when DIV_Fraction is different from 0 . . . . .772
Table 153.Frame formats . . . . .774
Table 154.USART interrupt requests. . . . .788
Table 155.USART register map and reset values . . . . .799
Table 156.STM32F412xx SPI implementation . . . . .802
Table 157.SPI interrupt requests. . . . .823
Table 158.Audio-frequency precision using standard 8 MHz HSE . . . . .834
Table 159.I 2 S interrupt requests . . . . .840
Table 160.SPI register map and reset values . . . . .851
Table 161.SDIO I/O definitions . . . . .855
Table 162.Command format . . . . .860
Table 163.Short response format . . . . .861
Table 164.Long response format. . . . .861
Table 165.Command path status flags . . . . .861
Table 166.Data token format . . . . .864
Table 167.DPSM flags. . . . .865
Table 168.Transmit FIFO status flags . . . . .866
Table 169.Receive FIFO status flags . . . . .866
Table 170.Card status . . . . .877
Table 171.SD status . . . . .880
Table 172.Speed class code field . . . . .881
Table 173.Performance move field . . . . .882
Table 174.AU_SIZE field . . . . .882
Table 175.Maximum AU size. . . . .882
Table 176.Erase size field . . . . .883
Table 177.Erase timeout field . . . . .883
Table 178.Erase offset field . . . . .883
Table 179.Block-oriented write commands . . . . .886
Table 180.Block-oriented write protection commands. . . . .887
Table 181.Erase commands . . . . .887
Table 182.I/O mode commands . . . . .887
Table 183.Lock card . . . . .888
Table 184.Application-specific commands . . . . .888
Table 185.R1 response . . . . .889
Table 186.R2 response . . . . .889
Table 187.R3 response . . . . .890
Table 188.R4 response . . . . .890
Table 189.R4b response . . . . .890
Table 190.R5 response . . . . .891
Table 191.R6 response . . . . .892
Table 192.Response type and SDIO_RESPx registers. . . . .898
Table 193.SDIO register map . . . . .909
Table 194.Transmit mailbox mapping . . . . .925
Table 195.Receive mailbox mapping. . . . .925
Table 196.bxCAN register map and reset values . . . . .951
Table 197.OTG_FS speeds supported . . . . .955
Table 198.OTG_FS implementation . . . . .958
Table 199.OTG_FS input/output pins . . . . .959
Table 200.OTG_FS input/output signals . . . . .960
Table 201.Compatibility of STM32 low power modes with the OTG . . . . .972
Table 202.Core global control and status registers (CSRs). . . . .980
Table 203.Host-mode control and status registers (CSRs) . . . . .981
Table 204.Device-mode control and status registers . . . . .982
Table 205.Data FIFO (DFIFO) access register map . . . . .984
Table 206.Power and clock gating control and status registers . . . . .984
Table 207.TRDT values . . . . .991
Table 208.Minimum duration for soft disconnect . . . . .1028
Table 209.OTG_FS register map and reset values . . . . .1051
Table 210.SWJ debug port pins . . . . .1114
Table 211.Flexible SWJ-DP pin assignment . . . . .1114
Table 212.JTAG debug port data registers . . . . .1119
Table 213.32-bit debug port registers addressed through the shifted value A[3:2] . . . . .1120
Table 214.Packet request (8-bits) . . . . .1121
Table 215.ACK response (3 bits). . . . .1122
Table 216.DATA transfer (33 bits). . . . .1122
Table 217.SW-DP registers . . . . .1123
Table 218.Cortex®-M4 with FPU AHB-AP registers . . . . .1124
Table 219.Core debug registers . . . . .1125
Table 220.Main ITM registers . . . . .1128
Table 221.Main ETM registers. . . . .1130
Table 222.Asynchronous TRACE pin assignment. . . . .1136
Table 223.Synchronous TRACE pin assignment . . . . .1136
Table 224.Flexible TRACE pin assignment . . . . .1137
Table 225.Important TPIU registers. . . . .1139
Table 226.DBG register map and reset values . . . . .1141
Table 227.Document revision history . . . . .1146

List of figures

Figure 1.System architecture . . . . .47
Figure 2.Memory map . . . . .50
Figure 3.Flash memory interface connection inside system architecture . . . . .58
Figure 4.Sequential 32-bit instruction execution . . . . .62
Figure 5.RDP levels . . . . .70
Figure 6.PCROP levels . . . . .72
Figure 7.CRC calculation unit block diagram . . . . .82
Figure 8.Power supply overview . . . . .87
Figure 9.Power-on reset/power-down reset waveform . . . . .90
Figure 10.BOR thresholds . . . . .91
Figure 11.PVD thresholds . . . . .92
Figure 12.Simplified diagram of the reset circuit . . . . .110
Figure 13.Clock tree . . . . .112
Figure 14.HSE/ LSE clock sources . . . . .114
Figure 15.Frequency measurement with TIM5 in Input capture mode . . . . .119
Figure 16.Frequency measurement with TIM11 in Input capture mode . . . . .120
Figure 17.Basic structure of a five-volt tolerant I/O port bit . . . . .169
Figure 18.Selecting an alternate function on STM32F412xx . . . . .173
Figure 19.Input floating/pull up/pull down configurations . . . . .176
Figure 20.Output configuration . . . . .177
Figure 21.Alternate function configuration . . . . .177
Figure 22.High impedance-analog configuration . . . . .178
Figure 23.DMA block diagram . . . . .198
Figure 24.Channel selection . . . . .199
Figure 25.Peripheral-to-memory mode . . . . .203
Figure 26.Memory-to-peripheral mode . . . . .204
Figure 27.Memory-to-memory mode . . . . .205
Figure 28.FIFO structure . . . . .210
Figure 29.External interrupt/event controller block diagram . . . . .236
Figure 30.External interrupt/event GPIO mapping . . . . .238
Figure 31.FSMC block diagram . . . . .247
Figure 32.FSMC memory banks . . . . .249
Figure 33.Mode 1 read access waveforms . . . . .255
Figure 34.Mode 1 write access waveforms . . . . .256
Figure 35.Mode A read access waveforms . . . . .258
Figure 36.Mode A write access waveforms . . . . .258
Figure 37.Mode 2 and mode B read access waveforms . . . . .260
Figure 38.Mode 2 write access waveforms . . . . .261
Figure 39.Mode B write access waveforms . . . . .261
Figure 40.Mode C read access waveforms . . . . .263
Figure 41.Mode C write access waveforms . . . . .264
Figure 42.Mode D read access waveforms . . . . .266
Figure 43.Mode D write access waveforms . . . . .266
Figure 44.Muxed read access waveforms . . . . .268
Figure 45.Muxed write access waveforms . . . . .269
Figure 46.Asynchronous wait during a read access waveforms . . . . .271
Figure 47.Asynchronous wait during a write access waveforms . . . . .272
Figure 48.Wait configuration waveforms . . . . .274
Figure 49.Synchronous multiplexed read mode waveforms - NOR, PSRAM (CRAM) . . . . .275
Figure 50.Synchronous multiplexed write mode waveforms - PSRAM (CRAM) . . . . .277
Figure 51.QUADSPI block diagram when dual-flash mode is disabled . . . . .288
Figure 52.QUADSPI block diagram when dual-flash mode is enabled . . . . .289
Figure 53.Example of read command in quad-SPI mode . . . . .290
Figure 54.Example of a DDR command in quad-SPI mode . . . . .293
Figure 55.NCS when CKMODE = 0 (T = CLK period) . . . . .301
Figure 56.NCS when CKMODE = 1 in SDR mode (T = CLK period) . . . . .301
Figure 57.NCS when CKMODE = 1 in DDR mode (T = CLK period) . . . . .302
Figure 58.NCS when CKMODE = 1 with an abort (T = CLK period) . . . . .302
Figure 59.Single ADC block diagram . . . . .317
Figure 60.Timing diagram . . . . .320
Figure 61.Analog watchdog's guarded area . . . . .320
Figure 62.Injected conversion latency . . . . .322
Figure 63.Right alignment of 12-bit data . . . . .324
Figure 64.Left alignment of 12-bit data . . . . .324
Figure 65.Left alignment of 6-bit data . . . . .324
Figure 66.Temperature sensor and VREFINT channel block diagram . . . . .328
Figure 67.Single DFSDM block diagram . . . . .349
Figure 68.Input channel pins redirection . . . . .353
Figure 69.Channel transceiver timing diagrams . . . . .356
Figure 70.Clock absence timing diagram for SPI . . . . .357
Figure 71.Clock absence timing diagram for Manchester coding . . . . .358
Figure 72.First conversion for Manchester coding (Manchester synchronization) . . . . .360
Figure 73.DFSDM_CHyDATINR registers operation modes and assignment . . . . .363
Figure 74.Example: Sinc3 filter response . . . . .365
Figure 75.RNG block diagram . . . . .401
Figure 76.Entropy source model . . . . .402
Figure 77.Advanced-control timer block diagram . . . . .412
Figure 78.Counter timing diagram with prescaler division change from 1 to 2 . . . . .414
Figure 79.Counter timing diagram with prescaler division change from 1 to 4 . . . . .414
Figure 80.Counter timing diagram, internal clock divided by 1 . . . . .415
Figure 81.Counter timing diagram, internal clock divided by 2 . . . . .416
Figure 82.Counter timing diagram, internal clock divided by 4 . . . . .416
Figure 83.Counter timing diagram, internal clock divided by N . . . . .416
Figure 84.Counter timing diagram, update event when ARPE=0
(TIMx_ARR not preloaded) . . . . .
417
Figure 85.Counter timing diagram, update event when ARPE=1
(TIMx_ARR preloaded) . . . . .
417
Figure 86.Counter timing diagram, internal clock divided by 1 . . . . .419
Figure 87.Counter timing diagram, internal clock divided by 2 . . . . .419
Figure 88.Counter timing diagram, internal clock divided by 4 . . . . .420
Figure 89.Counter timing diagram, internal clock divided by N . . . . .420
Figure 90.Counter timing diagram, update event when repetition counter is not used . . . . .421
Figure 91.Counter timing diagram, internal clock divided by 1, TIMx_ARR = 0x6 . . . . .422
Figure 92.Counter timing diagram, internal clock divided by 2 . . . . .422
Figure 93.Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 . . . . .423
Figure 94.Counter timing diagram, internal clock divided by N . . . . .423
Figure 95.Counter timing diagram, update event with ARPE=1 (counter underflow) . . . . .424
Figure 96.Counter timing diagram, update event with ARPE=1 (counter overflow) . . . . .424
Figure 97.Update rate examples depending on mode and TIMx_RCR register settings . . . . .425
Figure 98.Control circuit in normal mode, internal clock divided by 1 . . . . .426
Figure 99.TI2 external clock connection example. . . . .427
Figure 100.Control circuit in external clock mode 1 . . . . .428
Figure 101.External trigger input block . . . . .428
Figure 102.Control circuit in external clock mode 2 . . . . .429
Figure 103.Capture/compare channel (example: channel 1 input stage) . . . . .430
Figure 104.Capture/compare channel 1 main circuit . . . . .430
Figure 105.Output stage of capture/compare channel (channels 1 to 3) . . . . .431
Figure 106.Output stage of capture/compare channel (channel 4). . . . .431
Figure 107.PWM input mode timing . . . . .433
Figure 108.Output compare mode, toggle on OC1. . . . .435
Figure 109.Edge-aligned PWM waveforms (ARR=8) . . . . .436
Figure 110.Center-aligned PWM waveforms (ARR=8). . . . .437
Figure 111.Complementary output with dead-time insertion . . . . .439
Figure 112.Dead-time waveforms with delay greater than the negative pulse . . . . .439
Figure 113.Dead-time waveforms with delay greater than the positive pulse. . . . .439
Figure 114.Output behavior in response to a break . . . . .442
Figure 115.Clearing TIMx_OCxREF . . . . .443
Figure 116.6-step generation, COM example (OSSR=1) . . . . .444
Figure 117.Example of one pulse mode . . . . .445
Figure 118.Example of counter operation in encoder interface mode . . . . .448
Figure 119.Example of encoder interface mode with TI1FP1 polarity inverted. . . . .448
Figure 120.Example of Hall sensor interface . . . . .450
Figure 121.Control circuit in reset mode . . . . .451
Figure 122.Control circuit in gated mode . . . . .452
Figure 123.Control circuit in trigger mode . . . . .453
Figure 124.Control circuit in external clock mode 2 + trigger mode . . . . .454
Figure 125.General-purpose timer block diagram . . . . .482
Figure 126.Counter timing diagram with prescaler division change from 1 to 2 . . . . .483
Figure 127.Counter timing diagram with prescaler division change from 1 to 4 . . . . .484
Figure 128.Counter timing diagram, internal clock divided by 1 . . . . .485
Figure 129.Counter timing diagram, internal clock divided by 2 . . . . .485
Figure 130.Counter timing diagram, internal clock divided by 4 . . . . .485
Figure 131.Counter timing diagram, internal clock divided by N. . . . .486
Figure 132.Counter timing diagram, Update event when ARPE=0 (TIMx_ARR not preloaded). . . . .486
Figure 133.Counter timing diagram, Update event when ARPE=1 (TIMx_ARR preloaded). . . . .487
Figure 134.Counter timing diagram, internal clock divided by 1 . . . . .488
Figure 135.Counter timing diagram, internal clock divided by 2 . . . . .488
Figure 136.Counter timing diagram, internal clock divided by 4 . . . . .488
Figure 137.Counter timing diagram, internal clock divided by N. . . . .489
Figure 138.Counter timing diagram, Update event . . . . .489
Figure 139.Counter timing diagram, internal clock divided by 1, TIMx_ARR=0x6 . . . . .490
Figure 140.Counter timing diagram, internal clock divided by 2 . . . . .491
Figure 141.Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 . . . . .491
Figure 142.Counter timing diagram, internal clock divided by N. . . . .491
Figure 143.Counter timing diagram, Update event with ARPE=1 (counter underflow). . . . .492
Figure 144.Counter timing diagram, Update event with ARPE=1 (counter overflow). . . . .492
Figure 145.Control circuit in normal mode, internal clock divided by 1 . . . . .493
Figure 146.TI2 external clock connection example. . . . .494
Figure 147.Control circuit in external clock mode 1 . . . . .495
Figure 148.External trigger input block . . . . .495
Figure 149.Control circuit in external clock mode 2 . . . . .496
Figure 150.Capture/compare channel (example: channel 1 input stage) . . . . .497
Figure 151. Capture/compare channel 1 main circuit . . . . .497
Figure 152. Output stage of capture/compare channel (channel 1). . . . .498
Figure 153. PWM input mode timing . . . . .500
Figure 154. Output compare mode, toggle on OC1 . . . . .501
Figure 155. Edge-aligned PWM waveforms (ARR=8) . . . . .503
Figure 156. Center-aligned PWM waveforms (ARR=8). . . . .504
Figure 157. Example of one-pulse mode . . . . .505
Figure 158. Clearing TIMx_OCxREF . . . . .507
Figure 159. Example of counter operation in encoder interface mode . . . . .508
Figure 160. Example of encoder interface mode with TI1FP1 polarity inverted . . . . .509
Figure 161. Control circuit in reset mode . . . . .510
Figure 162. Control circuit in gated mode . . . . .511
Figure 163. Control circuit in trigger mode . . . . .511
Figure 164. Control circuit in external clock mode 2 + trigger mode . . . . .512
Figure 165. Master/Slave timer example . . . . .513
Figure 166. Gating timer 2 with OC1REF of timer 1 . . . . .514
Figure 167. Gating timer 2 with Enable of timer 1 . . . . .515
Figure 168. Triggering timer 2 with update of timer 1 . . . . .516
Figure 169. Triggering timer 2 with Enable of timer 1 . . . . .516
Figure 170. Triggering timer 1 and 2 with timer 1 TI1 input . . . . .518
Figure 171. General-purpose timer block diagram (TIM9 and TIM12) . . . . .543
Figure 172. General-purpose timer block diagram (TIM10/11/13/14) . . . . .544
Figure 173. Counter timing diagram with prescaler division change from 1 to 2 . . . . .546
Figure 174. Counter timing diagram with prescaler division change from 1 to 4 . . . . .546
Figure 175. Counter timing diagram, internal clock divided by 1 . . . . .547
Figure 176. Counter timing diagram, internal clock divided by 2 . . . . .548
Figure 177. Counter timing diagram, internal clock divided by 4 . . . . .548
Figure 178. Counter timing diagram, internal clock divided by N . . . . .548
Figure 179. Counter timing diagram, update event when ARPE=0
(TIMx_ARR not preloaded) . . . . .
549
Figure 180. Counter timing diagram, update event when ARPE=1
(TIMx_ARR preloaded) . . . . .
549
Figure 181. Control circuit in normal mode, internal clock divided by 1 . . . . .550
Figure 182. TI2 external clock connection example . . . . .551
Figure 183. Control circuit in external clock mode 1 . . . . .551
Figure 184. Capture/compare channel (example: channel 1 input stage) . . . . .552
Figure 185. Capture/compare channel 1 main circuit . . . . .553
Figure 186. Output stage of capture/compare channel (channel 1). . . . .553
Figure 187. PWM input mode timing . . . . .555
Figure 188. Output compare mode, toggle on OC1 . . . . .557
Figure 189. Edge-aligned PWM waveforms (ARR=8) . . . . .558
Figure 190. Example of One-pulse mode . . . . .559
Figure 191. Control circuit in reset mode . . . . .561
Figure 192. Control circuit in gated mode . . . . .562
Figure 193. Control circuit in trigger mode . . . . .562
Figure 194. Basic timer block diagram . . . . .589
Figure 195. Counter timing diagram with prescaler division change from 1 to 2 . . . . .591
Figure 196. Counter timing diagram with prescaler division change from 1 to 4 . . . . .591
Figure 197. Counter timing diagram, internal clock divided by 1 . . . . .592
Figure 198. Counter timing diagram, internal clock divided by 2 . . . . .593
Figure 199. Counter timing diagram, internal clock divided by 4 . . . . .593
Figure 200. Counter timing diagram, internal clock divided by N . . . . .594
Figure 201. Counter timing diagram, update event when ARPE = 0 (TIMx_ARR not preloaded) . . . . .594
Figure 202. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded) . . . . .595
Figure 203. Control circuit in normal mode, internal clock divided by 1 . . . . .596
Figure 204. Independent watchdog block diagram . . . . .603
Figure 205. Watchdog block diagram . . . . .609
Figure 206. Window watchdog timing diagram . . . . .610
Figure 207. RTC block diagram . . . . .616
Figure 208. Block diagram . . . . .655
Figure 209. I 2 C-bus protocol . . . . .657
Figure 210. Setup and hold timings . . . . .658
Figure 211. FMPI2C initialization flow . . . . .661
Figure 212. Data reception . . . . .662
Figure 213. Data transmission . . . . .663
Figure 214. Target initialization flow . . . . .666
Figure 215. Transfer sequence flow for FMPI2C target transmitter, NOSTRETCH = 0 . . . . .668
Figure 216. Transfer sequence flow for FMPI2C target transmitter, NOSTRETCH = 1 . . . . .669
Figure 217. Transfer bus diagrams for FMPI2C target transmitter (mandatory events only) . . . . .670
Figure 218. Transfer sequence flow for FMPI2C target receiver, NOSTRETCH = 0 . . . . .671
Figure 219. Transfer sequence flow for FMPI2C target receiver, NOSTRETCH = 1 . . . . .672
Figure 220. Transfer bus diagrams for FMPI2C target receiver
(mandatory events only) . . . . .
672
Figure 221. Controller clock generation . . . . .674
Figure 222. Controller initialization flow . . . . .676
Figure 223. 10-bit address read access with HEAD10R = 0 . . . . .676
Figure 224. 10-bit address read access with HEAD10R = 1 . . . . .677
Figure 225. Transfer sequence flow for FMPI2C controller transmitter, N ≤ 255 bytes . . . . .678
Figure 226. Transfer sequence flow for FMPI2C controller transmitter, N > 255 bytes . . . . .679
Figure 227. Transfer bus diagrams for FMPI2C controller transmitter
(mandatory events only) . . . . .
680
Figure 228. Transfer sequence flow for FMPI2C controller receiver, N ≤ 255 bytes . . . . .682
Figure 229. Transfer sequence flow for FMPI2C controller receiver, N > 255 bytes . . . . .683
Figure 230. Transfer bus diagrams for FMPI2C controller receiver
(mandatory events only) . . . . .
684
Figure 231. Timeout intervals for t LOW:SEXT , t LOW:MEXT . . . . .688
Figure 232. Transfer sequence flow for SMBus target transmitter N bytes + PEC . . . . .691
Figure 233. Transfer bus diagram for SMBus target transmitter (SBC = 1) . . . . .692
Figure 234. Transfer sequence flow for SMBus target receiver N bytes + PEC . . . . .693
Figure 235. Bus transfer diagrams for SMBus target receiver (SBC = 1) . . . . .694
Figure 236. Bus transfer diagrams for SMBus controller transmitter . . . . .695
Figure 237. Bus transfer diagrams for SMBus controller receiver . . . . .697
Figure 238. I2C bus protocol . . . . .718
Figure 239. I2C block diagram . . . . .719
Figure 240. Transfer sequence diagram for target transmitter . . . . .720
Figure 241. Transfer sequence diagram for target receiver . . . . .721
Figure 242. Transfer sequence diagram for controller transmitter . . . . .724
Figure 243. Transfer sequence diagram for controller receiver . . . . .725
Figure 244. I2C interrupt mapping diagram . . . . .734
Figure 245. USART block diagram . . . . .751
Figure 246. Word length programming . . . . .752
Figure 247. Configurable stop bits . . . . .754
Figure 248. TC/TXE behavior when transmitting . . . . .755
Figure 249. Start bit detection when oversampling by 16 or 8. . . . .756
Figure 250. Data sampling when oversampling by 16 . . . . .759
Figure 251. Data sampling when oversampling by 8 . . . . .760
Figure 252. Mute mode using Idle line detection . . . . .773
Figure 253. Mute mode using address mark detection . . . . .774
Figure 254. Break detection in LIN mode (11-bit break length - LBDL bit is set). . . . .776
Figure 255. Break detection in LIN mode vs. Framing error detection. . . . .777
Figure 256. USART example of synchronous transmission. . . . .778
Figure 257. USART data clock timing diagram (M=0) . . . . .778
Figure 258. USART data clock timing diagram (M=1) . . . . .779
Figure 259. RX data setup/hold time . . . . .779
Figure 260. ISO 7816-3 asynchronous protocol . . . . .780
Figure 261. Parity error detection using the 1.5 stop bits . . . . .781
Figure 262. IrDA SIR ENDEC- block diagram . . . . .783
Figure 263. IrDA data modulation (3/16) -Normal mode . . . . .783
Figure 264. Transmission using DMA . . . . .785
Figure 265. Reception using DMA . . . . .786
Figure 266. Hardware flow control between 2 USARTs . . . . .786
Figure 267. RTS flow control . . . . .787
Figure 268. CTS flow control . . . . .787
Figure 269. USART interrupt mapping diagram . . . . .789
Figure 270. SPI block diagram. . . . .803
Figure 271. Full-duplex single master/ single slave application. . . . .804
Figure 272. Half-duplex single master/ single slave application . . . . .805
Figure 273. Simplex single master/single slave application (master in transmit-only/
slave in receive-only mode) . . . . .
806
Figure 274. Master and three independent slaves. . . . .807
Figure 275. Multimaster application. . . . .808
Figure 276. Hardware/software slave select management . . . . .809
Figure 277. Data clock timing diagram . . . . .811
Figure 278. TXE/RXNE/BSY behavior in master / full-duplex mode (BIDIMODE=0,
RXONLY=0) in the case of continuous transfers . . . . .
814
Figure 279. TXE/RXNE/BSY behavior in slave / full-duplex mode (BIDIMODE=0,
RXONLY=0) in the case of continuous transfers . . . . .
815
Figure 280. Transmission using DMA . . . . .817
Figure 281. Reception using DMA. . . . .818
Figure 282. TI mode transfer . . . . .821
Figure 283. I 2 S block diagram . . . . .824
Figure 284. I2S full-duplex block diagram . . . . .825
Figure 285. I 2 S Philips protocol waveforms (16/32-bit full accuracy, CPOL = 0). . . . .827
Figure 286. I 2 S Philips standard waveforms (24-bit frame with CPOL = 0). . . . .827
Figure 287. Transmitting 0x8EAA33 . . . . .827
Figure 288. Receiving 0x8EAA33 . . . . .828
Figure 289. I 2 S Philips standard (16-bit extended to 32-bit packet frame with CPOL = 0) . . . . .828
Figure 290. Example of 16-bit data frame extended to 32-bit channel frame . . . . .828
Figure 291. MSB Justified 16-bit or 32-bit full-accuracy length with CPOL = 0 . . . . .829
Figure 292. MSB justified 24-bit frame length with CPOL = 0 . . . . .829
Figure 293. MSB justified 16-bit extended to 32-bit packet frame with CPOL = 0 . . . . .829
Figure 294. LSB justified 16-bit or 32-bit full-accuracy with CPOL = 0 . . . . .830
Figure 295. LSB justified 24-bit frame length with CPOL = 0. . . . .830
Figure 296. Operations required to transmit 0x3478AE. . . . .830
Figure 297. Operations required to receive 0x3478AE . . . . .831
Figure 298. LSB justified 16-bit extended to 32-bit packet frame with CPOL = 0 . . . . .831
Figure 299. Example of 16-bit data frame extended to 32-bit channel frame . . . . .831
Figure 300. PCM standard waveforms (16-bit) . . . . .832
Figure 301. PCM standard waveforms (16-bit extended to 32-bit packet frame). . . . .832
Figure 302. Audio sampling frequency definition . . . . .833
Figure 303. I 2 S clock generator architecture . . . . .833
Figure 304. “No response” and “no data” operations . . . . .853
Figure 305. (Multiple) block read operation . . . . .853
Figure 306. (Multiple) block write operation . . . . .853
Figure 307. Sequential read operation. . . . .854
Figure 308. Sequential write operation . . . . .854
Figure 309. SDIO block diagram . . . . .854
Figure 310. SDIO adapter . . . . .856
Figure 311. Control unit . . . . .857
Figure 312. SDIO_CK clock dephasing (BYPASS = 0) . . . . .857
Figure 313. SDIO adapter command path . . . . .858
Figure 314. Command path state machine (SDIO) . . . . .859
Figure 315. SDIO command transfer . . . . .860
Figure 316. Data path . . . . .862
Figure 317. Data path state machine (DPSM) . . . . .863
Figure 318. CAN network topology . . . . .912
Figure 319. Dual-CAN block diagram . . . . .913
Figure 320. bxCAN operating modes. . . . .915
Figure 321. bxCAN in silent mode . . . . .916
Figure 322. bxCAN in Loop back mode . . . . .916
Figure 323. bxCAN in combined mode . . . . .917
Figure 324. Transmit mailbox states . . . . .919
Figure 325. Receive FIFO states . . . . .920
Figure 326. Filter bank scale configuration - Register organization. . . . .922
Figure 327. Example of filter numbering . . . . .923
Figure 328. Filtering mechanism example . . . . .924
Figure 329. CAN error state diagram. . . . .926
Figure 330. Bit timing . . . . .928
Figure 331. CAN frames . . . . .929
Figure 332. Event flags and interrupt generation. . . . .930
Figure 333. CAN mailbox registers . . . . .942
Figure 334. OTG_FS full-speed block diagram . . . . .959
Figure 335. OTG_FS A-B device connection. . . . .961
Figure 336. OTG_FS peripheral-only connection . . . . .963
Figure 337. OTG_FS host-only connection . . . . .967
Figure 338. SOF connectivity (SOF trigger output to TIM and ITR1 connection) . . . . .971
Figure 339. Updating OTG_HFIR dynamically (RLDCTRL = 1) . . . . .973
Figure 340. Device-mode FIFO address mapping and AHB FIFO access mapping . . . . .974
Figure 341. Host-mode FIFO address mapping and AHB FIFO access mapping. . . . .975
Figure 342. Interrupt hierarchy. . . . .979
Figure 343. Transmit FIFO write task . . . . .1062
Figure 344. Receive FIFO read task . . . . .1063
Figure 345. Normal bulk/control OUT/SETUP . . . . .1064
Figure 346. Bulk/control IN transactions . . . . .1068
Figure 347. Normal interrupt OUT . . . . .1071
Figure 348. Normal interrupt IN . . . . .1076

Figure 349. Isochronous OUT transactions . . . . . 1078
Figure 350. Isochronous IN transactions . . . . . 1081
Figure 351. Receive FIFO packet read . . . . . 1085
Figure 352. Processing a SETUP packet . . . . . 1087
Figure 353. Bulk OUT transaction . . . . . 1094
Figure 354. TRDT max timing case . . . . . 1104
Figure 355. A-device SRP . . . . . 1105
Figure 356. B-device SRP . . . . . 1106
Figure 357. A-device HNP . . . . . 1107
Figure 358. B-device HNP . . . . . 1109
Figure 359. Block diagram of STM32 MCU and Cortex®-M4 with FPU-level
debug support. . . . . 1111
Figure 360. SWJ debug port . . . . . 1113
Figure 361. JTAG TAP connections . . . . . 1117
Figure 362. TPIU block diagram . . . . . 1135

Chapters