2. System and memory overview

2.1 System architecture

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

System architecture diagram showing the connection of Cortex-M4 with FPU, DMA1, DMA2, and various memory and peripheral components through a BusMatrix-S. The diagram shows a grid of connections between the I-bus, D-bus, and S-bus from the Cortex-M4 and DMA units, and various targets on the right including FLASH 512 KB, SRAM1, CCM SRAM, SRAM2, AHB1 peripherals, AHB2 peripherals, FSMC, and QUADSPI. An ACCEL block is shown between ICode and DCode lines and the FLASH memory. MSv45850V1 is noted in the bottom right corner of the diagram area.
System architecture diagram showing the connection of Cortex-M4 with FPU, DMA1, DMA2, and various memory and peripheral components through a BusMatrix-S. The diagram shows a grid of connections between the I-bus, D-bus, and S-bus from the Cortex-M4 and DMA units, and various targets on the right including FLASH 512 KB, SRAM1, CCM SRAM, SRAM2, AHB1 peripherals, AHB2 peripherals, FSMC, and QUADSPI. An ACCEL block is shown between ICode and DCode lines and the FLASH memory. MSv45850V1 is noted in the bottom right corner of the diagram area.

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 (either internal Flash memory, internal SRAMs or external memories through the FSMC or QUADSPI).

2.1.2 D-bus

This bus connects the data bus of the Cortex ® -M4 with FPU core 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 (either internal Flash memory, internal SRAMs or external memories through the FSMC or QUADSPI).

2.1.3 S-bus

This bus connects the system bus of the Cortex ® -M4 with FPU core to the BusMatrix. This bus is used by the core to access data located in a peripheral or SRAM area. The targets of this bus are the internal SRAM, the AHB1 peripherals including the APB1 and APB2 peripherals, the AHB2 peripherals and the external memories through the QUADSPI or the FSMC.

The CCM SRAM is also accessible on this bus to allow continuous mapping with SRAM1 and SRAM2.

2.1.4 DMA-bus

This bus connects the AHB master interface of the DMA to the BusMatrix. The targets of this bus are the SRAM1, SRAM2 and CCM SRAM, the AHB1 peripherals including the APB1 and APB2 peripherals, the AHB2 peripherals and the external memories through the QUADSPI or the FSMC.

2.1.5 BusMatrix

The BusMatrix manages the access arbitration between masters. The arbitration uses a Round Robin algorithm. The BusMatrix is composed of up to five masters (CPU AHB, system bus, DCode bus, ICode bus, DMA1, DMA2, ) and up to nine slaves (FLASH, SRAM1, SRAM2, CCM SRAM, AHB1 (including APB1 and APB2), AHB2, QUADSPI, and FSMC).

AHB/APB bridges

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

Refer to Section 2.2.2: Memory map and register boundary addresses on page 83 for the address mapping of the peripherals connected to this bridge.

After each device reset, all peripheral clocks are disabled (except for the SRAM1/2 and Flash memory interface). Before using a peripheral you have to enable its clock in the RCC_AHBxENR and the RCC_APBxENR registers.

Note: 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

Figure 2. Memory map

Memory map diagram showing address ranges from 0x0000 0000 to 0xFFFF FFFF. It is divided into two columns with various memory regions like CODE, SRAM1, SRAM2, CCM SRAM, Peripherals, Reserved, FSMC bank1, FSMC bank3, QSPI bank1, Cortex-M4 with FPU Internal Peripherals, AHB1, AHB2, APB1, APB2, QSPI registers, and FSMC registers. A legend at the bottom left indicates that grey blocks represent 'Reserved' memory.

Memory Map Details:

Legend: Grey blocks represent Reserved memory.

Memory map diagram showing address ranges from 0x0000 0000 to 0xFFFF FFFF. It is divided into two columns with various memory regions like CODE, SRAM1, SRAM2, CCM SRAM, Peripherals, Reserved, FSMC bank1, FSMC bank3, QSPI bank1, Cortex-M4 with FPU Internal Peripherals, AHB1, AHB2, APB1, APB2, QSPI registers, and FSMC registers. A legend at the bottom left indicates that grey blocks represent 'Reserved' memory.

MSV45854V4

All areas 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.

Table 3 gives the boundary addresses of the peripherals available in the devices.

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

BusBoundary addressSizePeripheralPeripheral register map
-0xA000 1400 - 0xAFFF FFFF262 MBReserved-
0xA000 1000 - 0xA000 13FF1 KBQUADSPISection 20.5.14: QUADSPI register map
0xA000 0400 - 0xA000 0FFF3 KBReserved-
0xA000 0000 - 0xA000 03FF1 KBFSMCSection 19.7.8: FMC register map
AHB20x5006 0C00 - 0x5FFF FFFF256MBReserved-
0x5006 0800 - 0x5006 0BFF1 KBRNGSection 26.7.4: RNG register map
0x5006 0400 - 0x5006 07FF1 KBReserved-
0x5006 0000 - 0x5006 03FF1 KBAESSection 27.7.18: AES register map
0x5000 1800 - 0x5005 FFFF377 KBReserved-
0x5000 1400 - 0x5000 17FF1 KBDAC4Section 22.7.24: DAC register map
0x5000 1000 - 0x5000 13FF1 KBDAC3Section 22.7.24: DAC register map
0x5000 0C00 - 0x5000 0FFF1 KBDAC2Section 22.7.24: DAC register map
0x5000 0800 - 0x5000 0BFF1 KBDAC1Section 22.7.24: DAC register map
0x5000 0400 - 0x5000 07FF1 KBADC3 - ADC4 - ADC5Section 21.9: ADC register map
0x5000 0000 - 0x5000 03FF1 KBADC1 - ADC2Section 21.9: ADC register map
0x4800 1C00 - 0x4FFF FFFF127 MBReserved-
0x4800 1800 - 0x4800 1BFF1 KBGPIOGSection 9.4.12: GPIO register map
0x4800 1400 - 0x4800 17FF1 KBGPIOFSection 9.4.12: GPIO register map
0x4800 1000 - 0x4800 13FF1 KBGPIOESection 9.4.12: GPIO register map
0x4800 0C00 - 0x4800 0FFF1 KBGIOPDSection 9.4.12: GPIO register map
0x4800 0800 - 0x4800 0BFF1 KBGPIOCSection 9.4.12: GPIO register map
0x4800 0400 - 0x4800 07FF1 KBGPIOBSection 9.4.12: GPIO register map
0x4800 0000 - 0x4800 03FF1 KBGPIOASection 9.4.12: GPIO register map
Table 3. Memory map and peripheral register boundary addresses (1) (continued)
BusBoundary addressSizePeripheralPeripheral register map
AHB10x4002 3400 - 0x47FF FFFF127 MBReserved-
0x4002 3000 - 0x4002 33FF1 KBCRCSection 16.4.6: CRC register map
0x4002 2400 - 0x4002 2FFF3 KBReserved-
0x4002 2000 - 0x4002 23FF1 KBFlash interfaceSection 5.7.14: FLASH register map
0x4002 1400 - 0x4002 1FFF3 KBFMACSection 18.4.9: FMAC register map
0x4002 1000 - 0x4002 13FF1 KBRCCSection 7.4.31: RCC register map
0x4002 0C00 - 0x4002 0FFF1 KBCORDICSection 17.4.4: CORDIC register map
0x4002 0800 - 0x4002 0BFF1 KBDMAMUXSection 13.6.7: DMAMUX register map
0x4002 0400 - 0x4002 07FF1 KBDMA 2Section 12.6.7: DMA register map
0x4002 0000 - 0x4002 03FF1 KBDMA 1Section 12.6.7: DMA register map
APB20x4001 7800 - 0x4001 FFFF2 KBReserved-
0x4001 6800 - 0x4001 77FF3 KBHRTIMSection 28.5.87: HRTIM register map
0x4001 5800 - 0x4001 67FF4 KBReserved-
0x4001 5400 - 0x4001 57FF1 KBSAI1Section 43.6.19: SAI register map
0x4001 5000 - 0x4001 53FF1 KBTIM20Section 29.6.31: TIMx register map
0x4001 4C00 - 0x4001 4FFF1 KBReserved-
0x4001 4800 - 0x4001 4BFF1 KBTIM17Section 31.8.22: TIM16/TIM17 register map
0x4001 4400 - 0x4001 47FF1 KBTIM16Section 31.8.22: TIM16/TIM17 register map
0x4001 4000 - 0x4001 43FF1 KBTIM15Section 31.7.23: TIM15 register map
0x4001 3C00 - 0x4001 3FFF1 KBSPI4Section 42.9.10: SPI/I2S register map
0x4001 3800 - 0x4001 3BFF1 KBUSART1Section 40.8.15: USART register map
0x4001 3400 - 0x4001 37FF1 KBTIM8Section 29.6.31: TIMx register map
0x4001 3000 - 0x4001 33FF1 KBSPI1Section 42.9.10: SPI/I2S register map
0x4001 2C00 - 0x4001 2FFF1 KBTIM1Section 29.6.31: TIMx register map
0x4001 0800 - 0x4001 2BFF9 KBReserved-
0x4001 0400 - 0x4001 07FF1 KBEXTISection 15.5.13: EXTI register map
0x4001 0300 - 0x4001 03FF1 KBOPAMPSection 25.5.13: OPAMP register map
0x4001 0200 - 0x4001 02FFCOMPSection 24.6.2: COMP register map
0x4001 0030 - 0x4001 01FFVREFBUFSection 23.4.3: VREFBUF register map
0x4001 0000 - 0x4001 0029SYSCFGSection 10.2.11: SYSCFG register map
Table 3. Memory map and peripheral register boundary addresses (1) (continued)
BusBoundary addressSizePeripheralPeripheral register map
APB10x4000 AFEE - 0x4000 FFFF23 KBReserved-
0x4000 AC00 - 0x4000 AFFF1 KBFDCANs Message RAMSection 44.4.38: FDCAN register map
0x4000 A800 - 0x4000 ABFF1 KB
0x4000 A400 - 0x4000 A7FF1 KB
0x4000 A000 - 0x4000 A3FF1 KBUCPD1Section 46.8.15: UCPD register map
0x4000 8800 - 0x4000 9FFF6 KBReserved-
0x4000 8400 - 0x4000 87FF1 KBI2C4Section 39.9.12: I2C register map
0x4000 8000 - 0x4000 83FF1 KBLPUART1Section 41.7.13: LPUART register map
0x4000 7C00 - 0x4000 7FFF1 KBLPTIM1Section 33.7.10: LPTIM register map
0x4000 7800 - 0x4000 7BFF1 KBI2C3Section 39.9.12: I2C register map
0x4000 7400 - 0x4000 77FF1 KBReserved-
0x4000 7000 - 0x4000 73FF1 KBPWRSection 6.4.23: PWR register map and reset value table
0x4000 6C00 - 0x4000 6FFF1 KBFDCAN3Section 44.4.38: FDCAN register map
0x4000 6800 - 0x4000 6BFF1 KBFDCAN2Section 44.4.38: FDCAN register map
0x4000 6400 - 0x4000 67FF1 KBFDCAN1Section 44.4.38: FDCAN register map
0x4000 6000 - 0x4000 63FF1 KBUSB SRAM 1 Kbyte-
0x4000 5C00 - 0x4000 5FFF1 KBUSB device FSSection 45.6.3: USB register map
0x4000 5800 - 0x4000 5BFF1 KBI2C2Section 39.9.12: I2C register map
0x4000 5400 - 0x4000 57FF1 KBI2C1Section 39.9.12: I2C register map
0x4000 5000 - 0x4000 53FF1 KBUART5Section 40.8.15: USART register map
0x4000 4C00 - 0x4000 4FFF1 KBUART4Section 40.8.15: USART register map
0x4000 4800 - 0x4000 4BFF1 KBUSART3Section 40.8.15: USART register map
0x4000 4400 - 0x4000 47FF1 KBUSART2Section 40.8.15: USART register map
Table 3. Memory map and peripheral register boundary addresses (1) (continued)
BusBoundary addressSizePeripheralPeripheral register map
APB1
cont'd
0x4000 4000 - 0x4000 43FF1 KBReserved-
0x4000 3C00 - 0x4000 3FFF1 KBSPI3/I2S3Section 42.9.10: SPI/I2S register map
0x4000 3800 - 0x4000 3BFF1 KBSPI2/I2S2Section 42.9.10: SPI/I2S register map
0x4000 3400 - 0x4000 37FF1 KBReserved-
0x4000 3000 - 0x4000 33FF1 KBIWDGSection 35.4.6: IWDG register map
0x4000 2C00 - 0x4000 2FFF1 KBWWDGSection 36.5.4: WWDG register map
0x4000 2800 - 0x4000 2BFF1 KBRTC and BKP registersSection 37.6.21: RTC register map
0x4000 2400 - 0x4000 27FF1 KBTAMPSection 38.6.9: TAMP register map
0x4000 2000 - 0x4000 23FF1 KBCRSSection 8.7.5: CRS register map
0x4000 1C00 - 0x4000 1FFF1 KBReserved-
0x4000 1800 - 0x4000 1BFF1 KBReserved-
0x4000 1400 - 0x4000 17FF1 KBTIM7Section 32.4.9: TIMx register map
0x4000 1000 - 0x4000 13FF1 KBTIM6Section 32.4.9: TIMx register map
0x4000 0C00 - 0x4000 0FFF1 KBTIM5Section 30.5.31: TIMx register map
0x4000 0800 - 0x4000 0BFF1 KBTIM4Section 30.5.31: TIMx register map
0x4000 0400 - 0x4000 07FF1 KBTIM3Section 30.5.31: TIMx register map
0x4000 0000 - 0x4000 03FF1 KBTIM2Section 30.5.31: TIMx register map
  1. 1. Refer to Table 1 , Table 2 , and to the device datasheets for the GPIO ports and peripherals available on your device. the memory area corresponding to unavailable GPIO ports or peripherals are reserved (highlighted in gray).

2.3 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 STM32G4 series devices both the peripheral registers and the SRAM are mapped to a bit-band region, so that single bit-band write and read operations are allowed. The operations are available only for Cortex ® -M4 with FPU accesses, and not from other bus masters (such as 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).

2.4 Embedded SRAM

Category 3 devices feature up to 128 Kbytes SRAM:

Category 4 devices feature up to 112 Kbytes SRAM:

Category 2 devices feature up to 32 Kbytes SRAM:

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

The CPU can access the SRAM1 through the system bus or through the ICode/DCode buses when boot from SRAM1 is selected or when physical remap is selected ( Section 10.2.1: SYSCFG memory remap register (SYSCFG_MEMRMP) in the SYSCFG controller). To get the maximum performance on SRAM1 execution, physical remap should be selected (boot or software selection).

CCM SRAM is mapped at address 0x1000 0000.

Execution can be performed from CCM SRAM with maximum performance without any remap thanks to access through ICode bus.

The CCM SRAM is aliased at address following the end of SRAM2 (0x2000 5800 for category 2 devices, 0x2001 8000 for category 3 devices, 0x2001 8000 for category 4 devices), offering a continuous address space with the SRAM1 and SRAM2. CCM can be accessed by DMA only by this aliased address.

2.4.1 Parity check

On category 3 and category 4 devices, a parity check is implemented on the first 32 Kbytes of SRAM1 and on the whole CCM SRAM.

On the category 2 devices, a parity check is implemented on the whole SRAM1 and CCM SRAM.

The user can enable the parity check using the option bit SRAM_PE in the user option byte (refer to Section 3.4.1: Option bytes description ).

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. The same error can also be linked to the BRK_IN Break input of TIM1/TIM8/TIM15/TIM16/TIM17/TIM20, and to hrtim_sys_flt with the SPL control bit in the Section 10.2.8: SYSCFG configuration register 2 (SYSCFG_CFGR2) . The SRAM parity error flag (SPF) is available in the Section 10.2.8: SYSCFG configuration register 2 (SYSCFG_CFGR2) .

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

2.4.2 CCM SRAM write protection

The CCM SRAM can be write protected with a page granularity of 1 Kbyte.

Table 4. CCM SRAM organization

Page numberStart addressEnd address
Page 00x1000 00000x1000 03FF
Page 10x1000 04000x1000 07FF
Page 20x1000 08000x1000 0BFF
Page 30x1000 0C000x1000 0FFF
Page 40x1000 10000x1000 13FF
Page 50x1000 14000x1000 17FF
Page 60x1000 18000x1000 1BFF
Page 70x1000 1C000x1000 1FFF
Page 80x1000 20000x1000 23FF
Page 90x1000 24000x1000 27FF
Page 10 (1)0x1000 28000x1000 2BFF
Table 4. CCM SRAM organization (continued)
Page numberStart addressEnd address
Page 11 (1)0x1000 2C000x1000 2FFF
Page 12 (1)0x1000 30000x1000 33FF
Page 13 (1)0x1000 34000x1000 37FF
Page 14 (1)0x1000 38000x1000 3BFF
Page 15 (1)0x1000 3C000x1000 3FFF
Page 16 (2)0x1000 40000x1000 43FF
Page 17 (2)0x1000 44000x1000 47FF
Page 18 (2)0x1000 48000x1000 4BFF
Page 19 (2)0x1000 4C000x1000 4FFF
Page 20 (2)0x1000 50000x1000 53FF
Page 21 (2)0x1000 54000x1000 57FF
Page 22 (2)0x1000 58000x1000 5BFF
Page 23 (2)0x1000 5C000x1000 5FFF
Page 24 (2)0x1000 60000x1000 63FF
Page 25 (2)0x1000 64000x1000 67FF
Page 26 (2)0x1000 68000x1000 6BFF
Page 27 (2)0x1000 6C000x1000 6FFF
Page 28 (2)0x1000 70000x1000 73FF
Page 29 (2)0x1000 74000x1000 77FF
Page 30 (2)0x1000 78000x1000 7BFF
Page 31 (2)0x1000 7C000x1000 7FFF

1. Available only on category 3 and category 4 devices.

2. Available only on category 3 devices.

The write protection can be enabled in Section 10.2.9: SYSCFG CCM SRAM write protection register (SYSCFG_SWPR) in the SYSCFG block. This is a register with write '1' once mechanism, which means by writing '1' on a bit it sets up the write protection for that page of SRAM and it can be removed/cleared by a system reset only.

2.4.3 CCM SRAM read protection

The CCMSRAM is protected with the Read protection (RDP). Refer to Section 3.5.1: Read protection (RDP) for more details.

2.4.4 CCM SRAM erase

The CCMSRAM can be erased with a system reset using the option bit CCMSRAM_RST in the user option byte (refer to Section 3.4.1: Option bytes description ).

The CCM SRAM erase can also be requested by software by setting the bit CCMSR in the Section 10.2.7: SYSCFG CCM SRAM control and status register (SYSCFG_SCSR) .

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 also implements the logic necessary to carry out the flash memory operations (program/erase) controlled through the flash memory registers. Refer to Section 3: Embedded flash memory (FLASH) for category 3 devices , Section 4: Embedded flash memory (FLASH) for category 4 devices , and Section 5: Embedded flash memory (FLASH) for category 2 devices for more details.

2.6 Boot configuration

2.6.1 Boot configuration

Three different boot modes can be selected through the BOOT0 pin or the nBOOT0 bit into the FLASH_OPTR register (if the nSWBOOT0 bit is cleared into the FLASH_OPTR register), and nBOOT1 bit in FLASH_OPTR register, as shown in Table 5 .

Table 5. Boot modes

BOOT_LOCKnBOOT1
FLASH_OPTR[23]
nBOOT0
FLASH_OPTR[27]
BOOT0
pin PB8
nSWBOOT0
FLASH_OPTR[26]
Boot memory space alias
1XXXXMain flash memory (1)
0XX01Main flash memory is selected as boot area (1)
0X1X0Main flash memory is selected as boot area (1)
00X11Embedded SRAM1 is selected as boot area
000X0Embedded SRAM1 is selected as boot area
01X11System memory is selected as boot area
010X0System memory is selected as boot area

1. When the BFB2 bit is set (for dual bank devices), the system memory remains aliased at 0x0000 0000. Aliasing system memory to 0x0000 0000 must be considered in user application - VTOR address must be remapped from default 0x0000 0000 address into real user application to properly address vector table. For further details, refer to AN2606.

The values on both BOOT0 pin (coming from the pin or the option bit) and nBOOT1 bit are latched on the 4th edge of the internal startup clock source after reset release. It is up to the user to set nBOOT1 and BOOT0 to select the required boot mode.

The BOOT0 pin or user option bit (depending on the nSWBOOT0 bit value in the FLASH_OPTR register), and nBOOT1 bit are also re-sampled 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 SRAM1 is accessible as follows:

PB8/BOOT0 GPIO is configured in:

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. When booting from the main flash memory, the application software can either boot from bank 1 or from bank 2 (only for category 3 devices). By default, boot from bank 1 is selected. To select boot from flash memory bank 2, set the BFB2 bit in the user option bytes. When this bit is set and the boot pins are in the boot from main flash memory configuration, the device boots from system memory, and the boot loader jumps to execute the user application programmed in flash memory bank 2. For further details, refer to AN2606. See Table 13: Access status versus protection level and execution modes for bootloader function for different RDP levels.

Forcing boot from user flash memory

Regardless the boot configuration, it is possible to force booting from a unique entry point in main flash memory.

Physical remap

Once the boot pins mode is 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 SYSCFG memory remap register (SYSCFG_MEMRMP) in the SYSCFG controller.

The following memories can be remapped:

Table 6. Memory mapping versus boot mode/physical remap (1)

AddressesBoot/remap in main flash memoryBoot/remap in embedded SRAM 1Boot/remap in system memoryRemap in FSMCRemap in QUADSPI
0x2000 0000 - 0x2002 3FFFSRAM1SRAM1SRAM1SRAM1SRAM1
0x1FFF 7000 - 0x1FFF FFFFSystem memory/OTP/Options bytesSystem memory/OTP/Options bytesSystem memory/OTP/Options bytesSystem memory/OTP/Options bytesSystem memory/OTP/Options bytes
0x1000 8000 - 0x1FFE FFFFReservedReservedReservedReservedReserved
0x1000 0000 - 0x1000 7FFFCCM SRAMCCM SRAMCCM SRAMCCM SRAMCCM SRAM
0x0808 0000 - 0x0FFF FFFFReservedReservedReservedReservedReserved
0x0800 0000 - 0x0807 FFFFFlash memoryFlash memoryFlash memoryFlash memoryFlash memory
0x0400 0000 - 0x07FF FFFFReservedReservedReservedFSMC bank 1 NOR/PSRAM 2 (128 MB) aliasedQUADSPI bank (128 MB) aliased
0x0010 0000 - 0x03FF FFFFReservedReservedReservedFSMC bank 1 NOR/PSRAM 1 (128 MB) aliasedQUADSPI bank (128 MB) aliased
0x0000 0000 - 0x0007 FFFF (2) (3)Flash memory aliasedSRAM1 aliasedSystem memory (28 KB) aliasedFSMC bank 1 NOR/PSRAM 1 (128 MB) aliasedQUADSPI aliased

1. Reserved memory area highlighted in gray.

2. When the FSMC is remapped at address 0x0000 0000, only the first two regions of bank 1 memory controller (bank 1 NOR/PSRAM 1 and NOR/PSRAM 2) can be remapped. When the FSMC is remapped at address 0x0000 0000, only 128 MB are remapped. In remap mode, the CPU can access the external memory via ICode bus instead of system bus, which boosts up the performance.

3. Even when aliased in the boot memory space, the related memory is still accessible at its original memory space.

Embedded boot loader

The embedded boot loader is located in the system memory, programmed by ST during production. Refer to AN2606 STM32 microcontroller system memory boot mode.