2. System and memory overview

2.1 System architecture

In STM32F410, the main system consists of 32-bit multilayer AHB bus matrix that interconnects:

The bus matrix provides access from a master to a slave, enabling concurrent access and efficient operation even when several high-speed peripherals work simultaneously. This architecture is shown in Figure 1 .

Figure 1. System architecture

Figure 1. System architecture diagram showing the interconnection of masters and slaves via a Bus matrix-S.

The diagram illustrates the system architecture of the STM32F410. At the top, three master blocks are shown: 'ARM Cortex-M4', 'GP DMA1', and 'GP DMA2'. The 'ARM Cortex-M4' block has three output lines labeled 'I-bus', 'D-bus', and 'S-bus'. The 'GP DMA1' block has two output lines labeled 'DMA_PI' and 'DMA_MEM1'. The 'GP DMA2' block has two output lines labeled 'DMA_MEM2' and 'DMA_P2'. All these lines connect to a central 'Bus matrix-S' block. The 'Bus matrix-S' block is a grid with six columns (labeled S0 to S5) and four rows (labeled M0 to M3). Connections are indicated by dots at the intersections. To the right of the matrix, the slaves are connected: 'M0' connects to 'ICODE' and 'DCODE' inputs of an 'ACCEL' block, which is further connected to a 'Flash 128 KB' block; 'M1' connects to 'SRAM1 32 Kbytes' block; 'M2' connects to 'AHB periph1' block; and 'M3' connects to 'AHB periph1' block. The 'AHB periph1' block is connected to two 'APB' blocks, labeled 'APB1' and 'APB2'. The diagram is labeled 'MSv37258V1' in the bottom right corner.

Figure 1. System architecture diagram showing the interconnection of masters and slaves via a Bus matrix-S.
  1. 1. The flash memory size is 512 Kbytes or 128 Mbytes while SRAM1 size is 256 Kbytes.

2.1.1 I-bus

This bus connects the Instruction bus of the Cortex®-M4 with FPU core to the BusMatrix. This bus is used by the core to fetch instructions. The target of this bus is a memory containing code (internal flash memory/SRAM1).

2.1.2 D-bus

This bus connects the databus of the Cortex®-M4 with FPU to the BusMatrix. This bus is used by the core for literal load and debug access. The target of this bus is a memory containing code or data (internal flash memory/SRAM1).

2.1.3 S-bus

This bus connects the system bus of the Cortex®-M4 with FPU core to a BusMatrix. This bus is used to access data located in a peripheral or in SRAM1. Instructions may also be fetch on this bus (less efficient than ICode). The targets of this bus are the internal SRAM1, the AHB1 peripherals including the APB peripherals, and the AHB2 peripherals.

2.1.4 DMA memory bus

This bus connects the DMA memory bus master interface to the BusMatrix. It is used by the DMA to perform transfer to/from memories. The targets of this bus are data memories: internal flash memory, internal SRAM1 and additionally for S4 the AHB1/AHB2 peripherals including the APB peripherals.

2.1.5 DMA peripheral bus

This bus connects the DMA peripheral master bus interface to the BusMatrix. This bus is used by the DMA to access AHB peripherals or to perform memory-to-memory transfers. The targets of this bus are the AHB and APB peripherals plus data memories: flash memory and internal SRAM1.

2.1.6 BusMatrix

The BusMatrix manages the access arbitration between masters. The arbitration uses a round-robin algorithm.

2.1.7 AHB/APB bridges (APB)

The two AHB/APB bridges, APB1 and APB2, provide full synchronous connections between the AHB and the two APB buses, allowing flexible selection of the peripheral frequency.

Refer to the device datasheets for more details on APB1 and APB2 maximum frequencies, and to Table 1 for the address mapping of AHB and APB peripherals.

After each device reset, all peripheral clocks are disabled (except for the SRAM and flash memory interface). Before using a peripheral you have to enable its clock in the RCC_AHBxENR or RCC_APBxENR register.

Note: When a 16- or an 8-bit access is performed on an APB register, the access is transformed into a 32-bit access: the bridge duplicates the 16- or 8-bit data to feed the 32-bit vector.

2.2 Memory organization

2.2.1 Introduction

Program memory, data memory, registers and I/O ports are organized within the same linear 4-Gbyte address space.

The bytes are coded in memory in Little Endian format. The lowest numbered byte in a word is considered the word's least significant byte and the highest numbered byte the most significant.

The addressable memory space is divided into eight main blocks, of 512 Mbytes each.

2.2.2 Memory map and register boundary addresses

Figure 2. Memory map

Memory map diagram showing various memory blocks and their addresses. The diagram is split into two main columns. The left column shows the full 4GB address space from 0x0000 0000 to 0xFFFF FFFF, divided into 512-Mbyte blocks. The right column provides a detailed view of the lower address space, showing specific memory regions like Flash, SRAM, and various peripheral buses (AHB1, APB1, APB2).

The memory map is divided into two main sections: the full address space (left) and a detailed view of the lower address space (right).

Left Column: Full Address Space (0x0000 0000 to 0xFFFF FFFF)

Right Column: Detailed View of Lower Address Space

MSv37260V2

Memory map diagram showing various memory blocks and their addresses. The diagram is split into two main columns. The left column shows the full 4GB address space from 0x0000 0000 to 0xFFFF FFFF, divided into 512-Mbyte blocks. The right column provides a detailed view of the lower address space, showing specific memory regions like Flash, SRAM, and various peripheral buses (AHB1, APB1, APB2).

All the memory map areas that are not allocated to on-chip memories and peripherals are considered “Reserved”. For the detailed mapping of available memory and register areas, refer to the following table.

The following table gives the boundary addresses of the peripherals available in the devices.

Table 1. Register boundary addresses

BusBoundary addressPeripheral
-0xE010 0000 - 0xFFFF FFFFReserved
Cortex ® -M40xE000 0000 - 0xE00F FFFFCortex-M4 internal peripherals
-0x5000 0000 - 0xDFFF FFFFReserved
AHB10x4008 0400 - 0x4FFF FFFFReserved
0x4008 0000 - 0x4008 03FFRNG
0x4002 6800 - 0x4007 FFFFReserved
0x4002 6400 - 0x4002 67FFDMA2
0x4002 6000 - 0x4002 63FFDMA1
0x4002 5000 - 0x4002 4FFFReserved
0x4002 3C00 - 0x4002 3FFFFlash interface register
0x4002 3800 - 0x4002 3BFFRCC
0x4002 3400 - 0x4002 37FFReserved
0x4002 3000 - 0x4002 33FFCRC
0x4002 2800 - 0x4002 2FFFReserved
0x4002 2400 - 0x4002 27FFLPTIM1
0x4002 2000 - 0x4002 23FFReserved
0x4002 1C00 - 0x4002 1FFFGPIOH
0x4002 0C00 - 0x4002 1BFFReserved
0x4002 0800 - 0x4002 0BFFGPIOC
0x4002 0400 - 0x4002 07FFGPIOB
0x4002 0000 - 0x4002 03FFGPIOA

Table 1. Register boundary addresses (continued)

BusBoundary addressPeripheral
APB20x4001 5400- 0x4001 FFFFReserved
0x4001 5000 - 0x4001 53FFSPI5/I2S5
0x4001 4C00- 0x4001 4FFFReserved
0x4001 4800 - 0x4001 4BFFTIM11
0x4001 4400 - 0x4001 47FFReserved
0x4001 4000 - 0x4001 43FFTIM9
0x4001 3C00 - 0x4001 3FFFEXTI
0x4001 3800 - 0x4001 3BFFSYSCFG
0x4001 3400 - 0x4001 37FFReserved
0x4001 3000 - 0x4001 33FFSPI1/I2S1
0x4001 2400 - 0x4001 2FFFReserved
0x4001 2000 - 0x4001 23FFADC1
0x4001 1800 - 0x4001 1FFFReserved
0x4001 1400 - 0x4001 17FFUSART6
0x4001 1000 - 0x4001 13FFUSART1
0x4001 0400 - 0x4001 0FFFReserved
0x4001 0000 - 0x4001 03FFTIM1

Table 1. Register boundary addresses (continued)

BusBoundary addressPeripheral
APB10x4000 7800 - 0x4000 FFFFReserved
0x4000 7400 - 0x4000 77FFDAC
0x4000 7000 - 0x4000 73FFPWR
0x4000 6400 - 0x4000 6FFFReserved
0x4000 6000 - 0x4000 63FFI2C4 FM+
0x4000 5C00 - 0x4000 5FFFReserved
0x4000 5800 - 0x4000 5BFFI2C2
0x4000 5400 - 0x4000 57FFI2C1
0x4000 4800 - 0x4000 53FFReserved
0x4000 4400 - 0x4000 47FFUSART2
0x4000 3C00 - 0x4000 43FFReserved
0x4000 3800 - 0x4000 3BFFSPI2 / I2S2
0x4000 3400 - 0x4000 37FFReserved
0x4000 3000 - 0x4000 33FFIWDG
0x4000 2C00 - 0x4000 2FFFWWDG
0x4000 2800 - 0x4000 2BFFRTC & BKP Registers
0x4000 1400 - 0x4000 27FFReserved
0x4000 1000 - 0x4000 13FFTIM6
0x4000 0C00 - 0x4000 0FFFTIM5
0x4000 0000 - 0x4000 0BFFReserved

2.3 Embedded SRAM

STM32F410 devices feature 32 Kbytes of system SRAM.

The embedded SRAM can be accessed as bytes, half-words (16 bits) or full words (32 bits). Read and write operations are performed at CPU speed with 0 wait state.

The CPU can access the embedded SRAM1, through the System Bus or through the I-Code/D-Code buses when boot from SRAM is selected or when physical remap is selected ( Section 7.2.1: SYSCFG memory remap register (SYSCFG_MEMRMP) in the SYSCFG controller). To get the max performance on SRAM execution, physical remap should be selected (boot or software selection).

2.4 Flash memory overview

The flash memory interface manages CPU AHB I-Code and D-Code accesses to the flash memory. It implements the erase and program flash memory operations and the read and write protection mechanisms. It accelerates code execution with a system of instruction prefetch and cache lines.

The flash memory is organized as follows:

Refer to Section 3: Embedded flash memory interface for more details.

2.5 Bit banding

The Cortex ® -M4 with FPU memory map includes two bit-band regions. These regions map each word in an alias region of memory to a bit in a bit-band region of memory. Writing to a word in the alias region has the same effect as a read-modify-write operation on the targeted bit in the bit-band region.

In the STM32F410 devices both the peripheral registers and the SRAM1 are mapped to a bit-band region, so that single bit-band write and read operations are allowed. The operations are only available for Cortex ® -M4 with FPU accesses, and not from other bus masters (e.g. DMA).

A mapping formula shows how to reference each word in the alias region to a corresponding bit in the bit-band region. The mapping formula is:

\[ bit\_word\_addr = bit\_band\_base + (byte\_offset \times 32) + (bit\_number \times 4) \]

where:

Example

The following example shows how to map bit 2 of the byte located at SRAM1 address 0x20000300 to the alias region:

\[ 0x22006008 = 0x22000000 + (0x300*32) + (2*4) \]

Writing to address 0x22006008 has the same effect as a read-modify-write operation on bit 2 of the byte at SRAM1 address 0x20000300.

Reading address 0x22006008 returns the value (0x01 or 0x00) of bit 2 of the byte at SRAM1 address 0x20000300 (0x01: bit set; 0x00: bit reset).

For more information on bit-banding, refer to the Cortex ® -M4 with FPU programming manual (see Related documents on page 1 ).

2.6 Boot configuration

Due to its fixed memory map, the code area starts from address 0x0000 0000 (accessed through the ICode/DCode buses) while the data area (SRAM) starts from address 0x2000 0000 (accessed through the system bus). The Cortex ® -M4 with FPU CPU always fetches the reset vector on the ICode bus, which implies to have the boot space available only in the code area (typically, flash memory). STM32F4xx microcontrollers implement a special mechanism to be able to boot from other memories (like the internal SRAM).

In the STM32F410, three different boot modes can be selected through the BOOT[1:0] pins as shown in Table 2 .

Table 2. Boot modes

Boot mode selection pinsBoot modeAliasing
BOOT1BOOT0
x0Main flash memoryMain flash memory is selected as the boot space
01System memorySystem memory is selected as the boot space
11Embedded SRAMEmbedded SRAM is selected as the boot space

The values on the BOOT pins are latched on the 4th rising edge of SYSCLK after a reset. It is up to the user to set the BOOT1 and BOOT0 pins after reset to select the required boot mode.

BOOT0 is a dedicated pin while BOOT1 is shared with a GPIO pin. Once BOOT1 has been sampled, the corresponding GPIO pin is free and can be used for other purposes.

The BOOT pins are also resampled when the device exits the Standby mode. Consequently, they must be kept in the required Boot mode configuration when the device is in the Standby mode. After this startup delay is over, the CPU fetches the top-of-stack value from address 0x0000 0000, then starts code execution from the boot memory starting from 0x0000 0004.

Note: When the device boots from SRAM, in the application initialization code, you have to relocate the vector table in SRAM using the NVIC exception table and the offset register.

Embedded bootloader

The embedded bootloader mode is used to reprogram the flash memory using interfaces that depend on the package (refer to Table 3 ):

Table 3. Embedded bootloader interfaces

PackageUSART1USART2I2C1I2C2I2C4 FM+SPI1SPI3
WLCSP36XPA2/PA3PB6/PB7XPB10/PB3PA15/PA5/
PB4/PB5
X
UFQFPN48PA9/PA10PA2/PA3PB6/PB7XPB14/PB15PA4/PA5/
PA6/PA7
X
LQFP64PA9/PA10PA2/PA3PB6/PB7PB10/PB11PB14/PB15PA4/PA5/
PA6/PA7
PB12/PB13/
PC2/PC3
UFBGA64PA9/PA10PA2/PA3PB6/PB7PB10/PB11PB14/PB15PA4/PA5/
PA6/PA7
PB12/PB13/
PC2/PC3

The USART peripherals operate at the internal 16 MHz oscillator (HSI) frequency.

The embedded bootloader code is located in system memory. It is programmed by ST during production. For additional information, refer to application note AN2606.

Physical remap in STM32F410

Once the boot pins are selected, the application software can modify the memory accessible in the code area (in this way the code can be executed through the ICode bus in place of the System bus). This modification is performed by programming the Section 7.2.1: SYSCFG memory remap register (SYSCFG_MEMRMP) in the SYSCFG controller.

The following memories can thus be remapped:

Table 4. Memory mapping vs. Boot mode/physical remap in STM32F410

AddressesBoot/Remap in main flash memoryBoot/Remap in embedded SRAMBoot/Remap in System memory
0x2000 0000 - 0x2002 7FFFSRAM (32 KB)SRAM (32KB)SRAM (32KB)
0x1FFF 0000 - 0x1FFF 77FFSystem memorySystem memorySystem memory
0x0802 0000 - 0x1FFE FFFFReservedReservedReserved
0x0800 0000 - 0x0801 FFFFFlash memoryFlash memoryFlash memory
0x0400 000 - 0x07FF FFFFReservedReservedReserved
0x0000 0000 - 0x0001 FFFF (1)Flash (128 KB) AliasedSRAM1 (32 KB) AliasedSystem memory (30 KB) Aliased
  1. 1. Even when aliased in the boot memory space, the related memory is still accessible at its original memory space.