STM32F4 - Technical Training - System Blocks
STM32F4 - Technical Training - System Blocks
STM32F4 - Technical Training - System Blocks
System Peripherals
Innovative system Architecture
CORTEX-M4 Ethernet High Speed Dual Port Dual Port
CCM 168MHz 10/100 USB2.0 DMA1 DMA2
data RAM w/ FPU & MPU
64KB Master 5 Master 4 Master 2 Master 3
Master 1
FIFO/DMA FIFO/DMA FIFO/8 Streams FIFO/8 Streams
Dual Port
S-Bus
D-Bus
I-Bus
AHB1-APB2
AHB1
Dual Port
AHB1-APB1
AHB2
SRAM1
112KB
SRAM2
16KB
FSMC
Accelerator
I-Code FLASH
ART
D-Code
1Mbytes
Dual Port
Fast Peripherals
AHB1-APB2
AHB1 GPIOs
SRAM1
112KB
SRAM2
16KB
FSMC
FLASH
ART Up to
Accelerator
1Mbytes
Multi-AHB Bus Matrix
Real-time performance
Decompressed
MP3
Access
DMA
User decoder
to theto
transfer
interface:
Compressed
32-bit multi-AHB bus matrix audio
code
MP3
audio
DMA
audio stream
data forto
execution
output
transfers
stream
112kByte
of stage
the
(MP3) SRAM
bygraphical
core
decompression
(I2S)
to
icons block
fromSRAM
16kByte Flash
to block
display
System Architecture – Role of the ART
accelerator
PFQ FLASH
4x32-bit buffer
-M4 F
8x16-bit buffer
E
with FPU & MPU T
C I-32-bit I1- 32-bit
Up to 128-bit
168MHz H I2- 32-bit
I3- 32-bit
D-32-bit
I4- 32-bit
BC
64 rows of
BC 128-bit-I
8 rows of
128-bit -D
Branch Cache stores the 64 LRU
Branch Cache stores 8 rows of branches and feeds the CPU
128-bit data (literals) without latency in case of a Hit.
System Architecture - Bootloader
BOOT Mode
Selection Pins Boot Mode Aliasing
BOOT1 BOOT0
This is done by SW in SYSCFG_MEMRMP register, 2 bits are used to select the physical remap
and so, bypass the BOOT pins.
00: Main Flash memory mapped at 0x0000 0000
01: System Flash memory mapped at 0x0000 0000
10: FSMC (NOR/SRAM bank1 NE1/NE2) mapped at 0x0000 0000
11: Embedded SRAM (112kB) mapped at 0x0000 0000
0x2001 C000 - 0x2001 FFFF SRAM2 (16kB) SRAM2 (16kB) SRAM2 (16kB) SRAM2 (16kB)
0x2000 0000 - 0x2001 BFFF SRAM1 (112kB) SRAM1 (112kB) SRAM1 (112kB) SRAM1 (112kB)
0x1FFF 0000 - 0x1FFF 77FF System memory System memory System memory System memory
0x1000 0000 - 0x1000 FFFF CCM Data RAM (64KB) CCM Data RAM (64KB) CCM Data RAM (64KB) CCM Data RAM (64KB)
0x0800 0000 - 0x080F FFFF FLASH (1MB ) FLASH (1MB ) FLASH (1MB ) FLASH (1MB )
0x0010 0000 - 0x07FF FFFF Reserved Reserved Reserved FSMC NOR/SRAM 2 Bank1 (Aliased)
0WS(1CPU cycle) 0 < HCLK <= 30 0 < HCLK <= 24 0 < HCLK <= 18 0 < HCLK <= 16
1WS(2CPU cycle) 30 < HCLK <= 60 24 < HCLK <= 48 18 < HCLK <= 36 16 < HCLK <= 32
2WS(3CPU cycle) 60 < HCLK <= 90 48 < HCLK <= 72 36 < HCLK <= 54 32 < HCLK <= 48
3WS(4CPU cycle) 90 < HCLK <= 120 72 < HCLK <= 96 54 < HCLK <= 72 48 < HCLK <= 64
4WS(5CPU cycle) 120 < HCLK <= 150 96 < HCLK <= 120 72 < HCLK <= 90 64 < HCLK <= 80
5WS(6CPU cycle) 150 < HCLK <= 168 120 < HCLK <= 144 90 < HCLK <= 108 80 < HCLK <= 96
6WS(7CPU cycle) 144 < HCLK <= 168 108 < HCLK <= 126 96 < HCLK <= 112
7WS(8CPU cycle) 126 < HCLK <= 144 112 < HCLK <= 128
Level 1
RDP ≠ 0xCC
RDP ≠ 0xAA
•Readout protection
•BLOCKED access to memory from
SRAM, system memory and JTAG
•Remove readout protection possible
after full erase of the memory and its
blank verification
Level 2 Level 0
RDP=0xCC RDP=0xAA
•JTAG fuse •No readout protection
•No un-protection possible •Full access to memory from
•JTAG disabled SRAM, system memory and
•System memory disabled JTAG
•User settings protected
CRC Features
CRC-based techniques are used to verify data transmission or storage integrity
4x32-Bits FIFO memory for each Stream (FIFO mode can be enabled or
disabled).
5 event flags logically ORed together in a single interrupt request for each stream
Ch3
I2S3_EXT_ TIM2_UP I2S2_EXT_ TIM2_CH2 TIM2_UP
I2C3_RX I2C3_TX TIM2_CH1
RX TIM2_CH3 RX TIM2_CH4 TIM2_CH4
TIM3_CH4 TIM3_CH1
Ch5 -- -- -- TIM3_CH2 -- TIM3_CH3
TIM3_UP TIM3_TRIG
Ch7
USART3_T
-- TIM6_UP I2C2_RX I2C2_RX DAC1 DAC2 I2C2_TX
X
OR OR OR OR OR OR OR OR
DMA1
DMA2 Controller
Stream 0 Stream 1 Stream 2 Stream 3 Stream 4 Stream 5 Stream 6 Stream 7
Ch0
TIM8_CH1/2 TIM1_CH1/2
ADC1 -- -- ADC1 -- --
/3 /3
Ch2
ADC3 ADC3 -- -- -- CRYP_OUT CRYP_IN HASH_IN
Ch3
SPI1_RX
SPI1_RX -- SPI1_TX -- SPI1_TX -- --
Ch6 TIM1_CH4/_
TIM1_TRIG TIM1_CH1 TIM1_CH2 TIM1_CH1 TIM1_UP TIM1_CH3 --
TRIG/_COM
Ch7
TIM8_CH4/_
-- TIM8_UP TIM8_CH1 TIM8_CH2 TIM8_CH3 -- --
TRIG/_COM
DMA2
Transfer size and Flow controller
Either the DMA or the Peripheral determine the amount of data to transfer
Data Packing Example (8-bit 32-bit) Data Unpacking Example (32-bit 16-bit)
T1
T1
A1 T1 A1 B1
T1 A1 B1 C1 D1
T2 A1 B1 C1 D1 A1 B1 C1 D1 A1 B1 C1 D1
B1 T2
C1 D1
A2 B2 C2 D2
T3 A2 B2 C2 D2 T2 A2 B2 C2 D2 T2 A2 B2 C2 D2
T3
C1 A2 B2
T4
D1 T4
C2 D2
T5
A2
T6 DMA FIFO DMA FIFO
B2
T7 Source data width = 8-bit Source data width = 32-bit
Destination data width = 32-bit Destination data width = 16-bit
C2
8 transfers are performed from source to DMA FIFO. 2 transfers are performed from source to DMA FIFO.
T8 2 transfers are performed from DMA FIFO to destination. 4 transfers are performed from DMA FIFO to destination.
D2
Circular & Double Buffer modes
Circular mode:
All FIFO features and DMA events (TC, HT, TE) are available in this mode.
The number of data items is automatically reloaded and transfer restarted
This mode is NOT available for Memory-to-Memory transfers .
DMA_SxM0AR
DMA_SxPAR
CT = 1
CT TC HT
CT = 0
Peripheral Data Register
RESET Sources
System RESET VDD /VDDA
Resets all registers except some RCC
registers and Backup domain RPU
Externa
Sources l RESET Filter SYSTEM RESET
NRST
Low level on the NRST pin WWDG
RESET
(External Reset) PULSE IWDG RESET
GENERATOR Software RESET POR/PDR
WWDG end of count condition (min 20µs) Power RESET RESET
Low power
IWDG end of count condition management RESET BOR
RESET
A software reset (through NVIC)
Low power management Reset
VBAT = 1.65 to 3.6 V: power supply for Backup domain I/O Rings
Reset
Programmable Voltage Detector
Enabled by software
Monitor the VDD power supply by comparing it to
a threshold VPDR = VPOR = 1.8V
Threshold configurable from 1.9V to 3.1V by step VDD
of 100mV
Generate interrupt through EXTI Line16 (if
enabled) when VDD < Threshold and/or VDD > PVD Threshold 100mV
hysteresis
Threshold.
Temporization
tRSTTEMPO
Reset
At startup:
Two PLLs
Main PLL (PLL) clocked by HSI or HSE used to generate the System clock (up to 168MHz),
and 48 MHz clock for USB OTG FS, SDIO and RNG. PLL input clock in the range 1-2 MHz.
PLLI2S PLL (PLLI2S) used to generate a clock to achieve HQ audio performance on the
I2S interface.
More security
Clock Security System (CSS, enabled by software) to backup clock in case of HSE clock
failure (HSI feeds the system clock) – linked to Cortex NMI interrupt
Spread Spectrum Clock Generation (SSCG, enabled by software) to reduce the spectral
density of the electromagnetic interference (EMI) generated by the device
STM32F4 - clock scheme
32.768KHz HSE
/2, to 31
OSC32_IN RTCCLK
LSE
OSC32_OUT OSc
LSI ~32KHz IWDGCLK
/8 SysTick
16MHz
CSS to 168MHz
HSI RC PCLK1
up to 42MHz
HSI
4 -26 MHz
If (APB1 pres
OSC_OUT HSE /M HSE SYSCLK AHB Prescaler APB1
TIMxCLK
Prescaler =1) x1
/1,2…512 TIM2..7,12..14
OSC_IN Osc 168 MHz /1,2,4,8,16 Else x2
PLLCLK
max
PCLK2
up to 84MHz
VCO /P
APB2 If (APB2 pres =1)
PLL48CLK (USB FS, SDIO & RNG) TIMxCLK
Prescaler x1 Else
/Q TIM1,8..11
/1,2,4,8,16 x2
xN
/R
PLL VCO /P
/Q
HSI
xN
HSE PLLI2SCLK MACRXCLK
MCO1 /1..5 /R I2SCLK MACRMIICLK
PLLCLK
LSE MACTXCLK USB HS
PLLI2S
ULPI clock
SYSCLK
HSE
2, 20
MCO2 /1..5 PLLCLK
/
PLLI2S
Conditional Reset
Refresh Refresh time
WWDG Reset flag not allowed Window
T6 bit
Timeout value @42MHz (PCLK1): 97.52us Reset
… 49.93ms