2. Memory and bus architecture

2.1 System architecture

The main system consists of:

These are interconnected using a multilayer AHB bus architecture as shown in Figure 1 .

Figure 1. System architecture

Figure 1. System architecture diagram showing the interconnection of the Arm Cortex-M0+ core, DMA, Bus matrix, SRAM, Flash memory, and various peripherals via AHB and APB buses.

The diagram illustrates the system architecture. At the center is a 'Bus matrix'. To its left, the 'Arm ® Cortex ® -M0+ core' is connected via a 'System bus', and 'DMA1/DMAMUX channels 1..7' are connected via a 'DMA bus'. Above the core, 'GPIO Ports A,B,C,D,F' are connected via 'IOPORT'. Below the core, 'RCC' is connected to the DMA bus. The 'Bus matrix' is connected to 'Flash memory interface' (which connects to 'Flash memory'), 'SRAM', and 'AHB-to-APB bridge' via the 'AHB' bus. The 'AHB-to-APB bridge' connects to a large block of 'APB' peripherals, which includes SYSCFG, ADC, TIM1, TIM2, TIM3, TIM14, TIM15, TIM16, TIM17, IWDG, WWDG, RTC, PWR, I2C1, I2C2, USART1-4, SPI1, SPI2, USB, CRS, DBGMCU, and FDCAN1. 'CRC' and 'EXTI' are also connected to the AHB bus. 'DMA requests' are shown from the APB peripherals back to the DMA1/DMAMUX channels. A reference code 'MSV66119V2' is in the bottom right corner.

Figure 1. System architecture diagram showing the interconnection of the Arm Cortex-M0+ core, DMA, Bus matrix, SRAM, Flash memory, and various peripherals via AHB and APB buses.

System bus (S-bus)

This bus connects the system bus of the Cortex ® -M0+ core (peripheral bus) to a bus matrix that manages the arbitration between the core and the DMA.

DMA bus

This bus connects the AHB master interface of the DMA to the bus matrix that manages the access of CPU and DMA to SRAM, flash memory and AHB/APB peripherals.

Bus matrix

The bus matrix arbitrates the access between the core system bus and the DMA master bus. The arbitration uses a Round Robin algorithm. The bus matrix is composed of masters (CPU, DMA) and slaves (flash memory interface, SRAM and AHB-to-APB bridge).

AHB peripherals are connected to the system bus through the bus matrix to allow DMA access.

AHB-to-APB bridge (APB)

The AHB-to-APB bridge provides full synchronous connections between the AHB and the APB bus.

Refer to Section 2.2: Memory organization 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 flash memory). Before using a peripheral, its clock must first be enabled through the RCC_AHBENR, RCC_APBENRx, or RCC_IOPENR register.

Note: Unless otherwise specified, 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 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

Memory map diagram showing addressable space, used space, and reserved space for various STM32 microcontrollers. The diagram is divided into two main columns. The left column shows the 'Addressable space' from 0x0000 0000 to 0xFFFF FFFF, divided into blocks 0-7. Block 0 contains 'Code', block 1 contains 'RAM', block 2 contains 'Peripherals', and blocks 3-7 are 'Reserved space'. The right column shows the 'Used space' (white) and 'Reserved space' (grey) for different memory types. 'Used space' includes 'Main flash memory / System memory / RAM (3)' at the bottom, followed by 'Main flash memory', 'System memory', 'OTP', 'Engineering bytes', and 'Option bytes'. Above these are 'APB', 'AHB', and 'IOPORT' at the top. Address boundaries are provided on the right side of the diagram.

Legend:

Memory Map Details:

Memory map diagram showing addressable space, used space, and reserved space for various STM32 microcontrollers. The diagram is divided into two main columns. The left column shows the 'Addressable space' from 0x0000 0000 to 0xFFFF FFFF, divided into blocks 0-7. Block 0 contains 'Code', block 1 contains 'RAM', block 2 contains 'Peripherals', and blocks 3-7 are 'Reserved space'. The right column shows the 'Used space' (white) and 'Reserved space' (grey) for different memory types. 'Used space' includes 'Main flash memory / System memory / RAM (3)' at the bottom, followed by 'Main flash memory', 'System memory', 'OTP', 'Engineering bytes', and 'Option bytes'. Above these are 'APB', 'AHB', and 'IOPORT' at the top. Address boundaries are provided on the right side of the diagram.

1. 0x0000 7FFF for STM32C011xx and STM32C031xx; 0x0800 FFFF for STM32C051xx; 0x0001 FFFF for STM32C071xx; 0x0003 FFFF for STM32C091xx/92xx

2. 0x0800 7FFF for STM32C011xx and STM32C031xx; 0x0000 FFFF for STM32C051xx; 0x0801 FFFF for STM32C071xx; 0x0803 FFFF for STM32C091xx/92xx

3. Depends on boot configuration

All the memory map areas that are not allocated to on-chip memories and peripherals are considered as reserved. For the detailed mapping of available memory and register areas, refer to the following tables.

Table 2. STM32C011xx and STM32C031xx boundary addresses
TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2000 3000 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2000 2FFF12 KBSRAM-
FLASH0x1FFF 7880- 0x1FFF FFFF~34 KBReserved-
0x1FFF 7800 - 0x1FFF 787F128 BOption bytesSection 4.4 on page 66
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400- 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 1800- 0x1FFF 6FFF~22 KBReserved-
0x1FFF 0000 - 0x1FFF 17FF6 KBSystem memory-
0x0800 8000 - 0x1FFE FFFF~384 MBReserved-
0x0800 0000 - 0x0800 7FFF32 KBMain flash memorySection 4.3.1 on page 56
FLASH or SRAM0x0000 8000 - 0x07FF FFFF~127 MBReserved-
0x0000 0000 - 0x000 7FFF32 KBMain flash memory, system memory, or SRAM, depending on boot configuration-
Table 3. STM32C051xx boundary addresses
TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2000 3000 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2000 2FFF12 KBSRAM-
FLASH0x1FFF 8000- 0x1FFF FFFF32 KBReserved-
0x1FFF 7800 - 0x1FFF 7FFF2 KBOption bytesSection 4.4 on page 66
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400- 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 3000 - 0x1FFF 6FFF16 KBReserved-
0x1FFF 0000 - 0x1FFF 2FFF12 KBSystem memory-
0x0801 0000 - 0x1FFE FFFF~384 MBReserved-
0x0800 0000 - 0x0800 FFFF64 KBMain flash memorySection 4.3.1 on page 56
FLASH or SRAM0x0000 8000 - 0x07FF FFFF~127 MBReserved-
0x0000 0000 - 0x000 FFFF64 KBMain flash memory, system memory, or SRAM, depending on boot configuration-

Table 4. STM32C071xx boundary addresses

TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2000 6000 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2000 5FFF24 KBSRAM-
FLASH0x1FFF 8000- 0x1FFF FFFF32 KBReserved-
0x1FFF 7800 - 0x1FFF 7FFF2 KBOption bytesSection 4.4 on page 66
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400 - 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 0000 - 0x1FFF 6FFF28 KBSystem memory-
0x0802 0000 - 0x1FFE FFFF~384 MBReserved-
0x0800 0000 - 0x0801 FFFF128 KBMain flash memorySection 4.3.1 on page 56
FLASH or SRAM0x0002 0000 - 0x07FF FFFF~128 MBReserved-
0x0000 0000 - 0x0001 FFFF128 KBMain flash memory, system memory, or SRAM, depending on boot configuration-

Table 5. STM32C091xx boundary addresses

TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2000 9000 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2000 8FFF36 KBSRAM-
FLASH0x1FFF 8000- 0x1FFF FFFF32 KBReserved-
0x1FFF 7800 - 0x1FFF 7FFF2 KBOption bytesSection 4.4 on page 66
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400- 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 4000 - 0x1FFF 6FFF12 KBReserved-
0x1FFF 0000 - 0x1FFF 3FFF16 KBSystem memory-
0x0804 0000 - 0x1FFE FFFF~384 MBReserved-
0x0800 0000 - 0x0803 FFFF256 KBMain flash memorySection 4.3.1 on page 56
FLASH or SRAM0x0004 0000 - 0x07FF FFFF~128 MBReserved-
0x0000 0000 - 0x0003 FFFF256 KBMain flash memory, system memory, or SRAM, depending on boot configuration-

Table 6. STM32C092xx boundary addresses

TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2000 7800 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2000 77FF30 KBSRAM-
FLASH0x1FFF 8000- 0x1FFF FFFF32 KBReserved-
0x1FFF 7800 - 0x1FFF 7FFF2 KBOption bytesSection 4.4 on page 66
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400- 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 4000 - 0x1FFF 6FFF12 KBReserved-
0x1FFF 0000 - 0x1FFF 3FFF16 KBSystem memory-
0x0804 0000 - 0x1FFE FFFF~384 MBReserved-
0x0800 0000 - 0x0803 FFFF256 KBMain flash memorySection 4.3.1 on page 56
FLASH or SRAM0x0004 0000 - 0x07FF FFFF~128 MBReserved-
0x0000 0000 - 0x0003 FFFF256 KBMain flash memory, system memory, or SRAM, depending on boot configuration-

Table 7. STM32C0 series peripheral register boundary addresses

BusBoundary addressSizePeripheralPeripheral register map
-0xE000 0000 - 0xE00F FFFF1MBCortex ® -M0+ internal peripherals-
IOPORT0x5000 1800 - 0x5FFF 17FF~256 MBReserved-
0x5000 1400 - 0x5000 17FF1 KBGPIOFSection 8.5.12 on page 194
0x5000 1000 - 0x5000 13FF1 KBReserved-
0x5000 0C00 - 0x5000 0FFF1 KBGPIOESection 8.5.12 on page 194
0x5000 0800 - 0x5000 0BFF1 KBGPIOCSection 8.5.12 on page 194
0x5000 0400 - 0x5000 07FF1 KBGPIOBSection 8.5.12 on page 194
0x5000 0000 - 0x5000 03FF1 KBGPIOASection 8.5.12 on page 194

Table 7. STM32C0 series peripheral register boundary addresses (continued)

BusBoundary addressSizePeripheralPeripheral register map
AHB0x4002 3400 - 0x4FFF FFFF~256 MBReserved-
0x4002 3000 - 0x4002 33FF1 KBCRCSection 15.4.6 on page 284
0x4002 2400 - 0x4002 2FFF3 KBReserved-
0x4002 2000 - 0x4002 23FF1 KBFLASHSection 4.7.14 on page 90
0x4002 1C00 - 0x4002 1FFF3 KBReserved-
0x4002 1800 - 0x4002 1BFF1 KBEXTISection 14.5.16 on page 276
0x4002 1400 - 0x4002 17FF1 KBReserved-
0x4002 1000 - 0x4002 13FF1 KBRCCSection 6.4.24 on page 163
0x4002 0C00 - 0x4002 0FFF1 KBReserved-
0x4002 0800 - 0x4002 0BFF1 KBDMAMUXSection 12.6.7 on page 256
0x4002 0400 - 0x4002 07FF1 KBReserved-
0x4002 0000 - 0x4002 03FF1 KBDMA1Section 11.6.7 on page 239
APB0x4001 5C00 - 0x4001 FFFF32 KBReserved-
0x4001 5800 - 0x4001 5BFF1 KBDBGSection 30.10.5 on page 1014
0x4001 4C00 - 0x4001 57FF3 KBReserved-
0x4001 4800 - 0x4001 4BFF1 KBTIM17Section 20.6.21 on page 628
0x4001 4400 - 0x4001 47FF1 KBTIM16Section 20.6.21 on page 628
0x4001 4000 - 0x4001 43FF1 KBTIM15Section 20.6.21 on page 628
0x4001 3C00 - 0x4001 3FFF1 KBReserved-
0x4001 3800 - 0x4001 3BFF1 KBUSART1Section 26.8.15 on page 827
0x4001 3400 - 0x4001 37FF1 KBReserved-
0x4001 3000 - 0x4001 33FF1 KBSPI1Section 27.9.10 on page 886
0x4001 2C00 - 0x4001 2FFF1 KBTIM1Section 17.4.29 on page 440
0x4001 2800 - 0x4001 2BFF1 KBReserved-
0x4001 2400 - 0x4001 27FF1 KBADCSection 16.13 on page 342
0x4001 0400 - 0x4001 23FF8 KBReserved-
0x4001 0080 - 0x4001 03FF1 KBSYSCFG(ITLINE) (1)Section 9.1.34 on page 213
0x4001 001D - 0x4001 007FReserved-
0x4001 0000 - 0x4001 001CSYSCFGSection 9.1.34 on page 213
0x4000 CC00 - 0x4000 FFFF19 KBReserved-
0x4000 B800 - 0x4000 CBFF5 KBFDCAN scratch RAM-
0x4000 B400 - 0x4000 B7FF1 KBFDCAN message RAM-
0x4000 A000 - 0x4000 B3FF5 KBReserved-
0x4000 9800 - 0x4000 9FFF2 KBUSB RAM-
0x4000 8800 - 0x4000 97FF4 KBReserved-
0x4000 7400 - 0x4000 87FF5 KBReserved-
0x4000 7000 - 0x4000 73FF1 KBPWRSection 5.4.19 on page 115
0x4000 6C00 - 0x4000 6FFF1 KBCRSSection 7.7.5 on page 176
Table 7. STM32C0 series peripheral register boundary addresses (continued)
BusBoundary addressSizePeripheralPeripheral register map
APB0x4000 6800 - 0x4000 6BFF1 KBReserved-
0x4000 6400 - 0x4000 67FF1 KBFDCAN1Section 28.4.38 on page 949
0x4000 6000 - 0x4000 63FF1 KBReserved-
0x4000 5C00 - 0x4000 5FFF1 KBUSBSection 29.6.8 on page 994
0x4000 5800 - 0x4000 5BFF1 KBI2C2Section 25.9.12 on page 741
0x4000 5400 - 0x4000 57FF1 KBI2C1Section 25.9.12 on page 741
0x4000 5000 - 0x4000 53FF1 KBReserved-
0x4000 4C00 - 0x4000 4FFF1 KBUSART4Section 26.8.15 on page 827
0x4000 4800 - 0x4000 4BFF1 KBUSART3Section 26.8.15 on page 827
0x4000 4400 - 0x4000 47FF1 KBUSART2Section 26.8.15 on page 827
0x4000 4000 - 0x4000 43FF1 KBReserved-
0x4000 3C00 - 0x4000 3FFF1 KBReserved-
0x4000 3800 - 0x4000 3BFF1 KBSPI2Section 27.9.10 on page 886
0x4000 3400 - 0x4000 37FF1 KBReserved-
0x4000 3000 - 0x4000 33FF1 KBIWDGSection 22.4.6 on page 639
0x4000 2C00 - 0x4000 2FFF1 KBWWDGSection 23.5.4 on page 645
0x4000 2800 - 0x4000 2BFF1 KBRTCSection 24.6.18 on page 675
0x4000 2400 - 0x4000 27FF1 KBReserved-
0x4000 2000 - 0x4000 23FF1 KBTIM14Section 19.4.13 on page 541
0x4000 1800 - 0x4000 1FFF2 KBReserved-
0x4000 1400 - 0x4000 17FF1 KBReserved-
0x4000 1000 - 0x4000 13FF1 KBReserved-
0x4000 0C00 - 0x4000 0FFF1 KBReserved-
0x4000 0800 - 0x4000 0BFF1 KBReserved-
0x4000 0400 - 0x4000 07FF1 KBTIM3Section 18.4.26 on page 514
0x4000 0000 - 0x4000 03FF1 KBTIM2Section 18.4.26 on page 514

1. SYSCFG (ITLINE) registers use 0x4001 0000 as reference peripheral base address.

2.3 Embedded SRAM

The following table summarizes the SRAM resources on the devices, with parity check enabled and disabled.

Table 8. SRAM size
DeviceSRAM with parity (Kbyte)
STM32C011xx6
STM32C031xx, STM32C051xx12
STM32C071xx24

Table 8. SRAM size (continued)

DeviceSRAM with parity (Kbyte)
STM32C092xx30
STM32C091xx36

The SRAM can be accessed by bytes, half-words (16 bits) or full words (32 bits), at maximum system clock frequency without wait state and thus by both CPU and DMA.

Parity check

The user can enable the parity check using the option bit RAM_PARITY_CHECK in the user option byte (refer to Section 4.4: FLASH option bytes ).

The data bus width is 36 bits because 4 bits are available for parity check (1 bit per byte) in order to increase memory robustness, as required for instance by Class B or SIL norms.

The parity bits are computed and stored when writing into the SRAM. Then, they are automatically checked when reading. If one bit fails, an NMI is generated.

Note: When enabling the SRAM parity check, it is advised to initialize by software the whole SRAM at the beginning of the code, to avoid getting parity errors when reading non-initialized locations.

2.4 FDCAN RAM

FDCAN RAM is only present on the STM32C092xx devices.

The FDCAN peripheral uses the first 1 KB of FDCAN RAM as a message RAM. The next 5 KB (FDCAN scratch RAM) can be accessed by the user. As the memory is accessible only from APB bus, it can only be accessed by words. See section AHB-to-APB bridge (APB) .

Note: Before accessing the FDCAN RAM, enable the FDCAN1 clock.

2.5 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 implements the prefetch buffer that speeds up CPU code execution. It also implements the logic necessary to carry out the flash memory operations (Program/Erase) controlled through the flash memory registers.