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 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 'GPIO Ports A,B,C,D,E,F' are connected via 'IOPORT'. Below the core, 'DMA1/2 DMAMUX channels 1 to 12' are connected via a 'DMA bus'. The 'Bus matrix' is connected to 'Flash memory interface' and 'SRAM' via the 'System bus'. The 'Bus matrix' is also connected to an 'AHB-to-APB bridge' via an 'AHB' bus. The 'AHB-to-APB bridge' is connected to a large block of 'APB' peripherals via an 'APB' bus. The 'AHB' bus also connects to 'CRC', 'AES', and 'EXTI' blocks. The 'APB' peripherals block includes: SYSCFG, ADC, DAC, COMP1, COMP2, COMP3, TIM1, TIM2, TIM3, TIM4, TIM6, TIM7, TIM14 to TIM17, LPTIM1, LPTIM2, UCPD1, UCPD2, IWDG, WWDG, RTC, PWR, I2C1, I2C2, I2C3, USART1 to USART6, LPUART1, LPUART2, SPI1/I2S1, SPI2/I2S2, SPI3, USB, FDCAN, HDMI-CEC, and DBG. 'RCC' and 'RNG' blocks are also connected to the 'AHB' bus. 'DMA requests' are shown from the 'CRC', 'AES', and 'EXTI' blocks to the 'DMA1/2 DMAMUX channels 1 to 12'.

Figure 1. System architecture diagram showing the interconnection of the 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 manages the access arbitration 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 on 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 in the RCC_AHBENR, RCC_APBENRx or RCC_IOPENR register must first be enabled.

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 addressable space, used space, and reserved space for various memory types like Code, RAM, Peripherals, System memory, Main Flash memory, Option bytes, Engineering bytes, OTP, IOPORT, AHB, and APB. Includes address ranges and footnotes.

The diagram illustrates the memory map for the STM32G0 series microcontrollers. It is divided into three main columns: Addressable space, Used space, and Reserved space. The Addressable space column shows blocks 0 through 7, starting from 0x0000 0000 at the bottom to 0xFFFF FFFF at the top. The Used space column lists the actual memory and peripheral allocations, including Code, RAM, Peripherals, System memory, Main Flash memory, Option bytes, Engineering bytes, OTP, IOPORT, AHB, and APB. The Reserved space column shows the upper address limits for each allocation. A legend at the top indicates that white boxes represent 'Used space' and grey boxes represent 'Reserved space'.

Addressable spaceUsed spaceReserved space
0x0000 0000Main Flash memory / System memory / RAM (3)0x0000 0000
block 0Main Flash memory0x0800 0000
0x2000 0000RAM(2)
block 1System memory0x1FFF 0000
0x4000 0000Peripherals0x1FFF 7000
block 2OTP0x1FFF 73FF
0x6000 0000Engineering bytes0x1FFF 7500
block 3Option bytes0x1FFF 7800
0x8000 0000APB0x4000 0000
block 4APB0x4001 0000
0xA000 0000ARM Cortex M0+ internal peripherals0x4001 5BFF
block 5AHB0x4002 0000
0xC000 0000IOPORT0x4002 63FF
block 60x5000 0000
0xE000 00000x5000 1FFF
block 7
0xFFFF FFFF
Memory map diagram showing addressable space, used space, and reserved space for various memory types like Code, RAM, Peripherals, System memory, Main Flash memory, Option bytes, Engineering bytes, OTP, IOPORT, AHB, and APB. Includes address ranges and footnotes.
  1. 1. STM32G0B1xx and STM32G0C1xx: 0x0007 FFFF; STM32G071xx and STM32G081xx: 0x0001 FFFF; STM32G051xx and STM32G061xx, STM32G031xx and STM32G041xx: 0x0000 FFFF.
  2. 2. STM32G0B1xx and STM32G0C1xx: 0x0807 FFFF; STM32G071xx and STM32G081xx: 0x0801 FFFF; STM32G051xx and STM32G061xx, STM32G031xx and STM32G041xx: 0x0800 FFFF.
  3. 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. STM32G0B1xx and STM32G0C1xx memory boundary addresses
TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2002 4000 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2002 3FFF144 KBSRAMSection 2.3 on page 66
Code0x1FFF 7880- 0x1FFF FFFF~34 KBReserved-
0x1FFF 7800 - 0x1FFF 787F128 BOption bytesSection 3.4 on page 82
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400- 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 0000 - 0x1FFF 6FFF28 KBSystem memory-
0x0808 0000 - 0x1FFF D7FF~384 MBReserved-
0x0800 0000 - 0x0807 FFFF512 KBMain flash memorySection 3.3.1 on page 71
0x0008 0000 - 0x07FF FFFF~128 MBReserved-
0x0000 0000 - 0x0007 FFFF512 KBMain flash memory, system memory or SRAM depending on boot configuration-
Table 3. STM32G071xx and STM32G081xx memory boundary addresses
TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2000 9000 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2000 8FFF36 KBSRAMSection 2.3 on page 66
Code0x1FFF 7880- 0x1FFF FFFF~34 KBReserved-
0x1FFF 7800 - 0x1FFF 787F128 BOption bytesSection 3.4 on page 82
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400- 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 0000 - 0x1FFF 6FFF28 KBSystem memory-
0x0802 0000 - 0x1FFF D7FF~384 MBReserved-
0x0800 0000 - 0x0801 FFFF128 KBMain flash memorySection 3.3.1 on page 71
0x0002 0000 - 0x07FF FFFF~128 MBReserved-
0x0000 0000 - 0x0001 FFFF128 KBMain flash memory, system memory or SRAM depending on boot configuration-
Table 4. STM32G051xx and STM32G061xx memory boundary addresses
TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2000 4800 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2000 47FF18 KBSRAMSection 2.3 on page 66
Table 4. STM32G051xx and STM32G061xx memory boundary addresses (continued)
TypeBoundary addressSizeMemory AreaRegister description
Code0x1FFF 7880- 0x1FFF FFFF~34 KBReserved-
0x1FFF 7800 - 0x1FFF 787F128 BOption bytesSection 3.4 on page 82
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400- 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 2000 - 0x1FFF 6FFF~20 KBReserved-
0x1FFF 0000 - 0x1FFF 1FFF8 KBSystem memory-
0x0801 0000 - 0x1FFF D7FF~384 MBReserved-
0x0800 0000 - 0x0800 FFFF64 KBMain flash memorySection 3.3.1 on page 71
0x0001 0000 - 0x07FF FFFF~128 MBReserved-
0x0000 0000 - 0x0000 FFFF64 KBMain flash memory, system memory or SRAM depending on boot configuration-
Table 5. STM32G031xx and STM32G041xx memory boundary addresses
TypeBoundary addressSizeMemory AreaRegister description
SRAM0x2000 2000 - 0x3FFF FFFF~512 MBReserved-
0x2000 0000 - 0x2000 1FFF8 KBSRAMSection 2.3 on page 66
Code0x1FFF 7880- 0x1FFF FFFF~34 KBReserved-
0x1FFF 7800 - 0x1FFF 787F128 BOption bytesSection 3.4 on page 82
0x1FFF 7500 - 0x1FFF 77FF768 BEngineering bytes-
0x1FFF 7400- 0x1FFF 74FF256 BReserved-
0x1FFF 7000 - 0x1FFF 73FF1 KBOTP-
0x1FFF 2000 - 0x1FFF 6FFF~20 KBReserved-
0x1FFF 0000 - 0x1FFF 1FFF8 KBSystem memory-
0x0801 0000 - 0x1FFF D7FF~384 MBReserved-
0x0800 0000 - 0x0800 FFFF64 KBMain flash memorySection 3.3.1 on page 71
0x0001 0000 - 0x07FF FFFF~128 MBReserved-
0x0000 0000 - 0x0000 FFFF64 KBMain flash memory, system memory or SRAM depending on boot configuration-

The following table gives the boundary addresses of the peripherals.

Table 6. STM32G0x1 peripheral register boundary addresses

BusBoundary addressSizePeripheralPeripheral register map
-0xE000 0000 - 0xE00F FFFF1MBCortex®-M0+ internal peripherals-
IOPORT0x5000 1800 - 0x5FFF FFFF~256 MBReserved-
0x5000 1400 - 0x5000 17FF1 KBGPIOFSection 7.5.12 on page 245
0x5000 1000 - 0x5000 13FF1 KBGPIOESection 7.5.12 on page 245
0x5000 0C00 - 0x5000 0FFF1 KBGIOPDSection 7.5.12 on page 245
0x5000 0800 - 0x5000 0BFF1 KBGPIOCSection 7.5.12 on page 245
0x5000 0400 - 0x5000 07FF1 KBGPIOBSection 7.5.12 on page 245
0x5000 0000 - 0x5000 03FF1 KBGPIOASection 7.5.12 on page 245
AHB0x4002 6400 - 0x4FFF FFFF~256 MBReserved-
0x4002 6000 - 0x4002 63FF1 KBAESSection 20.7.18 on page 513
0x4002 5400 - 0x4002 5FFF3 KBReserved-
0x4002 5000 - 0x4002 53FF1 KBRNGSection 19.7.4 on page 465
0x4002 3400 - 0x4002 4FFF3 KBReserved-
0x4002 3000 - 0x4002 33FF1 KBCRCSection 14.4.6 on page 340
0x4002 2400 - 0x4002 2FFF3 KBReserved-
0x4002 2000 - 0x4002 23FF1 KBFLASHSection 3.7.22 on page 112
0x4002 1C00 - 0x4002 1FFF3 KBReserved-
0x4002 1800 - 0x4002 1BFF1 KBEXTISection 13.5.16 on page 332
0x4002 1400 - 0x4002 17FF1 KBReserved-
0x4002 1000 - 0x4002 13FF1 KBRCCSection 5.4.25 on page 213
0x4002 0C00 - 0x4002 0FFF1 KBReserved-
0x4002 0800 - 0x4002 0BFF1 KBDMAMUXSection 11.6.7 on page 310
0x4002 0400 - 0x4002 07FF1 KBDMA2Section 10.6.7 on page 293
0x4002 0000 - 0x4002 03FF1 KBDMA1Section 10.6.7 on page 293
APB0x4001 5C00 - 0x4001 FFFF32 KBReserved-
0x4001 5800 - 0x4001 5BFF1 KBDBGSection 40.10.5 on page 1366
0x4001 4C00 - 0x4001 57FF3 KBReserved-
0x4001 4800 - 0x4001 4BFF1 KBTIM17Section 25.6.21 on page 821
0x4001 4400 - 0x4001 47FF1 KBTIM16Section 25.6.21 on page 821

Table 6. STM32G0x1 peripheral register boundary addresses (continued)

BusBoundary addressSizePeripheralPeripheral register map
APB0x4001 4000 - 0x4001 43FF1 KBTIM15Section 25.6.21 on page 821
0x4001 3C00 - 0x4001 3FFF1 KBUSART6Section 33.8.15 on page 1069
0x4001 3800 - 0x4001 3BFF1 KBUSART1Section 33.8.15 on page 1069
0x4001 3400 - 0x4001 37FF1 KBReserved-
0x4001 3000 - 0x4001 33FF1 KBSPI1/I2S1Section 35.9.10 on page 1181
0x4001 2C00 - 0x4001 2FFF1 KBTIM1Section 21.4 on page 576
0x4001 2800 - 0x4001 2BFF1 KBReserved-
0x4001 2400 - 0x4001 27FF1 KBADCSection 15.13 on page 397
0x4001 0400 - 0x4001 23FF8 KBReserved-
0x4001 0200 - 0x4001 03FF1 KBCOMPSection 18.6.4 on page 453
0x4001 0080 - 0x4001 01FFSYSCFG(ITLINE) (1)Section 8.1.35 on page 265
0x4001 0030 - 0x4001 007FVREFBUFSection 17.3.3 on page 439
0x4001 0000 - 0x4001 002FSYSCFGSection 8.1.35 on page 265
0x4000 BC00 - 0x4000 FFFF17 KBReserved-
0x4000 B400 - 0x4000 BBFF2 KBFDCAN message RAM-
0x4000 B000 - 0x4000 B3FF1 KBTAMP (+ BKP registers)Section 31.6.9 on page 918
0x4000 A800 - 0x4000 AFFF2 KBReserved-
0x4000 A400 - 0x4000 A7FF1 KBUCPD2Section 38.8.15 on page 1332
0x4000 A000 - 0x4000 A3FF1 KBUCPD1Section 38.8.15 on page 1332
0x4000 9C00 - 0x4000 9FFF1 KBUSB RAM2-
0x4000 9800 - 0x4000 9BFF1 KBUSB RAM1-
0x4000 9400 - 0x4000 97FF1 KBLPTIM2Section 26.7.10 on page 848
0x4000 8C00 - 0x4000 93FF2 KBReserved-
0x4000 8800 - 0x4000 8BFF1 KBI2C3Section 32.9.12 on page 983
0x4000 8400 - 0x4000 87FF1 KBLPUART2Section 33.8.15 on page 1069
0x4000 8000 - 0x4000 83FF1 KBLPUART1Section 33.8.15 on page 1069
0x4000 7C00 - 0x4000 7FFF1 KBLPTIM1Section 26.7.10 on page 848
0x4000 7800 - 0x4000 7BFF1 KBCECSection 39.7.7 on page 1352
0x4000 7400 - 0x4000 77FF1 KBDACSection 16.7.21 on page 430
0x4000 7000 - 0x4000 73FF1 KBPWRSection 4.4.20 on page 153
0x4000 6C00 - 0x4000 6FFF1 KBCRSSection 6.7.5 on page 227
0x4000 6800 - 0x4000 6BFF1 KBFDCAN2Section 36.4.38 on page 1244
0x4000 6400 - 0x4000 67FF1 KBFDCAN1Section 36.4.38 on page 1244
0x4000 6000 - 0x4000 63FF1 KBReserved-
0x4000 5C00 - 0x4000 5FFF1 KBUSBSection 37.6.8 on page 1289
Table 6. STM32G0x1 peripheral register boundary addresses (continued)
BusBoundary addressSizePeripheralPeripheral register map
APB0x4000 5800 - 0x4000 5BFF1 KBI2C2Section 32.9.12 on page 983
0x4000 5400 - 0x4000 57FF1 KBI2C1Section 32.9.12 on page 983
0x4000 5000 - 0x4000 53FF1 KBUSART5Section 33.8.15 on page 1069
0x4000 4C00 - 0x4000 4FFF1 KBUSART4Section 33.8.15 on page 1069
0x4000 4800 - 0x4000 4BFF1 KBUSART3Section 33.8.15 on page 1069
0x4000 4400 - 0x4000 47FF1 KBUSART2Section 33.8.15 on page 1069
0x4000 4000 - 0x4000 43FF1 KBReserved-
0x4000 3C00 - 0x4000 3FFF1 KBSPI3Section 35.9.10 on page 1181
0x4000 3800 - 0x4000 3BFF1 KBSPI2/I2S2Section 35.9.10 on page 1181
0x4000 3400 - 0x4000 37FF1 KBReserved-
0x4000 3000 - 0x4000 33FF1 KBIWDGSection 28.4.6 on page 858
0x4000 2C00 - 0x4000 2FFF1 KBWWDGSection 29.5.4 on page 864
0x4000 2800 - 0x4000 2BFF1 KBRTCSection 30.6.21 on page 902
0x4000 2400 - 0x4000 27FF1 KBReserved-
0x4000 2000 - 0x4000 23FF1 KBTIM14Section 24.4.13 on page 731
0x4000 1800 - 0x4000 1FFF2 KBReserved-
0x4000 1400 - 0x4000 17FF1 KBTIM7Section 23.4.9 on page 706
0x4000 1000 - 0x4000 13FF1 KBTIM6Section 23.4.9 on page 706
0x4000 0C00 - 0x4000 0FFF1 KBReserved-
0x4000 0800 - 0x4000 0BFF1 KBTIM4Section 22.4.31 on page 691
0x4000 0400 - 0x4000 07FF1 KBTIM3Section 22.4.31 on page 691
0x4000 0000 - 0x4000 03FF1 KBTIM2Section 22.4.31 on page 691

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 7. SRAM size
DeviceSRAM with parity enabled (Kbyte)SRAM with parity disabled (Kbyte)
STM32G0B1xx and STM32G0C1xx128144
STM32G071xx and STM32G081xx3236
STM32G051xx and STM32G061xx1618
STM32G031xx and STM32G041xx88

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 3.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. In addition, to get the SRAM parity error at the same cycle time that it is occurring, a bus error is generated (triggering a HardFault exception) together with the NMI. This avoids the corrupted data to be used by the application, but with the side effect of having both NMI and HardFault interrupts generated. The same error can also be linked to the BRK_IN Break input of TIM1/15/16/17, with the SRAM_PARITY_LOCK control bit in the SYSCFG configuration register 2 (SYSCFG_CFGR2) . The SRAM Parity Error flag (SRAM_PEF) is available in the SYSCFG configuration register 2 (SYSCFG_CFGR2) .

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 Flash memory overview

The flash memory is composed of two distinct physical areas:

Refer to Section 3: Embedded flash memory (FLASH) for more details.

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.

2.5 Boot configuration

In the STM32G0x1, three different boot modes can be selected through the BOOT0 pin, BOOT_LOCK bit in FLASH_SECR register, and boot configuration bits nBOOT1, BOOT_SEL and nBOOT0 in the user option byte, as shown in the following table.

Table 8. Boot modes

Boot mode configurationSelected boot area
BOOT_LOCK bitnBOOT1 bitBOOT0 pinnBOOT_SEL bitnBOOT0 bit
0x00xMain flash memory (1)
0110xSystem memory
0010xEmbedded SRAM
0xx11Main flash memory (1)
01x10System memory
00x10Embedded SRAM
1xxxxMain flash memory forced
  1. 1. Boot forced to system memory when EMPTY bit of the FLASH access control register (FLASH_ACR) is set. See the Empty check section.

The BOOT0 pin is sampled on the NRST (external reset) rising edge. Refer to the NRST (external reset) description in Section 5.1.2: System reset for further details about how the PF2-NRST pin mode impacts the BOOT0 sampling. The user option bits are loaded during the option byte load (OBL) process.

The boot mode configuration is then latched on the fourth rising edge of SYSCLK after a reset. It is up to the user to set the boot mode configuration related to the required boot mode.

The boot mode configuration is also re-sampled when exiting Standby or Shutdown mode. Consequently, it must be kept in the required boot mode configuration while in Standby or in Shutdown 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:

Caution: BOOT0 pin shares the same GPIO with serial wire clock (SWCLK) that is used by the debugger to connect with the device, based on the fact that these functionalities can be considered almost completely disjoint. Nevertheless, to ensure system robustness, the

STM32G0x1 devices provide an hardware mechanism to force BOOT0 low (boot from User flash memory) if a debugger access is detected (and BOOT0 information is taken from the pin), in order to use SWCLK clock for debugger serial communications and at the same time have a safe boot configuration for the device itself. This configuration is kept until next power-on following debugger access.

2.5.1 Physical remap

Once the boot mode is selected, the application software can modify the memory accessible in the code area. This modification is performed by programming the MEM_MODE bits in the SYSCFG configuration register 1 (SYSCFG_CFGR1) .

2.5.2 Embedded bootloader

The embedded bootloader is located in the system memory, programmed by ST during production. It is used to reprogram the flash memory using one of the following serial interfaces:

For further details, refer to the device data sheets and AN2606.

2.5.3 Forcing boot from main flash memory

The BOOT_LOCK bit allows forcing a unique entry point in the main flash memory for boot, regardless of the other boot mode configuration bits or the empty check flag. For more details, refer to Section 3.5.6: Forcing boot from main flash memory .

2.5.4 Empty check

Internal empty check flag (the EMPTY bit of the FLASH access control register (FLASH_ACR) ) is implemented to allow easy programming of virgin devices by the bootloader. This flag is checked when the boot configuration defines the main flash memory as the target boot area and the BOOT_LOCK bit is not set. When the EMPTY flag is set, the device is considered empty and system memory (bootloader) is selected instead of the main flash memory as a boot area, to allow the user to program the device. Refer to AN2606 for more details concerning the bootloader and GPIO configuration in system memory boot mode (some of the GPIOs are reconfigured from the High-Z state).

The EMPTY flag is updated by hardware only during the loading of option bytes: it is set when the full 72-bit content (including ECC) of the address 0x0800 0000 is read as 0xFF FFFF FFFF FFFF FFFF, otherwise it is cleared. It means that, after programming of a virgin device, a power on reset or setting of OBL_LAUNCH bit in FLASH_CR register is required to clear the EMPTY flag (the system reset has no impact on this flag). Software can also modify the EMPTY flag directly in the FLASH_ACR register.

Note: If the device is programmed for the first time but the EMPTY flag is not updated, the device still selects the system memory as a boot area after a system reset.