2. Memory and bus architecture

2.1 System architecture

The STM32H503xx architecture relies on an Arm Cortex-M33 core optimized for execution thanks to an instruction cache having a direct access to the embedded Flash memory.

This architecture also features a 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 the figure below.

Figure 1. System architecture

System architecture diagram showing Cortex-M33 with FPU, ICACHE (8-Kbyte), GPDMA1, GPDMA2, APB1/APB2 peripherals, 32-bit Bus Matrix, and various memory blocks (FLASH, SRAM1, SRAM2, BKPSRAM) connected via C-bus, S-bus, and Fast-bus. Includes a legend for bus multiplexers and interfaces.

The diagram illustrates the system architecture of the RM0492 microcontroller. At the top left, the Cortex-M33 with FPU is connected to an 8-Kbyte ICACHE via a C-bus. The ICACHE connects to a 32-bit Bus Matrix via a Fast-bus. The Cortex-M33 also connects to the Bus Matrix via an S-bus. Two General Purpose DMA controllers, GPDMA1 and GPDMA2, each with two ports (Port 0 and Port 1), connect to the Bus Matrix. APB1 and APB2 peripherals are connected to GPDMA1 Port 1. AHB1, AHB2, and AHB3 peripherals connect directly to the Bus Matrix. The Bus Matrix is connected to several memory blocks: FLASH (128 KB), SRAM1 (16 KB), SRAM2 (16 KB), and BKPSRAM (2 KB). Protection controllers MPCBB1 and MPCBB2 are placed between the matrix and SRAM1/2, while MPCWMM is between the matrix and BKPSRAM. A 128-bit cache refill signal is shown. A legend defines symbols for bus multiplexers (open circle for C-bus, filled circle for Fast-bus) and master/slave interfaces.

System architecture diagram showing Cortex-M33 with FPU, ICACHE (8-Kbyte), GPDMA1, GPDMA2, APB1/APB2 peripherals, 32-bit Bus Matrix, and various memory blocks (FLASH, SRAM1, SRAM2, BKPSRAM) connected via C-bus, S-bus, and Fast-bus. Includes a legend for bus multiplexers and interfaces.

MSv68871V3

2.1.1 Fast C-bus

This bus connects the C-bus of the Cortex-M33 core to the internal Flash memory and to the bus matrix via the instruction cache. This bus is used for instruction fetch and data access to the internal memories mapped in code region. This bus targets the internal Flash memory and the internal SRAMs (SRAM1 and SRAM2).

SRAM1 and SRAM2 are accessible on this bus with a continuous mapping.

2.1.2 S-bus

This bus connects the system bus of the Cortex-M33 core to the bus matrix. This bus is used by the core to access data located in a peripheral or SRAM area. This bus targets the internal SRAMs (SRAM1, SRAM2, and BKPSRAM), the AHB1 peripherals (including the APB1, APB2), AHB2, and AHB3 peripherals.

SRAM1 and SRAM2 are accessible on this bus with a continuous mapping.

Note: The bus matrix has a zero latency when accessing SRAM1 and SRAM2.

2.1.3 GPDMA1 and GPDMA2 buses

These buses connect the four AHB master interfaces of the GPDMA1 and GPDMA2 to the bus matrix. These buses target the internal Flash memory, the internal SRAMs (SRAM1, SRAM2, and BKPSRAM), the AHB1 peripherals (including the APB1, APB2), AHB2, and AHB3 peripherals.

2.1.4 Bus matrix

The bus matrix manages the access arbitration between masters. The arbitration uses a Round-Robin algorithm. This bus matrix features a fast bus multiplexer used to connect each master to a given slave without latency (see Figure 1). For the same master, other slaves undergo a latency of at least one cycle at each new access.

2.1.5 AHB/APB bridges

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

Refer to Section 2.2.2: Memory map and register boundary addresses for the address mapping of the peripherals connected to these bridges.

After each device reset, all peripheral clocks are disabled (except for the internal SRAMs and Flash memory interface). Before using a peripheral, its clock must be enabled in the RCC_AHBxENR and RCC_APBxENR registers.

Note: When a 8- or 16-bit access is performed on an APB register, the access is transformed into a 32-bit access: the bridge duplicates the 8- or 16-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.

2.2.2 Memory map and register boundary addresses

Figure 2. Memory map

Figure 2. Memory map diagram detailing the STM32 memory regions: main memory map on the left, peripheral expansion in the upper right, and code region expansion in the lower right.

The diagram illustrates the memory map of the microcontroller, organized into three main vertical sections: a primary view on the left, a peripheral and APB/AHB block view in the middle/upper right, and a code and system memory view on the lower right.

Address RangeMemory Region
0xE000 0000 - 0xFFFF FFFFCortex M33
0x6000 0000 - 0xE000 0000Reserved
0x4000 0000 - 0x6000 0000Peripherals
0x2000 8000 - 0x4000 0000Reserved
0x2000 4000 - 0x2000 8000SRAM2 (16KB)
0x2000 0000 - 0x2000 4000SRAM1 (16KB)
0x0000 0000 - 0x2000 0000Code

Address RangePeripheral Memory Region
0x4402 4400 - 0x5000 0000Reserved
0x4402 0800 - 0x4402 4400AHB3
0x4400 8000 - 0x4402 0800Reserved
0x4400 0400 - 0x4400 8000APB3
0x420C 0C00 - 0x4400 0400Reserved
0x4202 0000 - 0x420C 0C00AHB2
0x4003 6C00 - 0x4202 0000Reserved
0x4002 0000 - 0x4003 6C00AHB1
0x4001 6C00 - 0x4002 0000Reserved
0x4001 2C00 - 0x4001 6C00APB2
0x4000 B000 - 0x4001 2C00Reserved
0x4000 0000 - 0x4000 B000APB1

Address RangeCode Region Memory
0x0BF8 FFFF - 0x1FFF FFFFReserved
0x0BF8 0000 - 0x0BF8 FFFFSystem memory
0x0A00 8000 - 0x0BF8 0000Reserved
0x0A00 4000 - 0x0A00 8000SRAM2
0x0A00 0000 - 0x0A00 4000SRAM1
0x08FF F7FF - 0x0A00 0000Reserved
0x08FF F000 - 0x08FF F7FFOTP (2KB)
0x0802 0000 - 0x08FF F000Reserved
0x0800 0000 - 0x0802 0000FLASH (128KB)
0x0000 0000 - 0x0800 0000Reserved

MSv68868V3

Figure 2. Memory map diagram detailing the STM32 memory regions: main memory map on the left, peripheral expansion in the upper right, and code region expansion in the lower right.

All the memory map areas that are not allocated to on-chip memories and peripherals are considered “Reserved”. The following table gives the boundary addresses of the peripherals available in the devices.

Table 1. Memory map and peripheral register boundary addresses

BusBoundary addressPeripheralPeripheral register map
AHB30x4402 4400 - 0x44FF FFFFReserved-
0x4402 4000 - 0x4402 43FFDEBUGDEBUG register map
0x4402 3000 - 0x4402 3FFFReserved-
0x4402 2000 - 0x4402 23FFEXTIEXTI register map
0x4402 1000 - 0x4402 1FFFReserved-
0x4402 0C00 - 0x4402 0FFFRCCRCC register map
0x4402 0800 - 0x4402 0BFFPWRPWR register map
0x4402 0000 - 0x4402 07FFReserved-
APB30x4400 8000 - 0x4400 FFFFReserved-
0x4400 7C00 - 0x4400 7FFFTAMPTAMP register map
0x4400 7800 - 0x4400 7BFFRTCRTC register map
0x4400 4800 - 0x4400 77FFReserved-
0x4400 4400 - 0x4400 47FFLPTIM1LPTIM1 register map
0x4400 3400 - 0x4400 43FFReserved-
0x4400 3000 - 0x4400 33FFI3C2I3C2 register map
0x4400 2800 - 0x4400 2FFFReserved-
0x4400 2400 - 0x4400 27FFLPUART1LPUART register map
0x4400 0800 - 0x4400 23FFReserved-
0x4400 0400 - 0x4400 07FFSBSSBS register map
0x4400 0000 - 0x4400 03FFReserved-
Table 1. Memory map and peripheral register boundary addresses (continued)
BusBoundary addressPeripheralPeripheral register map
AHB20x420C 0C00 - 0x43FF FFFFReserved-
0x420C 0800 - 0x420C 0BFFRNGRNG register map
0x420C 0400 - 0x420C 07FFHASHHASH register map
0x4202 8800 - 0x420C 03FFReserved-
0x4202 8400 - 0x4202 87FFDAC1DAC register map
0x4202 8000 - 0x4202 83FFADC1ADC register map
0x4202 2000 - 0x4202 7FFFReserved-
0x4202 1C00 - 0x4202 1FFFGPIOHGPIO register map
0x4202 1000 - 0x4202 1BFFReserved-
0x4202 0C00 - 0x4202 0FFFGPIODGPIO register map
0x4202 0800 - 0x4202 0BFFGPIOC
0x4202 0400 - 0x4202 07FFGPIOB
0x4202 0000 - 0x4202 03FFGPIOA
0x4003 6C00 - 0x41FF FFFFReserved-
AHB10x4003 6400 - 0x4003 6BFFBKPSRAM-
0x4003 3400 - 0x4003 63FFReserved-
0x4003 3000 - 0x4003 33FFGTZC1_MPCBB2GTZC1 MPCBBz registers (z = 1 to 2)
0x4003 2C00 - 0x4003 2FFFGTZC1_MPCBB1GTZC1 MPCBBz registers (z = 1 to 2)
0x4003 2800 - 0x4003 2BFFReserved-
0x4003 2400 - 0x4003 27FFGTZC1_TZSCGTZC1 TZSC register map
0x4003 0800 - 0x4003 23FFReserved-
0x4003 0400 - 0x4003 07FFICACHEICACHE register map
0x4002 7000 - 0x4003 03FFReserved-
0x4002 6000 - 0x4002 6FFFRAMCFGRAMCFG register map
0x4002 3400 - 0x4002 5FFFReserved-
0x4002 3000 - 0x4002 33FFCRCCRC register map
0x4002 2400 - 0x4002 2FFFReserved-
0x4002 2000 - 0x4002 23FFFLASHFLASH register map
0x4002 1000 - 0x4002 1FFFGPDMA2GPDMA register map
0x4002 0000 - 0x4002 0FFFGPDMA1
Table 1. Memory map and peripheral register boundary addresses (continued)
BusBoundary addressPeripheralPeripheral register map
APB20x4001 6C00 - 0x4001 FFFFReserved-
0x4001 6400 - 0x4001 6BFFUSB RAMUSB register map
0x4001 6000 - 0x4001 63FFUSB
0x4001 3C00 - 0x4001 5FFFReserved-
0x4001 3800 - 0x4001 3BFFUSART1USART register map
0x4001 3400 - 0x4001 37FFReserved-
0x4001 3000 - 0x4001 33FFSPI1 / I2S1SPI register map
0x4001 2C00 - 0x4001 2FFFTIM1TIMx register map
0x4001 0000 - 0x4001 2BFFReserved-

Table 1. Memory map and peripheral register boundary addresses (continued)

BusBoundary addressPeripheralPeripheral register map
APB10x4000 B000 - 0x4000 FFFFReserved-
0x4000 AC00 - 0x4000 AFFFFDCAN SRAMFDCAN register map
0x4000 A800 - 0x4000 ABFFReserved-
0x4000 A400 - 0x4000 A7FFFDCAN1FDCAN register map
0x4000 9800 - 0x4000 A3FFReserved-
0x4000 9400 - 0x4000 97FFLPTIM2LPTIM register map
0x4000 9000 - 0x4000 93FFReserved-
0x4000 8C00 - 0x4000 8FFFDTSDTS register map
0x4000 6400 - 0x4000 8BFFReserved-
0x4000 6000 - 0x4000 63FFCRSCRS register map
0x4000 5C00 - 0x4000 5FFFI3C1I3C register map
0x4000 5800 - 0x4000 5BFFI2C2I2C register map
0x4000 5400 - 0x4000 57FFI2C1
0x4000 4C00 - 0x4000 53FFReserved-
0x4000 4800 - 0x4000 4BFFUSART3USART register map
0x4000 4400 - 0x4000 47FFUSART2
0x4000 4000 - 0x4000 43FFCOMPCOMP register map
0x4000 3C00 - 0x4000 3FFFSPI3 / I2S3SPI register map
0x4000 3800 - 0x4000 3BFFSPI2 / I2S2
0x4000 3400 - 0x4000 37FFOPAMPOPAMP register map
0x4000 3000 - 0x4000 33FFIWDGIWDG hardware configuration register (IWDG_HWCFGR)
0x4000 2C00 - 0x4000 2FFFWWDGWWDG register map
0x4000 1800 - 0x4000 2BFFReserved-
0x4000 1400 - 0x4000 17FFTIM7TIM6/TIM7 register map
0x4000 1000 - 0x4000 13FFTIM6
0x4000 0800 - 0x4000 0FFFReserved-
0x4000 0400 - 0x4000 07FFTIM3TIM2/TIM3 register
0x4000 0000 - 0x4000 03FFTIM2

2.2.3 Embedded SRAM

The devices feature up to 32-Kbyte SRAMs:

These SRAMs can be accessed as bytes, half-words (16 bits), or full words (32 bits). These memories can be addressed both by CPU and DMAs.

The CPU can access the SRAM1 and SRAM2 through the system bus or through the C-bus depending on the selected address. The CPU can access the BKPSRAM through the system bus only.

SRAM features are detailed in Section 5.3.1: Internal SRAMs features.

2.2.4 Flash memory overview

The flash memory is composed of two distinct physical areas:

The flash memory interface implements instruction access and data access based on the AHB protocol. It also implements the logic necessary to carry out the flash memory operations (program/erase) controlled through the flash memory registers plus security access control features. Refer to Section 7: Embedded flash memory (FLASH) for more details.