2. System and memory overview

2.1 System architecture

The STM32F318x8 main system consists of:

The interconnection uses a multilayer AHB bus architecture as shown in figures 1.

Figure 1. System architecture

System architecture diagram showing the interconnection of the Arm Cortex-M4 core, GP DMA1, FLASH, FLITF, SRAM, and various peripherals through a BusMatrix-S.

The diagram illustrates the system architecture of the STM32F318x8. At the top left, the 'Arm Cortex-M4' core is shown with three output buses: 'I-bus', 'D-bus', and 'S-bus'. Below it, 'GP DMA1' is shown with a 'DMA' output. Both sets of outputs connect to a central 'BusMatrix-S' block. This matrix is a grid with six horizontal lines (labeled M0 to M5 at the bottom) and six vertical lines. Connections are indicated by dots at the intersections. Below the matrix, the following components are connected to the horizontal lines:

The diagram is labeled 'MS33186V3' in the bottom right corner.

System architecture diagram showing the interconnection of the Arm Cortex-M4 core, GP DMA1, FLASH, FLITF, SRAM, and various peripherals through a BusMatrix-S.

2.1.1 S0: I-bus

This bus connects the instruction bus of the Cortex ® -M4 core to the BusMatrix. This bus is used by the core to fetch instructions. The targets of this bus are the internal Flash memory and the SRAM up to 16 Kbytes.

2.1.2 S1: D-bus

This bus connects the DCode bus (literal load and debug access) of the Cortex ® -M4 core to the BusMatrix. The targets of this bus are the internal Flash memory and the SRAM (16 Kbytes).

2.1.3 S2: S-bus

This bus connects the system bus of the Cortex ® -M4 core to the BusMatrix. This bus is used to access data located in the peripheral or SRAM area. The targets of this bus are the SRAM (16 Kbytes), the AHB to APB1/APB2 bridges, the AHB IO port and the ADC.

2.1.4 S3: DMA-bus

This bus connects the AHB master interface of the DMA to the BusMatrix, which manages the access of different Masters to flash, SRAM, and peripherals.

2.1.5 BusMatrix

The BusMatrix manages the access arbitration between Masters. The arbitration uses a Round Robin algorithm. The BusMatrix is composed of five masters (CPU AHB, System bus, DCode bus, ICode bus, DMA1 bus) and seven slaves (FLITF, SRAM, AHB2GPIO and AHB2APB1/2 bridges, and ADC).

AHB/APB bridges

The two AHB/APB bridges provide full synchronous connections between the AHB and the two APB buses. APB1 is limited to 36 MHz. APB2 operates at full speed (72 MHz).

Refer to Section 2.2: Memory organization on page 40 for the address mapping of the peripherals connected to this bridge.

After each device reset, all peripheral clocks are disabled (except for the SRAM and FLITF). Before using a peripheral the user has to enable its clock in the RCC_AHBENR, RCC_APB2ENR or RCC_APB1ENR register.

When a 16- or 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

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. STM32F3xx peripheral register boundary addresses (1)
BusBoundary addressSize (bytes)PeripheralPeripheral register map
AHB30x5000 0000 - 0x5000 03FF1 KADC1Section 12.7 on page 274
-0x4800 1800 - 0x4FFF FFFF~132 MReserved-
AHB20x4800 1400 - 0x4800 17FF1 KGPIOFSection 8.4.12 on page 142
0x4800 1000 - 0x4800 13FF1 KReserved-
0x4800 0C00 - 0x4800 0FFF1 KGPIOESection 8.4.12 on page 142
0x4800 0800 - 0x4800 0BFF1 KGPIOC
0x4800 0400 - 0x4800 07FF1 KGPIOB
0x4800 0000 - 0x4800 03FF1 KGPIOA
-0x4002 4400 - 0x47FF FFFF~128 MReserved
AHB10x4002 4000 - 0x4002 43FF1 KTSCSection 16.6.11 on page 329
0x4002 3400 - 0x4002 3FFF3 KReserved-
0x4002 3000 - 0x4002 33FF1 KCRCSection 5.4.6 on page 74
0x4002 2400 - 0x4002 2FFF3 KReserved-
0x4002 2000 - 0x4002 23FF1 KFlash interfaceSection 3.6 on page 63
0x4002 1400 - 0x4002 1FFF3 KReserved-
0x4002 1000 - 0x4002 13FF1 KRCCSection 7.4.14 on page 124
0x4002 0400 - 0x4002 0FFF3 KReserved-
0x4002 0000 - 0x4002 03FF1 KDMA1Section 10.6.7 on page 172
-0x4001 8000 - 0x4001 FFFF32 KReserved-
APB20x4001 4C00 - 0x4001 7FFF13 KReserved-
0x4001 4800 - 0x4001 4BFF1 KTIM17Section 19.6.18 on page 573
0x4001 4400 - 0x4001 47FF1 KTIM16
0x4001 4000 - 0x4001 43FF1 KTIM15Section 19.5.19 on page 553
0x4001 3C00 - 0x4001 3FFF1 KReserved-
0x4001 3800 - 0x4001 3BFF1 KUSART1Section 26.8.12 on page 778
0x4001 3000 - 0x4001 37FF2 KReserved-
0x4001 2C00 - 0x4001 2FFF1 KTIM1Section 17.4.27 on page 423
0x4001 0800 - 0x4001 0BFF8 KReserved-
0x4001 0400 - 0x4001 07FF1 KEXTISection 11.3.13 on page 191
0x4001 0000 - 0x4001 03FF1 KSYSCFG + COMP
+ OPAMP
Section 9.1.7 on page 151
Section 14.5.4 on page 302
Section 15.4.2 on page 312
-0x4000 9C00 - 0x4000 FFFF25 KReserved-
Table 1. STM32F3xx peripheral register boundary addresses (1) (continued)
BusBoundary addressSize (bytes)PeripheralPeripheral register map
APB10x4000 7C00 - 0x4000 9BFF8 KReserved-
0x4000 7800 - 0x4000 7BFF1 KI2C3Section 25.9.12 on page 711
0x4000 7400 - 0x4000 77FF1 KDAC1Section 13.9.8 on page 291
0x4000 7000 - 0x4000 73FF1 KPWRSection 6.4.3 on page 89
0x4000 5C00 - 0x4000 6FFF5 KReserved-
0x4000 5800 - 0x4000 5BFF1 KI2C2Section 25.9.12 on page 711
0x4000 5400 - 0x4000 57FF1 KI2C1
0x4000 4C00 - 0x4000 53FF2 KReserved-
0x4000 4800 - 0x4000 4BFF1 KUSART3Section 26.8.12 on page 778
0x4000 4400 - 0x4000 47FF1 KUSART2
0x4000 4000 - 0x4000 43FF1 KI2S3extSection 27.9.10 on page 836
0x4000 3C00 - 0x4000 3FFF1 KSPI3/I2S3
0x4000 3800 - 0x4000 3BFF1 KSPI2/I2S2
0x4000 3400 - 0x4000 37FF1 KI2S2ext
0x4000 3000 - 0x4000 33FF1 KIWDGSection 23.4.6 on page 603
0x4000 2C00 - 0x4000 2FFF1 KWWDGSection 22.5.4 on page 594
0x4000 2800 - 0x4000 2BFF1 KRTCSection 24.6.20 on page 645
0x4000 1400 - 0x4000 27FF5 KReserved-
0x4000 1000 - 0x4000 13FF1 KTIM6Section 20.4.9 on page 587
0x4000 0400 - 0x4000 0FFF3 KReserved-
0x4000 0000 - 0x4000 03FF1 KTIM2Section 18.4.22 on page 494
-0x2000 4000 - 3FFF FFFF~512 MReserved-
-0x2000 0000 - 0x2000 3FFF16 KSRAM-
-0x1FFF F800 - 0x1FFF FFFF2 KOption bytes-
-0x1FFF D800 - 0x1FFF F7FF8 KSystem memory-
-0x0801 0000 - 0x1FFF D7FF~384 MReserved-
-0x0800 0000 - 0x0800 FFFF64 KMain Flash memory-
-0x0001 0000 - 0x07FF FFFF~128 MReserved-
-0x0000 000 - 0x0000 FFFF64 KMain Flash memory, system memory or SRAM depending on BOOT configuration-

1. The gray color is used for reserved Flash memory addresses.

2.3 Embedded SRAM

STM32F3xx devices feature up to 16 Kbytes of static SRAM. It can be accessed as bytes, halfwords (16 bits) or full words (32 bits). Up to 16 Kbytes of SRAM can be addressed at maximum system clock frequency without wait state, and can be accessed by both CPU and DMA.

2.4 Flash memory overview

The Flash memory is composed of two distinct physical areas:

Flash memory instructions and data access are performed through the AHB bus. The prefetch block is used for instruction fetches through the ICode bus. Arbitration is performed in the Flash memory interface, and priority is given to data access on the DCode bus. It also implements the logic necessary to carry out the Flash memory operations (Program/Erase) controlled through the Flash registers.

2.5 Boot configuration

In the STM32F3xx, three different boot modes can be selected through the BOOT0 pin and nBOOT1 bit in the User option byte, as shown in the following table:

Table 2. Boot modes

Boot mode selectionBoot modeAliasings
nBOOT1BOOT0--
x0Main Flash memoryMain flash memory is selected as boot area
11System memorySystem memory is selected as boot area
01Embedded SRAMEmbedded SRAM (on the DCode bus) is selected as boot area

The values on both BOOT0 pin and nBOOT1 bit are latched on the 4th rising edge of SYSCLK after a reset.

It is up to the user to set the nBOOT1 and BOOT0 to select the required boot mode. The BOOT0 pin and nBOOT1 bit are also resampled when exiting from Standby mode. Consequently they must be kept in the required Boot mode configuration in Standby mode. After this startup delay has elapsed, the CPU fetches the top-of-stack value from address 0x0000 0000, then starts code execution from the boot memory at 0x0000 0004. Depending

on the selected boot mode, main Flash memory, system memory or SRAM is accessible as follows:

2.5.1 Embedded boot loader

The embedded boot loader is located in the System memory, programmed by ST during production. It is used to reprogram the Flash memory through: