15. Digital camera interface (DCMI) 457

15.1DCMI introduction . . . . .457
15.2DCMI main features . . . . .457
15.3DCMI pins . . . . .457
15.4DCMI clocks . . . . .457
15.5DCMI functional overview . . . . .458
15.5.1DMA interface . . . . .459
15.5.2DCMI physical interface . . . . .459
15.5.3Synchronization . . . . .461
15.5.4Capture modes . . . . .463
15.5.5Crop feature . . . . .465
15.5.6JPEG format . . . . .467
15.5.7FIFO . . . . .467
15.6Data format description . . . . .467
15.6.1Data formats . . . . .467
15.6.2Monochrome format . . . . .468
15.6.3RGB format . . . . .468
15.6.4YCbCr format . . . . .468
15.7DCMI interrupts . . . . .469
15.8DCMI register description . . . . .469
15.8.1DCMI control register 1 (DCMI_CR) . . . . .469
15.8.2DCMI status register (DCMI_SR) . . . . .471
15.8.3DCMI raw interrupt status register (DCMI_RIS) . . . . .472
15.8.4DCMI interrupt enable register (DCMI_IER) . . . . .473
15.8.5DCMI masked interrupt status register (DCMI_MIS) . . . . .474
15.8.6DCMI interrupt clear register (DCMI_ICR) . . . . .475
15.8.7DCMI embedded synchronization code register (DCMI_ESCR) . . . . .475
15.8.8DCMI embedded synchronization unmask register (DCMI_ESUR) . . . . .476
15.8.9DCMI crop window start (DCMI_CWSTRT) . . . . .477
15.8.10DCMI crop window size (DCMI_CWSIZE) . . . . .477
15.8.11DCMI data register (DCMI_DR) . . . . .478
15.8.12DCMI register map . . . . .478
16LCD-TFT controller (LTDC) . . . . .480
16.1Introduction . . . . .480
16.2LTDC main features . . . . .480
16.3LTDC functional description . . . . .481
16.3.1LTDC block diagram481
16.3.2LTDC reset and clocks481
16.3.3LCD-TFT pins and signal interface483
16.4LTDC programmable parameters483
16.4.1LTDC Global configuration parameters483
16.4.2Layer programmable parameters486
16.5LTDC interrupts490
16.6LTDC programming procedure492
16.7LTDC registers493
16.7.1LTDC Synchronization Size Configuration Register (LTDC_SSCR)493
16.7.2LTDC Back Porch Configuration Register (LTDC_BPCR)493
16.7.3LTDC Active Width Configuration Register (LTDC_AWCR)494
16.7.4LTDC Total Width Configuration Register (LTDC_TWCR)495
16.7.5LTDC Global Control Register (LTDC_GCR)495
16.7.6LTDC Shadow Reload Configuration Register (LTDC_SRCR)497
16.7.7LTDC Background Color Configuration Register (LTDC_BCCR)497
16.7.8LTDC Interrupt Enable Register (LTDC_IER)498
16.7.9LTDC Interrupt Status Register (LTDC_ISR)499
16.7.10LTDC Interrupt Clear Register (LTDC_ICR)499
16.7.11LTDC Line Interrupt Position Configuration Register (LTDC_LIPCR)500
16.7.12LTDC Current Position Status Register (LTDC_CPSR)500
16.7.13LTDC Current Display Status Register (LTDC_CDSR)501
16.7.14LTDC Layerx Control Register (LTDC_LxCR) (where x=1..2)502
16.7.15LTDC Layerx Window Horizontal Position Configuration Register (LTDC_LxWHPCR) (where x=1..2)503
16.7.16LTDC Layerx Window Vertical Position Configuration Register (LTDC_LxWVPCR) (where x=1..2)504
16.7.17LTDC Layerx Color Keying Configuration Register (LTDC_LxCKCR) (where x=1..2)505
16.7.18LTDC Layerx Pixel Format Configuration Register (LTDC_LxPFCR) (where x=1..2)505
16.7.19LTDC Layerx Constant Alpha Configuration Register (LTDC_LxCACR) (where x=1..2)506
16.7.20LTDC Layerx Default Color Configuration Register (LTDC_LxDCCR) (where x=1..2)506
16.7.21LTDC Layerx Blending Factors Configuration Register (LTDC_LxBFCR) (where x=1..2)508
16.7.22LTDC Layerx Color Frame Buffer Address Register (LTDC_LxCFBAR) (where x=1..2)509
16.7.23LTDC Layerx Color Frame Buffer Length Register (LTDC_LxCFBLR)
(where x=1..2) .....
509
16.7.24LTDC Layerx ColorFrame Buffer Line Number Register
(LTDC_LxCFBLNR) (where x=1..2) .....
510
16.7.25LTDC Layerx CLUT Write Register (LTDC_LxCLUTWR)
(where x=1..2) .....
511
16.7.26LTDC register map .....512
17Advanced-control timers (TIM1 and TIM8) .....515
17.1TIM1 and TIM8 introduction .....515
17.2TIM1 and TIM8 main features .....515
17.3TIM1 and TIM8 functional description .....517
17.3.1Time-base unit .....517
17.3.2Counter modes .....519
17.3.3Repetition counter .....528
17.3.4Clock selection .....531
17.3.5Capture/compare channels .....534
17.3.6Input capture mode .....537
17.3.7PWM input mode .....538
17.3.8Forced output mode .....538
17.3.9Output compare mode .....539
17.3.10PWM mode .....540
17.3.11Complementary outputs and dead-time insertion .....543
17.3.12Using the break function .....545
17.3.13Clearing the OCxREF signal on an external event .....548
17.3.146-step PWM generation .....549
17.3.15One-pulse mode .....550
17.3.16Encoder interface mode .....551
17.3.17Timer input XOR function .....554
17.3.18Interfacing with Hall sensors .....554
17.3.19TIMx and external trigger synchronization .....556
17.3.20Timer synchronization .....559
17.3.21Debug mode .....559
17.4TIM1 and TIM8 registers .....560
17.4.1TIM1 and TIM8 control register 1 (TIMx_CR1) .....560
17.4.2TIM1 and TIM8 control register 2 (TIMx_CR2) .....561
17.4.3TIM1 and TIM8 slave mode control register (TIMx_SMCR) .....563
17.4.4TIM1 and TIM8 DMA/interrupt enable register (TIMx_DIER) .....565
17.4.5TIM1 and TIM8 status register (TIMx_SR) . . . . .567
17.4.6TIM1 and TIM8 event generation register (TIMx_EGR) . . . . .568
17.4.7TIM1 and TIM8 capture/compare mode register 1 (TIMx_CCMR1) . . .569
17.4.8TIM1 and TIM8 capture/compare mode register 2 (TIMx_CCMR2) . . .572
17.4.9TIM1 and TIM8 capture/compare enable register (TIMx_CCER) . . . .574
17.4.10TIM1 and TIM8 counter (TIMx_CNT) . . . . .577
17.4.11TIM1 and TIM8 prescaler (TIMx_PSC) . . . . .577
17.4.12TIM1 and TIM8 auto-reload register (TIMx_ARR) . . . . .577
17.4.13TIM1 and TIM8 repetition counter register (TIMx_RCR) . . . . .578
17.4.14TIM1 and TIM8 capture/compare register 1 (TIMx_CCR1) . . . . .578
17.4.15TIM1 and TIM8 capture/compare register 2 (TIMx_CCR2) . . . . .579
17.4.16TIM1 and TIM8 capture/compare register 3 (TIMx_CCR3) . . . . .579
17.4.17TIM1 and TIM8 capture/compare register 4 (TIMx_CCR4) . . . . .580
17.4.18TIM1 and TIM8 break and dead-time register (TIMx_BDTR) . . . . .580
17.4.19TIM1 and TIM8 DMA control register (TIMx_DCR) . . . . .582
17.4.20TIM1 and TIM8 DMA address for full transfer (TIMx_DMAR) . . . . .583
17.4.21TIM1 and TIM8 register map . . . . .584
18General-purpose timers (TIM2 to TIM5) . . . . .586
18.1TIM2 to TIM5 introduction . . . . .586
18.2TIM2 to TIM5 main features . . . . .586
18.3TIM2 to TIM5 functional description . . . . .588
18.3.1Time-base unit . . . . .588
18.3.2Counter modes . . . . .589
18.3.3Clock selection . . . . .599
18.3.4Capture/compare channels . . . . .602
18.3.5Input capture mode . . . . .604
18.3.6PWM input mode . . . . .605
18.3.7Forced output mode . . . . .606
18.3.8Output compare mode . . . . .606
18.3.9PWM mode . . . . .607
18.3.10One-pulse mode . . . . .610
18.3.11Clearing the OCxREF signal on an external event . . . . .611
18.3.12Encoder interface mode . . . . .612
18.3.13Timer input XOR function . . . . .615
18.3.14Timers and external trigger synchronization . . . . .615
18.3.15Timer synchronization . . . . .618
18.3.16Debug mode623
18.4TIM2 to TIM5 registers624
18.4.1TIMx control register 1 (TIMx_CR1)624
18.4.2TIMx control register 2 (TIMx_CR2)625
18.4.3TIMx slave mode control register (TIMx_SMCR)626
18.4.4TIMx DMA/Interrupt enable register (TIMx_DIER)629
18.4.5TIMx status register (TIMx_SR)630
18.4.6TIMx event generation register (TIMx_EGR)631
18.4.7TIMx capture/compare mode register 1 (TIMx_CCMR1)632
18.4.8TIMx capture/compare mode register 2 (TIMx_CCMR2)635
18.4.9TIMx capture/compare enable register (TIMx_CCER)636
18.4.10TIMx counter (TIMx_CNT)638
18.4.11TIMx prescaler (TIMx_PSC)638
18.4.12TIMx auto-reload register (TIMx_ARR)638
18.4.13TIMx capture/compare register 1 (TIMx_CCR1)639
18.4.14TIMx capture/compare register 2 (TIMx_CCR2)639
18.4.15TIMx capture/compare register 3 (TIMx_CCR3)640
18.4.16TIMx capture/compare register 4 (TIMx_CCR4)640
18.4.17TIMx DMA control register (TIMx_DCR)641
18.4.18TIMx DMA address for full transfer (TIMx_DMAR)641
18.4.19TIM2 option register (TIM2_OR)642
18.4.20TIM5 option register (TIM5_OR)643
18.4.21TIMx register map644
19General-purpose timers (TIM9 to TIM14)646
19.1TIM9 to TIM14 introduction646
19.2TIM9 to TIM14 main features646
19.2.1TIM9/TIM12 main features646
19.2.2TIM10/TIM11 and TIM13/TIM14 main features647
19.3TIM9 to TIM14 functional description649
19.3.1Time-base unit649
19.3.2Counter modes651
19.3.3Clock selection654
19.3.4Capture/compare channels656
19.3.5Input capture mode657
19.3.6PWM input mode (only for TIM9/12)659
19.3.7Forced output mode660
19.3.8Output compare mode660
19.3.9PWM mode661
19.3.10One-pulse mode662
19.3.11TIM9/12 external trigger synchronization664
19.3.12Timer synchronization (TIM9/12)667
19.3.13Debug mode667
19.4TIM9 and TIM12 registers668
19.4.1TIM9/12 control register 1 (TIMx_CR1)668
19.4.2TIM9/12 slave mode control register (TIMx_SMCR)669
19.4.3TIM9/12 Interrupt enable register (TIMx_DIER)670
19.4.4TIM9/12 status register (TIMx_SR)672
19.4.5TIM9/12 event generation register (TIMx_EGR)673
19.4.6TIM9/12 capture/compare mode register 1 (TIMx_CCMR1)674
19.4.7TIM9/12 capture/compare enable register (TIMx_CCER)677
19.4.8TIM9/12 counter (TIMx_CNT)678
19.4.9TIM9/12 prescaler (TIMx_PSC)678
19.4.10TIM9/12 auto-reload register (TIMx_ARR)678
19.4.11TIM9/12 capture/compare register 1 (TIMx_CCR1)679
19.4.12TIM9/12 capture/compare register 2 (TIMx_CCR2)679
19.4.13TIM9/12 register map680
19.5TIM10/11/13/14 registers682
19.5.1TIM10/11/13/14 control register 1 (TIMx_CR1)682
19.5.2TIM10/11/13/14 Interrupt enable register (TIMx_DIER)683
19.5.3TIM10/11/13/14 status register (TIMx_SR)683
19.5.4TIM10/11/13/14 event generation register (TIMx_EGR)684
19.5.5TIM10/11/13/14 capture/compare mode register 1 (TIMx_CCMR1)684
19.5.6TIM10/11/13/14 capture/compare enable register (TIMx_CCER)687
19.5.7TIM10/11/13/14 counter (TIMx_CNT)688
19.5.8TIM10/11/13/14 prescaler (TIMx_PSC)688
19.5.9TIM10/11/13/14 auto-reload register (TIMx_ARR)688
19.5.10TIM10/11/13/14 capture/compare register 1 (TIMx_CCR1)689
19.5.11TIM11 option register 1 (TIM11_OR)689
19.5.12TIM10/11/13/14 register map690
20Basic timers (TIM6 and TIM7)692
20.1TIM6 and TIM7 introduction692
20.2TIM6 and TIM7 main features692
20.3TIM6 and TIM7 functional description693
20.3.1Time-base unit693
20.3.2Counting mode695
20.3.3Clock source697
20.3.4Debug mode698
20.4TIM6 and TIM7 registers698
20.4.1TIM6 and TIM7 control register 1 (TIMx_CR1)698
20.4.2TIM6 and TIM7 control register 2 (TIMx_CR2)700
20.4.3TIM6 and TIM7 DMA/Interrupt enable register (TIMx_DIER)700
20.4.4TIM6 and TIM7 status register (TIMx_SR)701
20.4.5TIM6 and TIM7 event generation register (TIMx_EGR)701
20.4.6TIM6 and TIM7 counter (TIMx_CNT)701
20.4.7TIM6 and TIM7 prescaler (TIMx_PSC)702
20.4.8TIM6 and TIM7 auto-reload register (TIMx_ARR)702
20.4.9TIM6 and TIM7 register map703
21Independent watchdog (IWDG)704
21.1IWDG introduction704
21.2IWDG main features704
21.3IWDG functional description704
21.3.1Hardware watchdog704
21.3.2Register access protection704
21.3.3Debug mode705
21.4IWDG registers706
21.4.1Key register (IWDG_KR)706
21.4.2Prescaler register (IWDG_PR)706
21.4.3Reload register (IWDG_RLR)707
21.4.4Status register (IWDG_SR)707
21.4.5IWDG register map708
22Window watchdog (WWDG)709
22.1WWDG introduction709
22.2WWDG main features709
22.3WWDG functional description709
22.4How to program the watchdog timeout711
22.5Debug mode712
22.6WWDG registers713
22.6.1Control register (WWDG_CR)713
22.6.2Configuration register (WWDG_CFR)714
22.6.3Status register (WWDG_SR)714
22.6.4WWDG register map715
23Cryptographic processor (CRYP)716
23.1CRYP introduction716
23.2CRYP main features716
23.3CRYP functional description718
23.3.1DES/TDES cryptographic core719
23.3.2AES cryptographic core724
23.3.3Data type735
23.3.4Initialization vectors - CRYP_IV0...1(L/R)738
23.3.5CRYP busy state739
23.3.6Procedure to perform an encryption or a decryption740
23.3.7Context swapping741
23.4CRYP interrupts743
23.5CRYP DMA interface744
23.6CRYP registers744
23.6.1CRYP control register (CRYP_CR) for STM32F415/417xx744
23.6.2CRYP control register (CRYP_CR) for STM32F415/417xx746
23.6.3CRYP status register (CRYP_SR)749
23.6.4CRYP data input register (CRYP_DIN)750
23.6.5CRYP data output register (CRYP_DOUT)751
23.6.6CRYP DMA control register (CRYP_DMACR)752
23.6.7CRYP interrupt mask set/clear register (CRYP_IMSCR)752
23.6.8CRYP raw interrupt status register (CRYP_RISR)753
23.6.9CRYP masked interrupt status register (CRYP_MISR)753
23.6.10CRYP key registers (CRYP_K0...3(L/R)R)754
23.6.11CRYP initialization vector registers (CRYP_IV0...1(L/R)R)756
23.6.12CRYP context swap registers (CRYP_CSGCMCCM0..7R and
CRYP_CSGCM0..7R) for STM32F42xxx and STM32F43xxx
758
23.6.13CRYP register map759
24Random number generator (RNG)763
24.1RNG introduction763
24.2RNG main features . . . . .763
24.3RNG functional description . . . . .763
24.3.1Operation . . . . .764
24.3.2Error management . . . . .764
24.4RNG registers . . . . .764
24.4.1RNG control register (RNG_CR) . . . . .765
24.4.2RNG status register (RNG_SR) . . . . .765
24.4.3RNG data register (RNG_DR) . . . . .766
24.4.4RNG register map . . . . .767
25Hash processor (HASH) . . . . .768
25.1HASH introduction . . . . .768
25.2HASH main features . . . . .768
25.3HASH functional description . . . . .769
25.3.1Duration of the processing . . . . .771
25.3.2Data type . . . . .771
25.3.3Message digest computing . . . . .773
25.3.4Message padding . . . . .774
25.3.5Hash operation . . . . .775
25.3.6HMAC operation . . . . .775
25.3.7Context swapping . . . . .776
25.3.8HASH interrupt . . . . .778
25.4HASH registers . . . . .778
25.4.1HASH control register (HASH_CR) for STM32F415/417xx . . . . .778
25.4.2HASH control register (HASH_CR) for STM32F43xxx . . . . .781
25.4.3HASH data input register (HASH_DIN) . . . . .784
25.4.4HASH start register (HASH_STR) . . . . .785
25.4.5HASH digest registers (HASH_HR0..4/5/6/7) . . . . .786
25.4.6HASH interrupt enable register (HASH_IMR) . . . . .788
25.4.7HASH status register (HASH_SR) . . . . .789
25.4.8HASH context swap registers (HASH_CSRx) . . . . .790
25.4.9HASH register map . . . . .791
26Real-time clock (RTC) . . . . .794
26.1Introduction . . . . .794
26.2RTC main features . . . . .795
26.3RTC functional description797
26.3.1Clock and prescalers797
26.3.2Real-time clock and calendar798
26.3.3Programmable alarms798
26.3.4Periodic auto-wakeup798
26.3.5RTC initialization and configuration799
26.3.6Reading the calendar801
26.3.7Resetting the RTC802
26.3.8RTC synchronization802
26.3.9RTC reference clock detection803
26.3.10RTC coarse digital calibration804
26.3.11RTC smooth digital calibration805
26.3.12Timestamp function807
26.3.13Tamper detection807
26.3.14Calibration clock output809
26.3.15Alarm output809
26.4RTC and low-power modes810
26.5RTC interrupts810
26.6RTC registers812
26.6.1RTC time register (RTC_TR)812
26.6.2RTC date register (RTC_DR)813
26.6.3RTC control register (RTC_CR)814
26.6.4RTC initialization and status register (RTC_ISR)816
26.6.5RTC prescaler register (RTC_PRER)819
26.6.6RTC wake-up timer register (RTC_WUTR)819
26.6.7RTC calibration register (RTC_CALIBR)820
26.6.8RTC alarm A register (RTC_ALRMAR)821
26.6.9RTC alarm B register (RTC_ALRMBR)822
26.6.10RTC write protection register (RTC_WPR)823
26.6.11RTC sub second register (RTC_SSR)823
26.6.12RTC shift control register (RTC_SHIFTR)824
26.6.13RTC time stamp time register (RTC_TSTR)824
26.6.14RTC time stamp date register (RTC_TSDR)825
26.6.15RTC timestamp sub second register (RTC_TSSSR)826
26.6.16RTC calibration register (RTC_CALR)826
26.6.17RTC tamper and alternate function configuration register (RTC_TAFCR)828
26.6.18RTC alarm A sub second register (RTC_ALRMASSR) .....830
26.6.19RTC alarm B sub second register (RTC_ALRMBSSR) .....831
26.6.20RTC backup registers (RTC_BKPxR) .....832
26.6.21RTC register map .....832
27Inter-integrated circuit (I2C) interface .....835
27.1I2C introduction .....835
27.2I2C main features .....835
27.3I2C functional description .....836
27.3.1Mode selection .....836
27.3.2I2C target mode .....839
27.3.3I2C controller mode .....841
27.3.4Error conditions .....846
27.3.5Programmable noise filter .....847
27.3.6SDA/SCL line control .....848
27.3.7SMBus .....848
27.3.8DMA requests .....851
27.3.9Packet error checking .....852
27.4I2C interrupts .....853
27.5I2C debug mode .....855
27.6I2C registers .....855
27.6.1I2C Control register 1 (I2C_CR1) .....855
27.6.2I2C Control register 2 (I2C_CR2) .....857
27.6.3I2C Own address register 1 (I2C_OAR1) .....859
27.6.4I2C Own address register 2 (I2C_OAR2) .....859
27.6.5I2C Data register (I2C_DR) .....860
27.6.6I2C Status register 1 (I2C_SR1) .....860
27.6.7I2C Status register 2 (I2C_SR2) .....863
27.6.8I2C Clock control register (I2C_CCR) .....865
27.6.9I2C TRISE register (I2C_TRISE) .....866
27.6.10I2C FLTR register (I2C_FLTR) .....866
27.6.11I2C register map .....867
28Serial peripheral interface (SPI) .....868
28.1SPI introduction .....868
28.2SPI and I2S main features .....869
28.2.1SPI features .....869
28.2.2I2S features .....869
28.3SPI functional description .....871
28.3.1General description .....871
28.3.2Configuring the SPI in slave mode .....875
28.3.3Configuring the SPI in master mode .....877
28.3.4Configuring the SPI for half-duplex communication .....879
28.3.5Data transmission and reception procedures .....880
28.3.6CRC calculation .....886
28.3.7Status flags .....887
28.3.8Disabling the SPI .....888
28.3.9SPI communication using DMA (direct memory addressing) .....889
28.3.10Error flags .....891
28.3.11SPI interrupts .....893
28.4I2S functional description .....894
28.4.1I2S general description .....894
28.4.2I2S full duplex .....895
28.4.3Supported audio protocols .....896
28.4.4Clock generator .....902
28.4.5I2S master mode .....904
28.4.6I2S slave mode .....906
28.4.7Status flags .....908
28.4.8Error flags .....909
28.4.9I2S interrupts .....910
28.4.10DMA features .....910
28.5SPI and I2S registers .....911
28.5.1SPI control register 1 (SPI_CR1) (not used in I2S mode) .....911
28.5.2SPI control register 2 (SPI_CR2) .....913
28.5.3SPI status register (SPI_SR) .....914
28.5.4SPI data register (SPI_DR) .....915
28.5.5SPI CRC polynomial register (SPI_CRCPR) (not used in I2S mode) .....916
28.5.6SPI RX CRC register (SPI_RXCRCR) (not used in I2S mode) .....916
28.5.7SPI TX CRC register (SPI_TXCRCR) (not used in I2S mode) .....916
28.5.8SPI_I2S configuration register (SPI_I2SCFGR) .....917
28.5.9SPI_I2S prescaler register (SPI_I2SPR) .....918
28.5.10SPI register map .....920
29Serial audio interface (SAI) .....921
29.1Introduction .....921
29.2Main features .....922
29.3Functional block diagram .....923
29.4Main SAI modes .....924
29.5SAI synchronization mode .....925
29.6Audio data size .....925
29.7Frame synchronization .....925
29.7.1Frame length .....926
29.7.2Frame synchronization polarity .....926
29.7.3Frame synchronization active level length .....927
29.7.4Frame synchronization offset .....927
29.7.5FS signal role .....927
29.8Slot configuration .....928
29.9SAI clock generator .....930
29.10Internal FIFOs .....931
29.11AC'97 link controller .....934
29.12Specific features .....935
29.12.1Mute mode .....935
29.12.2MONO/STEREO function .....935
29.12.3Companding mode .....936
29.12.4Output data line management on an inactive slot .....937
29.13Error flags .....939
29.13.1FIFO overrun/underrun (OVRUDR) .....939
29.13.2Anticipated frame synchronisation detection (AFSDDET) .....941
29.13.3Late frame synchronization detection .....941
29.13.4Codec not ready (CNRDY AC'97) .....942
29.13.5Wrong clock configuration in master mode (with NODIV = 0) .....942
29.14Interrupt sources .....943
29.15Disabling the SAI .....943
29.16SAI DMA interface .....944
29.17SAI registers .....945
29.17.1SAI x configuration register 1 (SAI_xCR1) where x is A or B .....945
29.17.2SAI x configuration register 2 (SAI_xCR2) where x is A or B .....948
29.17.3SAI x frame configuration register (SAI_XFRCR) where x is A or B ..950
29.17.4SAI x slot register (SAI_xSLOTR) where x is A or B952
29.17.5SAI x interrupt mask register (SAI_xIM) where x is A or B953
29.17.6SAI x status register (SAI_xSR) where x is A or B955
29.17.7SAI x clear flag register (SAI_xCLRFR) where X is A or B957
29.17.8SAI x data register (SAI_xDR) where x is A or B958
29.17.9SAI register map958
30Universal synchronous asynchronous receiver transmitter (USART)960
30.1USART introduction960
30.2USART main features960
30.3USART functional description961
30.3.1USART character description964
30.3.2Transmitter965
30.3.3Receiver968
30.3.4Fractional baud rate generation973
30.3.5USART receiver tolerance to clock deviation983
30.3.6Multiprocessor communication984
30.3.7Parity control986
30.3.8LIN (local interconnection network) mode987
30.3.9USART synchronous mode989
30.3.10Single-wire half-duplex communication991
30.3.11Smartcard992
30.3.12IrDA SIR ENDEC block994
30.3.13Continuous communication using DMA996
30.3.14Hardware flow control998
30.4USART interrupts1001
30.5USART mode configuration1002
30.6USART registers1002
30.6.1Status register (USART_SR)1002
30.6.2Data register (USART_DR)1005
30.6.3Baud rate register (USART_BRR)1005
30.6.4Control register 1 (USART_CR1)1005
30.6.5Control register 2 (USART_CR2)1008
30.6.6Control register 3 (USART_CR3)1009
30.6.7Guard time and prescaler register (USART_GTPR)1012
30.6.8USART register map1013
31Secure digital input/output interface (SDIO) . . . . .1014
31.1SDIO main features . . . . .1014
31.2SDIO bus topology . . . . .1015
31.3SDIO functional description . . . . .1017
31.3.1SDIO adapter . . . . .1018
31.3.2SDIO APB2 interface . . . . .1028
31.4Card functional description . . . . .1029
31.4.1Card identification mode . . . . .1029
31.4.2Card reset . . . . .1029
31.4.3Operating voltage range validation . . . . .1029
31.4.4Card identification process . . . . .1030
31.4.5Block write . . . . .1031
31.4.6Block read . . . . .1031
31.4.7Stream access, stream write and stream read (MultiMediaCard only) . . . . .1032
31.4.8Erase: group erase and sector erase . . . . .1033
31.4.9Wide bus selection or deselection . . . . .1034
31.4.10Protection management . . . . .1034
31.4.11Card status register . . . . .1037
31.4.12SD status register . . . . .1040
31.4.13SD I/O mode . . . . .1044
31.4.14Commands and responses . . . . .1045
31.5Response formats . . . . .1048
31.5.1R1 (normal response command) . . . . .1049
31.5.2R1b . . . . .1049
31.5.3R2 (CID, CSD register) . . . . .1049
31.5.4R3 (OCR register) . . . . .1049
31.5.5R4 (Fast I/O) . . . . .1050
31.5.6R4b . . . . .1050
31.5.7R5 (interrupt request) . . . . .1051
31.5.8R6 . . . . .1051
31.6SDIO I/O card-specific operations . . . . .1052
31.6.1SDIO I/O read wait operation by SDIO_D2 signaling . . . . .1052
31.6.2SDIO read wait operation by stopping SDIO_CK . . . . .1052
31.6.3SDIO suspend/resume operation . . . . .1053
31.6.4SDIO interrupts . . . . .1053
31.7CE-ATA specific operations1053
31.7.1Command completion signal disable1053
31.7.2Command completion signal enable1053
31.7.3CE-ATA interrupt1054
31.7.4Aborting CMD611054
31.8HW flow control1054
31.9SDIO registers1054
31.9.1SDIO power control register (SDIO_POWER)1054
31.9.2SDI clock control register (SDIO_CLKCR)1055
31.9.3SDIO argument register (SDIO_ARG)1056
31.9.4SDIO command register (SDIO_CMD)1056
31.9.5SDIO command response register (SDIO_RESPCMD)1057
31.9.6SDIO response 1..4 register (SDIO_RESPx)1058
31.9.7SDIO data timer register (SDIO_DTIMER)1058
31.9.8SDIO data length register (SDIO_DLEN)1059
31.9.9SDIO data control register (SDIO_DCTRL)1060
31.9.10SDIO data counter register (SDIO_DCOUNT)1061
31.9.11SDIO status register (SDIO_STA)1061
31.9.12SDIO interrupt clear register (SDIO_ICR)1063
31.9.13SDIO mask register (SDIO_MASK)1064
31.9.14SDIO FIFO counter register (SDIO_FIFOCNT)1067
31.9.15SDIO data FIFO register (SDIO_FIFO)1067
31.9.16SDIO register map1068
32Controller area network (bxCAN)1069
32.1bxCAN introduction1069
32.2bxCAN main features1069
32.3bxCAN general description1070
32.3.1CAN 2.0B active core1070
32.3.2Control, status and configuration registers1071
32.3.3Tx mailboxes1071
32.3.4Acceptance filters1071
32.4bxCAN operating modes1072
32.4.1Initialization mode1073
32.4.2Normal mode1073
32.4.3Sleep mode (low-power)1073
32.5Test mode . . . . .1074
32.5.1Silent mode . . . . .1074
32.5.2Loop back mode . . . . .1075
32.5.3Loop back combined with silent mode . . . . .1075
32.6Debug mode . . . . .1076
32.7bxCAN functional description . . . . .1076
32.7.1Transmission handling . . . . .1076
32.7.2Time triggered communication mode . . . . .1078
32.7.3Reception handling . . . . .1078
32.7.4Identifier filtering . . . . .1080
32.7.5Message storage . . . . .1084
32.7.6Error management . . . . .1086
32.7.7Bit timing . . . . .1086
32.8bxCAN interrupts . . . . .1088
32.9CAN registers . . . . .1090
32.9.1Register access protection . . . . .1090
32.9.2CAN control and status registers . . . . .1090
32.9.3CAN mailbox registers . . . . .1099
32.9.4CAN filter registers . . . . .1104
32.9.5bxCAN register map . . . . .1109
33Ethernet (ETH): media access control (MAC) with DMA controller . . . . .1113
33.1Ethernet introduction . . . . .1113
33.2Ethernet main features . . . . .1113
33.2.1MAC core features . . . . .1114
33.2.2DMA features . . . . .1115
33.2.3PTP features . . . . .1115
33.3Ethernet pins . . . . .1116
33.4Ethernet functional description: SMI, MII and RMII . . . . .1117
33.4.1Station management interface: SMI . . . . .1117
33.4.2Media-independent interface: MII . . . . .1120
33.4.3Reduced media-independent interface: RMII . . . . .1122
33.4.4MII/RMII selection . . . . .1123
33.5Ethernet functional description: MAC 802.3 . . . . .1124
33.5.1MAC 802.3 frame format . . . . .1125
33.5.2MAC frame transmission1128
33.5.3MAC frame reception1135
33.5.4MAC interrupts1140
33.5.5MAC filtering1141
33.5.6MAC loopback mode1144
33.5.7MAC management counters: MMC1144
33.5.8Power management: PMT1145
33.5.9Precision time protocol (IEEE1588 PTP)1148
33.6Ethernet functional description: DMA controller operation1154
33.6.1Initialization of a transfer using DMA1155
33.6.2Host bus burst access1155
33.6.3Host data buffer alignment1156
33.6.4Buffer size calculations1156
33.6.5DMA arbiter1157
33.6.6Error response to DMA1157
33.6.7Tx DMA configuration1157
33.6.8Rx DMA configuration1169
33.6.9DMA interrupts1179
33.7Ethernet interrupts1180
33.8Ethernet register descriptions1181
33.8.1MAC register description1181
33.8.2MMC register description1198
33.8.3IEEE 1588 time stamp registers1204
33.8.4DMA register description1210
33.8.5Ethernet register maps1224
34USB on-the-go full-speed (OTG_FS)1228
34.1OTG_FS introduction1228
34.2OTG_FS main features1229
34.2.1General features1229
34.2.2Host-mode features1230
34.2.3Peripheral-mode features1230
34.3OTG_FS functional description1231
34.3.1OTG pins1231
34.3.2OTG full-speed core1231
34.3.3Full-speed OTG PHY1232
34.4OTG dual role device (DRD) . . . . .1233
34.4.1ID line detection . . . . .1233
34.4.2HNP dual role device . . . . .1233
34.4.3SRP dual role device . . . . .1234
34.5USB peripheral . . . . .1234
34.5.1SRP-capable peripheral . . . . .1235
34.5.2Peripheral states . . . . .1235
34.5.3Peripheral endpoints . . . . .1236
34.6USB host . . . . .1238
34.6.1SRP-capable host . . . . .1239
34.6.2USB host states . . . . .1239
34.6.3Host channels . . . . .1241
34.6.4Host scheduler . . . . .1242
34.7SOF trigger . . . . .1243
34.7.1Host SOFs . . . . .1243
34.7.2Peripheral SOFs . . . . .1244
34.8OTG low-power modes . . . . .1244
34.9Dynamic update of the OTG_FS_HFIR register . . . . .1245
34.10USB data FIFOs . . . . .1246
34.11Peripheral FIFO architecture . . . . .1247
34.11.1Peripheral Rx FIFO . . . . .1247
34.11.2Peripheral Tx FIFOs . . . . .1248
34.12Host FIFO architecture . . . . .1248
34.12.1Host Rx FIFO . . . . .1248
34.12.2Host Tx FIFOs . . . . .1249
34.13FIFO RAM allocation . . . . .1249
34.13.1Device mode . . . . .1249
34.13.2Host mode . . . . .1250
34.14USB system performance . . . . .1250
34.15OTG_FS interrupts . . . . .1251
34.16OTG_FS control and status registers . . . . .1253
34.16.1CSR memory map . . . . .1254
34.16.2OTG_FS global registers . . . . .1259
34.16.3Host-mode registers . . . . .1280
34.16.4Device-mode registers . . . . .1290
34.16.5OTG_FS power and clock gating control register (OTG_FS_PCGCCTL) .....1313
34.16.6OTG_FS register map .....1314
34.17OTG_FS programming model .....1323
34.17.1Core initialization .....1323
34.17.2Host initialization .....1324
34.17.3Device initialization .....1324
34.17.4Host programming model .....1325
34.17.5Device programming model .....1341
34.17.6Operational model .....1343
34.17.7Worst case response time .....1361
34.17.8OTG programming model .....1362
35USB on-the-go high-speed (OTG_HS) .....1369
35.1OTG_HS introduction .....1369
35.2OTG_HS main features .....1369
35.2.1General features .....1370
35.2.2Host-mode features .....1371
35.2.3Peripheral-mode features .....1371
35.3OTG_HS functional description .....1371
35.3.1OTG pins .....1372
35.3.2High-speed OTG PHY .....1372
35.3.3Embedded Full-speed OTG PHY .....1373
35.4OTG dual-role device .....1373
35.4.1ID line detection .....1373
35.4.2HNP dual role device .....1373
35.4.3SRP dual-role device .....1374
35.5USB functional description in peripheral mode .....1374
35.5.1SRP-capable peripheral .....1374
35.5.2Peripheral states .....1375
35.5.3Peripheral endpoints .....1376
35.6USB functional description on host mode .....1379
35.6.1SRP-capable host .....1379
35.6.2USB host states .....1380
35.6.3Host channels .....1381
35.6.4Host scheduler .....1383
35.7SOF trigger1384
35.7.1Host SOFs1384
35.7.2Peripheral SOFs1384
35.8OTG_HS low-power modes1385
35.9Dynamic update of the OTG_HS_HFIR register1386
35.10FIFO RAM allocation1387
35.10.1Peripheral mode1387
35.10.2Host mode1387
35.11OTG_HS interrupts1388
35.12OTG_HS control and status registers1390
35.12.1CSR memory map1390
35.12.2OTG_HS global registers1395
35.12.3Host-mode registers1418
35.12.4Device-mode registers1431
35.12.5OTG_HS power and clock gating control register
(OTG_HS_PCGCCTL)
1460
35.12.6OTG_HS register map1460
35.13OTG_HS programming model1475
35.13.1Core initialization1475
35.13.2Host initialization1476
35.13.3Device initialization1477
35.13.4DMA mode1477
35.13.5Host programming model1477
35.13.6Device programming model1503
35.13.7Operational model1505
35.13.8Worst case response time1524
35.13.9OTG programming model1526
36Flexible static memory controller (FSMC)1532
36.1FSMC main features1532
36.2Block diagram1533
36.3AHB interface1533
36.3.1Supported memories and transactions1534
36.4External device address mapping1535
36.4.1NOR/PSRAM address mapping1535
36.4.2NAND/PC Card address mapping1536
36.5NOR flash/PSRAM controller1537
36.5.1External memory interface signals1538
36.5.2Supported memories and transactions1540
36.5.3General timing rules1541
36.5.4NOR flash/PSRAM controller asynchronous transactions1542
36.5.5Synchronous transactions1559
36.5.6NOR/PSRAM control registers1565
36.6NAND flash/PC Card controller1572
36.6.1External memory interface signals1573
36.6.2NAND flash / PC Card supported memories and transactions1575
36.6.3Timing diagrams for NAND and PC Card1575
36.6.4NAND flash operations1576
36.6.5NAND flash prewait functionality1577
36.6.6Computation of the error correction code (ECC)
in NAND flash memory
1578
36.6.7PC Card/CompactFlash operations1579
36.6.8NAND flash/PC Card control registers1581
36.6.9FSMC register map1588
37Flexible memory controller (FMC)1590
37.1FMC main features1590
37.2Block diagram1591
37.3AHB interface1592
37.3.1Supported memories and transactions1593
37.4External device address mapping1594
37.4.1NOR/PSRAM address mapping1595
37.4.2NAND Flash memory/PC Card address mapping1596
37.4.3SDRAM address mapping1597
37.5NOR Flash/PSRAM controller1600
37.5.1External memory interface signals1601
37.5.2Supported memories and transactions1603
37.5.3General timing rules1605
37.5.4NOR Flash/PSRAM controller asynchronous transactions1605
37.5.5Synchronous transactions1622
37.5.6NOR/PSRAM controller registers1628
37.6NAND Flash/PC Card controller1635
37.6.1External memory interface signals1636
37.6.2NAND Flash / PC Card supported memories and transactions . . . . .1638
37.6.3Timing diagrams for NAND Flash memory and PC Card . . . . .1638
37.6.4NAND Flash operations . . . . .1639
37.6.5NAND Flash prewait functionality . . . . .1640
37.6.6Computation of the error correction code (ECC)
in NAND Flash memory . . . . .
1641
37.6.7PC Card/CompactFlash operations . . . . .1642
37.6.8NAND Flash/PC Card controller registers . . . . .1644
37.7SDRAM controller . . . . .1651
37.7.1SDRAM controller main features . . . . .1651
37.7.2SDRAM External memory interface signals . . . . .1651
37.7.3SDRAM controller functional description . . . . .1652
37.7.4Low power modes . . . . .1659
37.7.5SDRAM controller registers . . . . .1662
37.8FMC register map . . . . .1668
38Debug support (DBG) . . . . .1671
38.1Overview . . . . .1671
38.2Reference Arm® documentation . . . . .1672
38.3SWJ debug port (serial wire and JTAG) . . . . .1672
38.3.1Mechanism to select the JTAG-DP or the SW-DP . . . . .1673
38.4Pinout and debug port pins . . . . .1673
38.4.1SWJ debug port pins . . . . .1674
38.4.2Flexible SWJ-DP pin assignment . . . . .1674
38.4.3Internal pull-up and pull-down on JTAG pins . . . . .1674
38.4.4Using serial wire and releasing the unused debug pins as GPIOs . . . . .1675
38.5STM32F4xx JTAG TAP connection . . . . .1675
38.6ID codes and locking mechanism . . . . .1676
38.6.1MCU device ID code . . . . .1676
38.6.2Boundary scan TAP . . . . .1677
38.6.3Cortex®-M4 with FPU TAP . . . . .1678
38.6.4Cortex®-M4 with FPU JEDEC-106 ID code . . . . .1678
38.7JTAG debug port . . . . .1678
38.8SW debug port . . . . .1680
38.8.1SW protocol introduction . . . . .1680
38.8.2SW protocol sequence . . . . .1680
38.8.3SW-DP state machine (reset, idle states, ID code) . . . . .1681
38.8.4DP and AP read/write accesses . . . . .1681
38.8.5SW-DP registers . . . . .1682
38.8.6SW-AP registers . . . . .1682
38.9AHB-AP (AHB access port) - valid for both JTAG-DP and SW-DP . . . . .1683
38.10Core debug . . . . .1683
38.11Capability of the debugger host to connect under system reset . . . . .1684
38.12FPB (Flash patch breakpoint) . . . . .1685
38.13DWT (data watchpoint trigger) . . . . .1686
38.14ITM (instrumentation trace macrocell) . . . . .1686
38.14.1General description . . . . .1686
38.14.2Time stamp packets, synchronization and overflow packets . . . . .1686
38.15ETM (Embedded Trace Macrocell™) . . . . .1688
38.15.1ETM general description . . . . .1688
38.15.2ETM signal protocol and packet types . . . . .1688
38.15.3Main ETM registers . . . . .1689
38.15.4ETM configuration example . . . . .1689
38.16MCU debug component (DBGMCU) . . . . .1689
38.16.1Debug support for low-power modes . . . . .1689
38.16.2Debug support for timers, watchdog, bxCAN and I2C . . . . .1690
38.16.3Debug MCU configuration register . . . . .1690
38.16.4Debug MCU APB1 freeze register (DBGMCU_APB1_FZ) . . . . .1692
38.16.5Debug MCU APB2 Freeze register (DBGMCU_APB2_FZ) . . . . .1693
38.17TPIU (trace port interface unit) . . . . .1694
38.17.1Introduction . . . . .1694
38.17.2TRACE pin assignment . . . . .1695
38.17.3TPUI formatter . . . . .1696
38.17.4TPUI frame synchronization packets . . . . .1697
38.17.5Transmission of the synchronization frame packet . . . . .1697
38.17.6Synchronous mode . . . . .1697
38.17.7Asynchronous mode . . . . .1698
38.17.8TRACECLKIN connection inside the STM32F4xx . . . . .1698
38.17.9TPIU registers . . . . .1698
38.17.10Example of configuration . . . . .1699
38.18DBG register map . . . . .1700
39Device electronic signature .....1701
39.1 Unique device ID register (96 bits) .....1701
39.2 Flash size .....1702
40Important security notice .....1703
41Revision history .....1704

List of tables

Table 1.STM32F4xx register boundary addresses .....64
Table 2.Boot modes.....69
Table 3.Memory mapping vs. Boot mode/physical remap
in STM32F405xx/07xx and STM32F415xx/17xx .....
71
Table 4.Memory mapping vs. Boot mode/physical remap
in STM32F42xxx and STM32F43xxx .....
71
Table 5.Flash module organization (STM32F40x and STM32F41x) .....75
Table 6.Flash module - 2 Mbyte dual bank organization (STM32F42xxx and STM32F43xxx) .....77
Table 7.1 Mbyte flash memory single bank vs dual bank organization
(STM32F42xxx and STM32F43xxx) .....
78
Table 8.1 Mbyte single bank flash memory organization
(STM32F42xxx and STM32F43xxx) .....
78
Table 9.1 Mbyte dual bank flash memory organization (STM32F42xxx and STM32F43xxx) .....79
Table 10.512 Kbyte single bank flash memory organization
(STM32F42xxx and STM32F43xxx) .....
80
Table 11.Number of wait states according to CPU clock (HCLK) frequency
(STM32F405xx/07xx and STM32F415xx/17xx) .....
81
Table 12.Number of wait states according to CPU clock (HCLK) frequency
(STM32F42xxx and STM32F43xxx) .....
81
Table 13.Maximum program/erase parallelism .....85
Table 14.Flash interrupt request .....88
Table 15.Option byte organization.....88
Table 16.Description of the option bytes (STM32F405xx/07xx and STM32F415xx/17xx) .....89
Table 17.Description of the option bytes
(STM32F42xxx and STM32F43xxx) .....
90
Table 18.Access versus read protection level .....94
Table 19.OTP area organization .....97
Table 20.Flash register map and reset values
(STM32F405xx/07xx and STM32F415xx/17xx) .....
111
Table 21.Flash register map and reset values (STM32F42xxx and STM32F43xxx) .....111
Table 22.CRC calculation unit register map and reset values .....115
Table 23.Voltage regulator configuration mode versus device operating mode .....122
Table 24.Low-power mode summary .....128
Table 25.Sleep-now entry and exit .....129
Table 26.Sleep-on-exit entry and exit .....130
Table 27.Stop operating modes
(STM32F405xx/07xx and STM32F415xx/17xx) .....
131
Table 28.Stop mode entry and exit (for STM32F405xx/07xx and STM32F415xx/17xx) .....132
Table 29.Stop operating modes (STM32F42xxx and STM32F43xxx) .....134
Table 30.Stop mode entry and exit (STM32F42xxx and STM32F43xxx) .....136
Table 31.Standby mode entry and exit .....137
Table 32.PWR - register map and reset values for
STM32F405xx/07xx and STM32F415xx/17xx .....
150
Table 33.PWR - register map and reset values for STM32F42xxx and STM32F43xxx .....150
Table 34.RCC register map and reset values for STM32F42xxx and STM32F43xxx .....211
Table 35.RCC register map and reset values .....266
Table 36.Port bit configuration table .....270
Table 37.Flexible SWJ-DP pin assignment .....273
Table 38.RTC_AF1 pin .....281
Table 39.RTC_AF2 pin .....282
Table 40.GPIO register map and reset values .....289
Table 41.SYSCFG register map and reset values
(STM32F405xx/07xx and STM32F415xx/17xx) .....
296
Table 42.SYSCFG register map and reset values (STM32F42xxx and STM32F43xxx) .....303
Table 43.DMA1 request mapping .....309
Table 44.DMA2 request mapping .....310
Table 45.Source and destination address .....311
Table 46.Source and destination address registers in Double buffer mode (DBM=1) .....316
Table 47.Packing/unpacking & endian behavior (bit PINC = MINC = 1) .....317
Table 48.Restriction on NDT versus PSIZE and MSIZE .....318
Table 49.FIFO threshold configurations .....320
Table 50.Possible DMA configurations .....324
Table 51.DMA interrupt requests .....326
Table 52.DMA register map and reset values .....337
Table 53.Supported color mode in input .....344
Table 54.Data order in memory .....345
Table 55.Alpha mode configuration .....346
Table 56.Supported CLUT color mode .....347
Table 57.CLUT data order in memory .....347
Table 58.Supported color mode in output .....348
Table 59.Data order in memory .....348
Table 60.DMA2D interrupt requests .....353
Table 61.DMA2D register map and reset values .....371
Table 62.Vector table for STM32F405xx/07xx and STM32F415xx/17xx .....374
Table 63.Vector table for STM32F42xxx and STM32F43xxx .....377
Table 64.External interrupt/event controller register map and reset values .....389
Table 65.ADC pins .....392
Table 66.Analog watchdog channel selection .....395
Table 67.Configuring the trigger polarity .....399
Table 68.External trigger for regular channels .....400
Table 69.External trigger for injected channels .....401
Table 70.ADC interrupts .....416
Table 71.ADC global register map .....432
Table 72.ADC register map and reset values for each ADC .....433
Table 73.ADC register map and reset values (common ADC registers) .....434
Table 74.DAC pins .....436
Table 75.External triggers .....439
Table 76.DAC register map .....455
Table 77.DCMI pins .....457
Table 78.DCMI signals .....459
Table 79.Positioning of captured data bytes in 32-bit words (8-bit width) .....460
Table 80.Positioning of captured data bytes in 32-bit words (10-bit width) .....460
Table 81.Positioning of captured data bytes in 32-bit words (12-bit width) .....461
Table 82.Positioning of captured data bytes in 32-bit words (14-bit width) .....461
Table 83.Data storage in monochrome progressive video format .....468
Table 84.Data storage in RGB progressive video format .....468
Table 85.Data storage in YCbCr progressive video format .....469
Table 86.DCMI interrupts .....469
Table 87.DCMI register map and reset values .....478
Table 88.LTDC registers versus clock domain .....482
Table 89.LCD-TFT pins and signal interface . . . . .483
Table 90.Pixel Data mapping versus Color Format . . . . .487
Table 91.LTDC interrupt requests . . . . .491
Table 92.LTDC register map and reset values . . . . .512
Table 93.Counting direction versus encoder signals . . . . .552
Table 94.TIMx Internal trigger connection . . . . .565
Table 95.Output control bits for complementary OCx and OCxN channels with break feature. . . . .576
Table 96.TIM1 and TIM8 register map and reset values . . . . .584
Table 97.Counting direction versus encoder signals . . . . .613
Table 98.TIMx internal trigger connection . . . . .628
Table 99.Output control bit for standard OCx channels. . . . .637
Table 100.TIM2 to TIM5 register map and reset values . . . . .644
Table 101.TIMx internal trigger connection . . . . .670
Table 102.Output control bit for standard OCx channels. . . . .678
Table 103.TIM9/12 register map and reset values . . . . .680
Table 104.Output control bit for standard OCx channels. . . . .687
Table 105.TIM10/11/13/14 register map and reset values . . . . .690
Table 106.TIM6 and TIM7 register map and reset values . . . . .703
Table 107.Min/max IWDG timeout period (in ms) at 32 kHz (LSI). . . . .705
Table 108.IWDG register map and reset values . . . . .708
Table 109.Minimum and maximum timeout values at 30 MHz (\(f_{PCLK1}\)). . . . .712
Table 110.WWDG register map and reset values . . . . .715
Table 111.Number of cycles required to process each 128-bit block (STM32F415/417xx). . . . .716
Table 112.Number of cycles required to process each 128-bit block (STM32F43xxx) . . . . .716
Table 113.Data types. . . . .736
Table 114.CRYP register map and reset values for STM32F415/417xx. . . . .759
Table 115.CRYP register map and reset values for STM32F43xxx . . . . .760
Table 116.RNG register map and reset map. . . . .767
Table 117.HASH register map and reset values on STM32F415/417xx. . . . .791
Table 118.HASH register map and reset values on STM32F43xxx . . . . .792
Table 119.Effect of low-power modes on RTC . . . . .810
Table 120.Interrupt control bits . . . . .811
Table 121.RTC register map and reset values . . . . .832
Table 122.Maximum DNF[3:0] value to be compliant with Thd:dat(max) . . . . .847
Table 123.SMBus vs. I2C . . . . .849
Table 124.I2C Interrupt requests. . . . .853
Table 125.I2C register map and reset values . . . . .867
Table 126.SPI interrupt requests. . . . .893
Table 127.Audio frequency precision (for PLLM VCO = 1 MHz or 2 MHz) . . . . .904
Table 128.I2S interrupt requests . . . . .910
Table 129.SPI register map and reset values . . . . .920
Table 130.Example of possible audio frequency sampling range . . . . .931
Table 131.Interrupt sources. . . . .943
Table 132.SAI register map and reset values . . . . .958
Table 133.Noise detection from sampled data . . . . .972
Table 134.Error calculation for programmed baud rates at \(f_{PCLK} = 8\) MHz or \(f_{PCLK} = 12\) MHz, oversampling by 16. . . . .975
Table 135.Error calculation for programmed baud rates at \(f_{PCLK} = 8\) MHz or \(f_{PCLK} = 12\) MHz, oversampling by 8. . . . .976
Table 136.Error calculation for programmed baud rates at \(f_{PCLK} = 16\) MHz or \(f_{PCLK} = 24\) MHz, oversampling by 16. ....976
Table 137.Error calculation for programmed baud rates at \(f_{PCLK} = 16\) MHz or \(f_{PCLK} = 24\) MHz, oversampling by 8. ....977
Table 138.Error calculation for programmed baud rates at \(f_{PCLK} = 8\) MHz or \(f_{PCLK} = 16\) MHz, oversampling by 16. ....978
Table 139.Error calculation for programmed baud rates at \(f_{PCLK} = 8\) MHz or \(f_{PCLK} = 16\) MHz, oversampling by 8. ....978
Table 140.Error calculation for programmed baud rates at \(f_{PCLK} = 30\) MHz or \(f_{PCLK} = 60\) MHz, oversampling by 16. ....979
Table 141.Error calculation for programmed baud rates at \(f_{PCLK} = 30\) MHz or \(f_{PCLK} = 60\) MHz, oversampling by 8. ....980
Table 142.Error calculation for programmed baud rates at \(f_{PCLK} = 42\) MHz or \(f_{PCLK} = 84\) MHz, oversampling by 16. ....981
Table 143.Error calculation for programmed baud rates at \(f_{PCLK} = 42\) MHz or \(f_{PCLK} = 84\) MHz, oversampling by 8. ....982
Table 144.USART receiver's tolerance when DIV fraction is 0. ....983
Table 145.USART receiver tolerance when DIV_Fraction is different from 0. ....984
Table 146.Frame formats. ....986
Table 147.USART interrupt requests. ....1001
Table 148.USART mode configuration. ....1002
Table 149.USART register map and reset values. ....1013
Table 150.SDIO I/O definitions. ....1018
Table 151.Command format. ....1022
Table 152.Short response format. ....1023
Table 153.Long response format. ....1023
Table 154.Command path status flags. ....1023
Table 155.Data token format. ....1026
Table 156.Transmit FIFO status flags. ....1027
Table 157.Receive FIFO status flags. ....1028
Table 158.Card status. ....1038
Table 159.SD status. ....1040
Table 160.Speed class code field. ....1042
Table 161.Performance move field. ....1042
Table 162.AU_SIZE field. ....1042
Table 163.Maximum AU size. ....1043
Table 164.Erase size field. ....1043
Table 165.Erase timeout field. ....1043
Table 166.Erase offset field. ....1044
Table 167.Block-oriented write commands. ....1046
Table 168.Block-oriented write protection commands. ....1047
Table 169.Erase commands. ....1047
Table 170.I/O mode commands. ....1047
Table 171.Lock card. ....1048
Table 172.Application-specific commands. ....1048
Table 173.R1 response. ....1049
Table 174.R2 response. ....1049
Table 175.R3 response. ....1050
Table 176.R4 response. ....1050
Table 177.R4b response. ....1050
Table 178.R5 response. ....1051
Table 179.R6 response. ....1051
Table 180.Response type and SDIO_RESPx registers. ....1058
Table 181.SDIO register map .....1068
Table 182.Transmit mailbox mapping .....1084
Table 183.Receive mailbox mapping. ....1084
Table 184.bxCAN register map and reset values .....1109
Table 185.Alternate function mapping. ....1116
Table 186.Management frame format .....1118
Table 187.Clock range. ....1120
Table 188.TX interface signal encoding .....1121
Table 189.RX interface signal encoding .....1122
Table 190.Frame statuses .....1137
Table 191.Destination address filtering .....1143
Table 192.Source address filtering .....1144
Table 193.Receive descriptor 0 - encoding for bits 7, 5 and 0 (normal descriptor
format only, EDFE=0) .....
1174
Table 194.Time stamp snapshot dependency on registers bits .....1206
Table 195.Ethernet register map and reset values .....1224
Table 196.OTG_FS input/output pins .....1231
Table 197.Compatibility of STM32 low power modes with the OTG .....1244
Table 198.Core global control and status registers (CSRs). ....1254
Table 199.Host-mode control and status registers (CSRs) .....1255
Table 200.Device-mode control and status registers .....1256
Table 201.Data FIFO (DFIFO) access register map .....1257
Table 202.Power and clock gating control and status registers .....1258
Table 203.TRDT values. ....1264
Table 204.Minimum duration for soft disconnect. ....1292
Table 205.OTG_FS register map and reset values .....1314
Table 206.OTG_HS input/output pins .....1372
Table 207.Compatibility of STM32 low power modes with the OTG .....1385
Table 208.Core global control and status registers (CSRs). ....1391
Table 209.Host-mode control and status registers (CSRs) .....1392
Table 210.Device-mode control and status registers .....1393
Table 211.Data FIFO (DFIFO) access register map .....1395
Table 212.Power and clock gating control and status registers .....1395
Table 213.TRDT values. ....1402
Table 214.Minimum duration for soft disconnect. ....1434
Table 215.OTG_HS register map and reset values. ....1460
Table 216.NOR/PSRAM bank selection .....1536
Table 217.External memory address. ....1536
Table 218.Memory mapping and timing registers .....1536
Table 219.NAND bank selections .....1537
Table 220.Programmable NOR/PSRAM access parameters .....1538
Table 221.Nonmultiplexed I/O NOR flash .....1538
Table 222.Multiplexed I/O NOR flash .....1539
Table 223.Nonmultiplexed I/Os PSRAM/SRAM .....1539
Table 224.Multiplexed I/O PSRAM .....1540
Table 225.NOR flash/PSRAM controller: example of supported memories and transactions. ....1540
Table 226.FSMC_BCRx bit fields .....1543
Table 227.FSMC_BTRx bit fields .....1544
Table 228.FSMC_BCRx bit fields .....1545
Table 229.FSMC_BTRx bit fields .....1546
Table 230.FSMC_BWTRx bit fields. ....1546
Table 231.FSMC_BCRx bit fields1548
Table 232.FSMC_BTRx bit fields1549
Table 233.FSMC_BWTRx bit fields1549
Table 234.FSMC_BCRx bit fields1551
Table 235.FSMC_BTRx bit fields1551
Table 236.FSMC_BWTRx bit fields1552
Table 237.FSMC_BCRx bit fields1553
Table 238.FSMC_BTRx bit fields1554
Table 239.FSMC_BWTRx bit fields1554
Table 240.FSMC_BCRx bit fields1556
Table 241.FSMC_BTRx bit fields1556
Table 242.FSMC_BCRx bit fields1561
Table 243.FSMC_BTRx bit fields1562
Table 244.FSMC_BCRx bit fields1563
Table 245.FSMC_BTRx bit fields1564
Table 246.Programmable NAND/PC Card access parameters1573
Table 247.8-bit NAND flash1573
Table 248.16-bit NAND flash1574
Table 249.16-bit PC Card1574
Table 250.Supported memories and transactions1575
Table 251.16-bit PC-Card signals and access type1580
Table 252.ECC result relevant bits1587
Table 253.FSMC register map1588
Table 254.NOR/PSRAM bank selection1595
Table 255.NOR/PSRAM External memory address1596
Table 256.NAND/PC Card memory mapping and timing registers1596
Table 257.NAND bank selection1597
Table 258.SDRAM bank selection1597
Table 259.SDRAM address mapping1597
Table 260.SDRAM address mapping with 8-bit data bus width1598
Table 261.SDRAM address mapping with 16-bit data bus width1599
Table 262.SDRAM address mapping with 32-bit data bus width1599
Table 263.Programmable NOR/PSRAM access parameters1601
Table 264.Non-multiplexed I/O NOR Flash memory1602
Table 265.16-bit multiplexed I/O NOR Flash memory1602
Table 266.Non-multiplexed I/Os PSRAM/SRAM1602
Table 267.16-Bit multiplexed I/O PSRAM1603
Table 268.NOR Flash/PSRAM: Example of supported memories and transactions1604
Table 269.FMC_BCRx bit fields1607
Table 270.FMC_BTRx bit fields1607
Table 271.FMC_BCRx bit fields1609
Table 272.FMC_BTRx bit fields1610
Table 273.FMC_BWTRx bit fields1610
Table 274.FMC_BCRx bit fields1612
Table 275.FMC_BTRx bit fields1613
Table 276.FMC_BWTRx bit fields1613
Table 277.FMC_BCRx bit fields1615
Table 278.FMC_BTRx bit fields1615
Table 279.FMC_BWTRx bit fields1616
Table 280.FMC_BCRx bit fields1617
Table 281.FMC_BTRx bit fields1618
Table 282.FMC_BWTRx bit fields1618
Table 283.FMC_BCRx bit fields .....1620
Table 284.FMC_BTRx bit fields.....1620
Table 285.FMC_BCRx bit fields .....1625
Table 286.FMC_BTRx bit fields.....1625
Table 287.FMC_BCRx bit fields .....1626
Table 288.FMC_BTRx bit fields.....1627
Table 289.Programmable NAND Flash/PC Card access parameters .....1636
Table 290.8-bit NAND Flash .....1636
Table 291.16-bit NAND Flash .....1637
Table 292.16-bit PC Card .....1637
Table 293.Supported memories and transactions.....1638
Table 294.16-bit PC-Card signals and access type.....1643
Table 295.ECC result relevant bits .....1650
Table 296.SDRAM signals.....1651
Table 297.FMC register map .....1668
Table 298.SWJ debug port pins .....1674
Table 299.Flexible SWJ-DP pin assignment .....1674
Table 300.JTAG debug port data registers .....1678
Table 301.32-bit debug port registers addressed through the shifted value A[3:2] .....1679
Table 302.Packet request (8-bits) .....1680
Table 303.ACK response (3 bits).....1681
Table 304.DATA transfer (33 bits).....1681
Table 305.SW-DP registers .....1682
Table 306.Cortex®-M4 with FPU AHB-AP registers.....1683
Table 307.Core debug registers .....1684
Table 308.Main ITM registers .....1687
Table 309.Main ETM registers.....1689
Table 310.Asynchronous TRACE pin assignment.....1695
Table 311.Synchronous TRACE pin assignment .....1695
Table 312.Flexible TRACE pin assignment.....1696
Table 313.Important TPIU registers.....1698
Table 314.DBG register map and reset values .....1700
Table 315.Document revision history .....1704

List of figures

Figure 1.System architecture for STM32F405xx/07xx and STM32F415xx/17xx devices. ....60
Figure 2.System architecture for STM32F42xxx and STM32F43xxx devices .....62
Figure 3.Flash memory interface connection inside system architecture
(STM32F405xx/07xx and STM32F415xx/17xx) .....
73
Figure 4.Flash memory interface connection inside system architecture
(STM32F42xxx and STM32F43xxx) .....
74
Figure 5.Sequential 32-bit instruction execution .....83
Figure 6.RDP levels .....94
Figure 7.PCROP levels .....96
Figure 8.CRC calculation unit block diagram .....113
Figure 9.Power supply overview for STM32F405xx/07xx and STM32F415xx/17xx .....116
Figure 10.Power supply overview for STM32F42xxx and STM32F43xxx .....117
Figure 11.Backup domain .....120
Figure 12.Power-on reset/power-down reset waveform .....124
Figure 13.BOR thresholds .....125
Figure 14.PVD thresholds .....126
Figure 15.Simplified diagram of the reset circuit .....152
Figure 16.Clock tree .....153
Figure 17.HSE/ LSE clock sources .....155
Figure 18.Frequency measurement with TIM5 in Input capture mode .....160
Figure 19.Frequency measurement with TIM11 in Input capture mode .....161
Figure 20.Simplified diagram of the reset circuit .....215
Figure 21.Clock tree .....217
Figure 22.HSE/ LSE clock sources .....219
Figure 23.Frequency measurement with TIM5 in Input capture mode .....224
Figure 24.Frequency measurement with TIM11 in Input capture mode .....224
Figure 25.Basic structure of a 5 V-tolerant I/O port bit .....270
Figure 26.Selecting an alternate function on STM32F405xx/07xx and STM32F415xx/17xx .....274
Figure 27.Selecting an alternate function on STM32F42xxx and STM32F43xxx .....275
Figure 28.Input floating/pull up/pull down configurations .....278
Figure 29.Output configuration .....279
Figure 30.Alternate function configuration .....279
Figure 31.High impedance-analog configuration .....280
Figure 32.DMA block diagram .....306
Figure 33.System implementation of the two DMA controllers
(STM32F405xx/07xx and STM32F415xx/17xx) .....
307
Figure 34.System implementation of the two DMA controllers
(STM32F42xxx and STM32F43xxx) .....
308
Figure 35.Channel selection .....309
Figure 36.Peripheral-to-memory mode .....312
Figure 37.Memory-to-peripheral mode .....313
Figure 38.Memory-to-memory mode .....314
Figure 39.FIFO structure .....319
Figure 40.DMA2D block diagram .....343
Figure 41.External interrupt/event controller block diagram .....382
Figure 42.External interrupt/event GPIO mapping ( STM32F405xx/07xx and STM32F415xx/17xx) .....384
Figure 43.External interrupt/event GPIO mapping (STM32F42xxx and STM32F43xxx) .....385
Figure 44.Single ADC block diagram .....391
Figure 45.Timing diagram394
Figure 46.Analog watchdog's guarded area395
Figure 47.Injected conversion latency396
Figure 48.Right alignment of 12-bit data398
Figure 49.Left alignment of 12-bit data398
Figure 50.Left alignment of 6-bit data398
Figure 51.Multi ADC block diagram(1)404
Figure 52.Injected simultaneous mode on 4 channels: dual ADC mode407
Figure 53.Injected simultaneous mode on 4 channels: triple ADC mode407
Figure 54.Regular simultaneous mode on 16 channels: dual ADC mode408
Figure 55.Regular simultaneous mode on 16 channels: triple ADC mode408
Figure 56.Interleaved mode on 1 channel in continuous conversion mode: dual ADC mode409
Figure 57.Interleaved mode on 1 channel in continuous conversion mode: triple ADC mode410
Figure 58.Alternate trigger: injected group of each ADC411
Figure 59.Alternate trigger: 4 injected channels (each ADC) in discontinuous mode412
Figure 60.Alternate trigger: injected group of each ADC412
Figure 61.Alternate + regular simultaneous413
Figure 62.Case of trigger occurring during injected conversion414
Figure 63.Temperature sensor and VREFINT channel block diagram415
Figure 64.DAC channel block diagram436
Figure 65.Data registers in single DAC channel mode438
Figure 66.Data registers in dual DAC channel mode438
Figure 67.Timing diagram for conversion with trigger disabled TEN = 0439
Figure 68.DAC LFSR register calculation algorithm441
Figure 69.DAC conversion (SW trigger enabled) with LFSR wave generation441
Figure 70.DAC triangle wave generation442
Figure 71.DAC conversion (SW trigger enabled) with triangle wave generation442
Figure 72.DCMI block diagram458
Figure 73.Top-level block diagram459
Figure 74.DCMI signal waveforms460
Figure 75.Timing diagram462
Figure 76.Frame capture waveforms in Snapshot mode464
Figure 77.Frame capture waveforms in continuous grab mode465
Figure 78.Coordinates and size of the window after cropping466
Figure 79.Data capture waveforms466
Figure 80.Pixel raster scan order467
Figure 81.LTDC block diagram481
Figure 82.LCD-TFT Synchronous timings484
Figure 83.Layer window programmable parameters487
Figure 84.Blending two layers with background490
Figure 85.Interrupt events491
Figure 86.Advanced-control timer block diagram516
Figure 87.Counter timing diagram with prescaler division change from 1 to 2518
Figure 88.Counter timing diagram with prescaler division change from 1 to 4518
Figure 89.Counter timing diagram, internal clock divided by 1519
Figure 90.Counter timing diagram, internal clock divided by 2520
Figure 91.Counter timing diagram, internal clock divided by 4520
Figure 92.Counter timing diagram, internal clock divided by N520
Figure 93.Counter timing diagram, update event when ARPE=0 (TIMx_ARR not preloaded)521
Figure 94.Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded)521
Figure 95.Counter timing diagram, internal clock divided by 1523
Figure 96.Counter timing diagram, internal clock divided by 2523
Figure 97.Counter timing diagram, internal clock divided by 4524
Figure 98.Counter timing diagram, internal clock divided by N524
Figure 99.Counter timing diagram, update event when repetition counter is not used525
Figure 100.Counter timing diagram, internal clock divided by 1, TIMx_ARR=0x6526
Figure 101.Counter timing diagram, internal clock divided by 2526
Figure 102.Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36527
Figure 103.Counter timing diagram, internal clock divided by N527
Figure 104.Counter timing diagram, update event with ARPE=1 (counter underflow)528
Figure 105.Counter timing diagram, Update event with ARPE=1 (counter overflow)528
Figure 106.Update rate examples depending on mode and TIMx_RCR register settings530
Figure 107.Control circuit in normal mode, internal clock divided by 1531
Figure 108.TI2 external clock connection example532
Figure 109.Control circuit in external clock mode 1533
Figure 110.External trigger input block533
Figure 111.Control circuit in external clock mode 2534
Figure 112.Capture/compare channel (example: channel 1 input stage)535
Figure 113.Capture/compare channel 1 main circuit535
Figure 114.Output stage of capture/compare channel (channel 1 to 3)536
Figure 115.Output stage of capture/compare channel (channel 4)536
Figure 116.PWM input mode timing538
Figure 117.Output compare mode, toggle on OC1540
Figure 118.Edge-aligned PWM waveforms (ARR=8)541
Figure 119.Center-aligned PWM waveforms (ARR=8)542
Figure 120.Complementary output with dead-time insertion544
Figure 121.Dead-time waveforms with delay greater than the negative pulse544
Figure 122.Dead-time waveforms with delay greater than the positive pulse544
Figure 123.Output behavior in response to a break547
Figure 124.Clearing TIMx OCxREF548
Figure 125.6-step generation, COM example (OSSR=1)549
Figure 126.Example of one pulse mode550
Figure 127.Example of counter operation in encoder interface mode553
Figure 128.Example of encoder interface mode with TI1FP1 polarity inverted553
Figure 129.Example of Hall sensor interface555
Figure 130.Control circuit in reset mode556
Figure 131.Control circuit in gated mode557
Figure 132.Control circuit in trigger mode558
Figure 133.Control circuit in external clock mode 2 + trigger mode559
Figure 134.General-purpose timer block diagram587
Figure 135.Counter timing diagram with prescaler division change from 1 to 2589
Figure 136.Counter timing diagram with prescaler division change from 1 to 4589
Figure 137.Counter timing diagram, internal clock divided by 1590
Figure 138.Counter timing diagram, internal clock divided by 2590
Figure 139.Counter timing diagram, internal clock divided by 4591
Figure 140.Counter timing diagram, internal clock divided by N591
Figure 141.Counter timing diagram, Update event when ARPE=0 (TIMx_ARR not preloaded)592
Figure 142.Counter timing diagram, Update event when ARPE=1 (TIMx_ARR preloaded)592
Figure 143.Counter timing diagram, internal clock divided by 1593
Figure 144.Counter timing diagram, internal clock divided by 2594
Figure 145.Counter timing diagram, internal clock divided by 4594
Figure 146.Counter timing diagram, internal clock divided by N594
Figure 147.Counter timing diagram, Update event595
Figure 148.Counter timing diagram, internal clock divided by 1, TIMx_ARR=0x6596
Figure 149. Counter timing diagram, internal clock divided by 2 . . . . .596
Figure 150. Counter timing diagram, internal clock divided by 4, TIMx_ARR=0x36 . . . . .597
Figure 151. Counter timing diagram, internal clock divided by N . . . . .597
Figure 152. Counter timing diagram, Update event with ARPE=1 (counter underflow) . . . . .598
Figure 153. Counter timing diagram, Update event with ARPE=1 (counter overflow) . . . . .598
Figure 154. Control circuit in normal mode, internal clock divided by 1 . . . . .599
Figure 155. TI2 external clock connection example . . . . .600
Figure 156. Control circuit in external clock mode 1 . . . . .601
Figure 157. External trigger input block . . . . .601
Figure 158. Control circuit in external clock mode 2 . . . . .602
Figure 159. Capture/compare channel (example: channel 1 input stage) . . . . .602
Figure 160. Capture/compare channel 1 main circuit . . . . .603
Figure 161. Output stage of capture/compare channel (channel 1) . . . . .603
Figure 162. PWM input mode timing . . . . .605
Figure 163. Output compare mode, toggle on OC1 . . . . .607
Figure 164. Edge-aligned PWM waveforms (ARR=8) . . . . .608
Figure 165. Center-aligned PWM waveforms (ARR=8) . . . . .609
Figure 166. Example of one-pulse mode . . . . .610
Figure 167. Clearing TIMx OCxREF . . . . .612
Figure 168. Example of counter operation in encoder interface mode . . . . .614
Figure 169. Example of encoder interface mode with TI1FP1 polarity inverted . . . . .614
Figure 170. Control circuit in reset mode . . . . .615
Figure 171. Control circuit in gated mode . . . . .616
Figure 172. Control circuit in trigger mode . . . . .617
Figure 173. Control circuit in external clock mode 2 + trigger mode . . . . .618
Figure 174. Master/Slave timer example . . . . .618
Figure 175. Gating timer 2 with OC1REF of timer 1 . . . . .619
Figure 176. Gating timer 2 with Enable of timer 1 . . . . .620
Figure 177. Triggering timer 2 with update of timer 1 . . . . .621
Figure 178. Triggering timer 2 with Enable of timer 1 . . . . .622
Figure 179. Triggering timer 1 and 2 with timer 1 TI1 input . . . . .623
Figure 180. General-purpose timer block diagram (TIM9 and TIM12) . . . . .647
Figure 181. General-purpose timer block diagram (TIM10/11/13/14) . . . . .648
Figure 182. Counter timing diagram with prescaler division change from 1 to 2 . . . . .650
Figure 183. Counter timing diagram with prescaler division change from 1 to 4 . . . . .650
Figure 184. Counter timing diagram, internal clock divided by 1 . . . . .651
Figure 185. Counter timing diagram, internal clock divided by 2 . . . . .652
Figure 186. Counter timing diagram, internal clock divided by 4 . . . . .652
Figure 187. Counter timing diagram, internal clock divided by N . . . . .652
Figure 188. Counter timing diagram, update event when ARPE=0 (TIMx_ARR not preloaded) . . . . .653
Figure 189. Counter timing diagram, update event when ARPE=1 (TIMx_ARR preloaded) . . . . .653
Figure 190. Control circuit in normal mode, internal clock divided by 1 . . . . .654
Figure 191. TI2 external clock connection example . . . . .655
Figure 192. Control circuit in external clock mode 1 . . . . .655
Figure 193. Capture/compare channel (example: channel 1 input stage) . . . . .656
Figure 194. Capture/compare channel 1 main circuit . . . . .657
Figure 195. Output stage of capture/compare channel (channel 1) . . . . .657
Figure 196. PWM input mode timing . . . . .659
Figure 197. Output compare mode, toggle on OC1 . . . . .661
Figure 198. Edge-aligned PWM waveforms (ARR=8) . . . . .662
Figure 199. Example of one pulse mode . . . . .663
Figure 200. Control circuit in reset mode . . . . .665
Figure 201.Control circuit in gated mode . . . . .666
Figure 202.Control circuit in trigger mode . . . . .666
Figure 203.Basic timer block diagram . . . . .692
Figure 204.Counter timing diagram with prescaler division change from 1 to 2 . . . . .694
Figure 205.Counter timing diagram with prescaler division change from 1 to 4 . . . . .694
Figure 206.Counter timing diagram, internal clock divided by 1 . . . . .695
Figure 207.Counter timing diagram, internal clock divided by 2 . . . . .696
Figure 208.Counter timing diagram, internal clock divided by 4 . . . . .696
Figure 209.Counter timing diagram, internal clock divided by N . . . . .696
Figure 210.Counter timing diagram, update event when ARPE=0 (TIMx_ARR not
preloaded) . . . . .
697
Figure 211.Counter timing diagram, update event when ARPE=1 (TIMx_ARR
preloaded) . . . . .
697
Figure 212.Control circuit in normal mode, internal clock divided by 1 . . . . .698
Figure 213.Independent watchdog block diagram . . . . .705
Figure 214.Watchdog block diagram . . . . .710
Figure 215.Window watchdog timing diagram . . . . .711
Figure 216.Block diagram (STM32F415/417xx) . . . . .718
Figure 217.Block diagram (STM32F43xxx) . . . . .719
Figure 218.DES/TDES-ECB mode encryption . . . . .721
Figure 219.DES/TDES-ECB mode decryption . . . . .721
Figure 220.DES/TDES-CBC mode encryption . . . . .723
Figure 221.DES/TDES-CBC mode decryption . . . . .724
Figure 222.AES-ECB mode encryption . . . . .725
Figure 223.AES-ECB mode decryption . . . . .726
Figure 224.AES-CBC mode encryption . . . . .727
Figure 225.AES-CBC mode decryption . . . . .728
Figure 226.AES-CTR mode encryption . . . . .729
Figure 227.AES-CTR mode decryption . . . . .730
Figure 228.Initial counter block structure for the Counter mode . . . . .730
Figure 229.64-bit block construction according to DATATYPE . . . . .737
Figure 230.Initialization vectors use in the TDES-CBC encryption . . . . .739
Figure 231.CRYP interrupt mapping diagram . . . . .744
Figure 232.Block diagram . . . . .763
Figure 233.Block diagram for STM32F415/417xx . . . . .769
Figure 234.Block diagram for STM32F43xxx . . . . .770
Figure 235.Bit, byte and half-word swapping . . . . .772
Figure 236.HASH interrupt mapping diagram . . . . .778
Figure 237.RTC block diagram . . . . .796
Figure 238.I2C bus protocol . . . . .837
Figure 239.I2C block diagram for STM32F40x/41x . . . . .838
Figure 240.I2C block diagram for STM32F42x/43x . . . . .839
Figure 241.Transfer sequence diagram for target transmitter . . . . .840
Figure 242.Transfer sequence diagram for target receiver . . . . .841
Figure 243.Transfer sequence diagram for controller transmitter . . . . .844
Figure 244.Transfer sequence diagram for controller receiver . . . . .845
Figure 245.I2C interrupt mapping diagram . . . . .854
Figure 246.SPI block diagram . . . . .871
Figure 247.Single master/single slave application . . . . .872
Figure 248.Data clock timing diagram . . . . .874
Figure 249.TI mode - Slave mode, single transfer . . . . .876
Figure 250.TI mode - Slave mode, continuous transfer . . . . .877
Figure 251. TI mode - master mode, single transfer . . . . .878
Figure 252. TI mode - master mode, continuous transfer . . . . .879
Figure 253. TXE/RXNE/BSY behavior in Master / full-duplex mode (BIDIMODE=0 and RXONLY=0) in case of continuous transfers . . . . .882
Figure 254. TXE/RXNE/BSY behavior in Slave / full-duplex mode (BIDIMODE=0, RXONLY=0) in case of continuous transfers . . . . .883
Figure 255. TXE/BSY behavior in Master transmit-only mode (BIDIMODE=0 and RXONLY=0) in case of continuous transfers . . . . .884
Figure 256. TXE/BSY in Slave transmit-only mode (BIDIMODE=0 and RXONLY=0) in case of continuous transfers . . . . .884
Figure 257. RXNE behavior in receive-only mode (BIDIRMODE=0 and RXONLY=1) in case of continuous transfers . . . . .885
Figure 258. TXE/BSY behavior when transmitting (BIDIRMODE=0 and RXONLY=0) in case of discontinuous transfers . . . . .886
Figure 259. Transmission using DMA . . . . .890
Figure 260. Reception using DMA . . . . .891
Figure 261. TI mode frame format error detection . . . . .893
Figure 262. I2S block diagram . . . . .894
Figure 263. I2S full duplex block diagram . . . . .895
Figure 264. I2S Philips protocol waveforms (16/32-bit full accuracy, CPOL = 0) . . . . .897
Figure 265. I2S Philips standard waveforms (24-bit frame with CPOL = 0) . . . . .897
Figure 266. Transmitting 0x8EAA33 . . . . .897
Figure 267. Receiving 0x8EAA33 . . . . .898
Figure 268. I2S Philips standard (16-bit extended to 32-bit packet frame with CPOL = 0) . . . . .898
Figure 269. Example . . . . .898
Figure 270. MSB justified 16-bit or 32-bit full-accuracy length with CPOL = 0 . . . . .899
Figure 271. MSB justified 24-bit frame length with CPOL = 0 . . . . .899
Figure 272. MSB justified 16-bit extended to 32-bit packet frame with CPOL = 0 . . . . .899
Figure 273. LSB justified 16-bit or 32-bit full-accuracy with CPOL = 0 . . . . .900
Figure 274. LSB justified 24-bit frame length with CPOL = 0 . . . . .900
Figure 275. Operations required to transmit 0x3478AE . . . . .900
Figure 276. Operations required to receive 0x3478AE . . . . .901
Figure 277. LSB justified 16-bit extended to 32-bit packet frame with CPOL = 0 . . . . .901
Figure 278. Example of LSB justified 16-bit extended to 32-bit packet frame . . . . .901
Figure 279. PCM standard waveforms (16-bit) . . . . .902
Figure 280. PCM standard waveforms (16-bit extended to 32-bit packet frame) . . . . .902
Figure 281. Audio sampling frequency definition . . . . .903
Figure 282. I2S clock generator architecture . . . . .903
Figure 283. Functional block diagram . . . . .923
Figure 284. Audio frame . . . . .925
Figure 285. FS role is start of frame + channel side identification (FSDEF = TRIS = 1) . . . . .927
Figure 286. FS role is start of frame (FSDEF = 0) . . . . .928
Figure 287. Slot size configuration with FBOFF = 0 in SAI_xSLOTR . . . . .929
Figure 288. First bit offset . . . . .929
Figure 289. Audio block clock generator overview . . . . .930
Figure 290. AC'97 audio frame . . . . .934
Figure 291. Data companding hardware in an audio block in the SAI . . . . .936
Figure 292. Tristate strategy on SD output line on an inactive slot . . . . .938
Figure 293. Tristate on output data line in a protocol like I2S . . . . .939
Figure 294. Overrun detection error . . . . .940
Figure 295. FIFO underrun event . . . . .941
Figure 296. USART block diagram . . . . .963
Figure 297. Word length programming . . . . .964
Figure 298. Configurable stop bits . . . . .966
Figure 299. TC/TXE behavior when transmitting . . . . .967
Figure 300. Start bit detection when oversampling by 16 or 8 . . . . .968
Figure 301. Data sampling when oversampling by 16 . . . . .971
Figure 302. Data sampling when oversampling by 8 . . . . .972
Figure 303. Mute mode using Idle line detection . . . . .985
Figure 304. Mute mode using address mark detection . . . . .985
Figure 305. Break detection in LIN mode (11-bit break length - LBDL bit is set) . . . . .988
Figure 306. Break detection in LIN mode vs. Framing error detection . . . . .989
Figure 307. USART example of synchronous transmission . . . . .990
Figure 308. USART data clock timing diagram (M=0) . . . . .990
Figure 309. USART data clock timing diagram (M=1) . . . . .991
Figure 310. RX data setup/hold time . . . . .991
Figure 311. ISO 7816-3 asynchronous protocol . . . . .992
Figure 312. Parity error detection using the 1.5 stop bits . . . . .993
Figure 313. IrDA SIR ENDEC- block diagram . . . . .995
Figure 314. IrDA data modulation (3/16) -Normal mode . . . . .995
Figure 315. Transmission using DMA . . . . .997
Figure 316. Reception using DMA . . . . .998
Figure 317. Hardware flow control between 2 USARTs . . . . .998
Figure 318. RTS flow control . . . . .999
Figure 319. CTS flow control . . . . .1000
Figure 320. USART interrupt mapping diagram . . . . .1001
Figure 321. SDIO “no response” and “no data” operations . . . . .1015
Figure 322. SDIO (multiple) block read operation . . . . .1015
Figure 323. SDIO (multiple) block write operation . . . . .1016
Figure 324. SDIO sequential read operation . . . . .1016
Figure 325. SDIO sequential write operation . . . . .1016
Figure 326. SDIO block diagram . . . . .1017
Figure 327. SDIO adapter . . . . .1018
Figure 328. Control unit . . . . .1019
Figure 329. SDIO adapter command path . . . . .1020
Figure 330. Command path state machine (CPSM) . . . . .1021
Figure 331. SDIO command transfer . . . . .1022
Figure 332. Data path . . . . .1024
Figure 333. Data path state machine (DPSM) . . . . .1025
Figure 334. CAN network topology . . . . .1070
Figure 335. Dual CAN block diagram . . . . .1072
Figure 336. bxCAN operating modes . . . . .1074
Figure 337. bxCAN in silent mode . . . . .1075
Figure 338. bxCAN in loop back mode . . . . .1075
Figure 339. bxCAN in combined mode . . . . .1076
Figure 340. Transmit mailbox states . . . . .1078
Figure 341. Receive FIFO states . . . . .1079
Figure 342. Filter bank scale configuration - register organization . . . . .1081
Figure 343. Example of filter numbering . . . . .1082
Figure 344. Filtering mechanism - Example . . . . .1083
Figure 345. CAN error state diagram . . . . .1085
Figure 346. Bit timing . . . . .1087
Figure 347. CAN frames . . . . .1088
Figure 348. Event flags and interrupt generation . . . . .1089
Figure 349. RX and TX mailboxes .....1100
Figure 350. ETH block diagram .....1117
Figure 351. SMI interface signals .....1118
Figure 352. MDIO timing and frame structure - Write cycle .....1119
Figure 353. MDIO timing and frame structure - Read cycle .....1120
Figure 354. Media independent interface signals .....1120
Figure 355. MII clock sources .....1122
Figure 356. Reduced media-independent interface signals .....1123
Figure 357. RMII clock sources .....1123
Figure 358. Clock scheme .....1124
Figure 359. Address field format .....1126
Figure 360. MAC frame format .....1127
Figure 361. Tagged MAC frame format .....1128
Figure 362. Transmission bit order .....1134
Figure 363. Transmission with no collision .....1134
Figure 364. Transmission with collision .....1135
Figure 365. Frame transmission in MMII and RMII modes .....1135
Figure 366. Receive bit order .....1139
Figure 367. Reception with no error .....1140
Figure 368. Reception with errors .....1140
Figure 369. Reception with false carrier indication .....1140
Figure 370. MAC core interrupt masking scheme .....1141
Figure 371. Wake-up frame filter register .....1145
Figure 372. Networked time synchronization .....1148
Figure 373. System time update using the Fine correction method .....1151
Figure 374. PTP trigger output to TIM2 ITR1 connection .....1153
Figure 375. PPS output .....1154
Figure 376. Descriptor ring and chain structure .....1155
Figure 377. TxDMA operation in Default mode .....1159
Figure 378. TxDMA operation in OSF mode .....1161
Figure 379. Normal transmit descriptor .....1162
Figure 380. Enhanced transmit descriptor .....1168
Figure 381. Receive DMA operation .....1170
Figure 382. Normal Rx DMA descriptor structure .....1172
Figure 383. Enhanced receive descriptor field format with IEEE1588 time stamp enabled .....1177
Figure 384. Interrupt scheme .....1180
Figure 385. Ethernet MAC remote wake-up frame filter register (ETH_MACRWUFFR) .....1190
Figure 386. OTG full-speed block diagram .....1231
Figure 387. OTG A-B device connection .....1233
Figure 388. USB peripheral-only connection .....1235
Figure 389. USB host-only connection .....1239
Figure 390. SOF connectivity .....1243
Figure 391. Updating OTG_FS_HFIR dynamically .....1246
Figure 392. Device-mode FIFO address mapping and AHB FIFO access mapping .....1247
Figure 393. Host-mode FIFO address mapping and AHB FIFO access mapping .....1248
Figure 394. Interrupt hierarchy .....1252
Figure 395. CSR memory map .....1254
Figure 396. Transmit FIFO write task .....1326
Figure 397. Receive FIFO read task .....1327
Figure 398. Normal bulk/control OUT/SETUP and bulk/control IN transactions .....1328
Figure 399. Bulk/control IN transactions .....1331
Figure 400. Normal interrupt OUT/IN transactions .....1333
Figure 401. Normal isochronous OUT/IN transactions1338
Figure 402. Receive FIFO packet read1344
Figure 403. Processing a SETUP packet1346
Figure 404. Bulk OUT transaction1353
Figure 405. TRDT max timing case1362
Figure 406. A-device SRP1363
Figure 407. B-device SRP1364
Figure 408. A-device HNP1365
Figure 409. B-device HNP1367
Figure 410. USB OTG interface block diagram1372
Figure 411. USB host-only connection1379
Figure 412. SOF trigger output to TIM2 ITR1 connection1384
Figure 413. Updating OTG_HS_HFIR dynamically1386
Figure 414. Interrupt hierarchy1389
Figure 415. CSR memory map1391
Figure 416. Transmit FIFO write task1480
Figure 417. Receive FIFO read task1481
Figure 418. Normal bulk/control OUT/SETUP and bulk/control IN transactions - DMA mode1482
Figure 419. Normal bulk/control OUT/SETUP and bulk/control IN transactions - Slave mode1483
Figure 420. Bulk/control IN transactions - DMA mode1486
Figure 421. Bulk/control IN transactions - Slave mode1487
Figure 422. Normal interrupt OUT/IN transactions - DMA mode1489
Figure 423. Normal interrupt OUT/IN transactions - Slave mode1490
Figure 424. Normal isochronous OUT/IN transactions - DMA mode1495
Figure 425. Normal isochronous OUT/IN transactions - Slave mode1496
Figure 426. Receive FIFO packet read in slave mode1507
Figure 427. Processing a SETUP packet1509
Figure 428. Slave mode bulk OUT transaction1516
Figure 429. TRDT max timing case1525
Figure 430. A-device SRP1526
Figure 431. B-device SRP1527
Figure 432. A-device HNP1528
Figure 433. B-device HNP1530
Figure 434. FSMC block diagram1533
Figure 435. FSMC memory banks1535
Figure 436. Mode1 read accesses1542
Figure 437. Mode1 write accesses1543
Figure 438. ModeA read accesses1544
Figure 439. ModeA write accesses1545
Figure 440. Mode2 and mode B read accesses1547
Figure 441. Mode2 write accesses1547
Figure 442. Mode B write accesses1548
Figure 443. Mode C read accesses1550
Figure 444. Mode C write accesses1550
Figure 445. Mode D read accesses1552
Figure 446. Mode D write accesses1553
Figure 447. Multiplexed read accesses1555
Figure 448. Multiplexed write accesses1555
Figure 449. Asynchronous wait during a read access1558
Figure 450. Asynchronous wait during a write access1558
Figure 451. Wait configurations . . . . .1560
Figure 452. Synchronous multiplexed read mode - NOR, PSRAM (CRAM) . . . . .1561
Figure 453. Synchronous multiplexed write mode - PSRAM (CRAM) . . . . .1563
Figure 454. NAND/PC Card controller timing for common memory access . . . . .1576
Figure 455. Access to non 'CE don't care' NAND-Flash . . . . .1577
Figure 456. FMC block diagram . . . . .1592
Figure 457. FMC memory banks . . . . .1595
Figure 458. Mode1 read access waveforms . . . . .1606
Figure 459. Mode1 write access waveforms . . . . .1606
Figure 460. ModeA read access waveforms . . . . .1608
Figure 461. ModeA write access waveforms . . . . .1609
Figure 462. Mode2 and mode B read access waveforms . . . . .1611
Figure 463. Mode2 write access waveforms . . . . .1611
Figure 464. ModeB write access waveforms . . . . .1612
Figure 465. ModeC read access waveforms . . . . .1614
Figure 466. ModeC write access waveforms . . . . .1614
Figure 467. ModeD read access waveforms . . . . .1616
Figure 468. ModeD write access waveforms . . . . .1617
Figure 469. Muxed read access waveforms . . . . .1619
Figure 470. Muxed write access waveforms . . . . .1619
Figure 471. Asynchronous wait during a read access waveforms . . . . .1621
Figure 472. Asynchronous wait during a write access waveforms . . . . .1622
Figure 473. Wait configuration waveforms . . . . .1624
Figure 474. Synchronous multiplexed read mode waveforms - NOR, PSRAM (CRAM) . . . . .1624
Figure 475. Synchronous multiplexed write mode waveforms - PSRAM (CRAM) . . . . .1626
Figure 476. NAND Flash/PC Card controller waveforms for common memory access . . . . .1639
Figure 477. Access to non 'CE don't care' NAND-Flash . . . . .1640
Figure 478. Burst write SDRAM access waveforms . . . . .1653
Figure 479. Burst read SDRAM access . . . . .1654
Figure 480. Logic diagram of Read access with RBURST bit set (CAS=2, RPIPE=0) . . . . .1655
Figure 481. Read access crossing row boundary . . . . .1657
Figure 482. Write access crossing row boundary . . . . .1657
Figure 483. Self-refresh mode . . . . .1660
Figure 484. Power-down mode . . . . .1661
Figure 485. Block diagram of STM32 MCU and Cortex®-M4 with FPU-level debug support . . . . .1671
Figure 486. SWJ debug port . . . . .1673
Figure 487. JTAG TAP connections . . . . .1676
Figure 488. TPIU block diagram . . . . .1694