2. Memory and bus architecture

2.1 System architecture

In low- and medium-density value line devices, the main system consists of:

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

Figure 1. Low and medium density value line system architecture

Block diagram of the low and medium density value line system architecture. The diagram shows a Cortex-M3 core and DMA1 as masters connected to a central Bus matrix. The Cortex-M3 is connected via ICode, DCode, and System buses. DMA1 is connected via DMA and has 7 channels (Ch.1 to Ch.7). The Bus matrix connects to FLASH (Flash interface), SRAM, and the AHB system bus. The AHB system bus is connected to Bridge 1 and Bridge 2, which in turn connect to APB2 and APB1 buses respectively. The APB2 bus connects to a block containing TIM17, TIM16, TIM15, USART1, SPI1, TIM1, and ADC1. The APB1 bus connects to a block containing DAC2, SPI2, DAC1, TIM7, I2C2, TIM6, I2C1, TIM4, USART3, TIM3, USART2, and TIM2. A Reset & clock control (RCC) block is also connected to the AHB system bus. DMA request lines are shown from the APB2 and APB1 blocks back to the DMA1 block. The diagram is labeled ai17302.
Block diagram of the low and medium density value line system architecture. The diagram shows a Cortex-M3 core and DMA1 as masters connected to a central Bus matrix. The Cortex-M3 is connected via ICode, DCode, and System buses. DMA1 is connected via DMA and has 7 channels (Ch.1 to Ch.7). The Bus matrix connects to FLASH (Flash interface), SRAM, and the AHB system bus. The AHB system bus is connected to Bridge 1 and Bridge 2, which in turn connect to APB2 and APB1 buses respectively. The APB2 bus connects to a block containing TIM17, TIM16, TIM15, USART1, SPI1, TIM1, and ADC1. The APB1 bus connects to a block containing DAC2, SPI2, DAC1, TIM7, I2C2, TIM6, I2C1, TIM4, USART3, TIM3, USART2, and TIM2. A Reset & clock control (RCC) block is also connected to the AHB system bus. DMA request lines are shown from the APB2 and APB1 blocks back to the DMA1 block. The diagram is labeled ai17302.

In high-density value line devices, the main system consists of:

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

Figure 2. High density value line system architecture

Figure 2. High density value line system architecture diagram. The diagram shows a central 'Bus matrix' connected to four masters: Cortex-M3 (via ICode, DCode, System, and DMA buses), DMA1 (via DMA bus), DMA2 (via DMA bus), and Reset & clock control (RCC) (via AHB system bus). The bus matrix connects to four slaves: FLASH (Flash interface) (connected to Flash memory), SRAM, FSMC, and Bridge 2. Bridge 2 connects to Bridge 1, which connects to APB2. APB2 connects to a group of peripherals: ADC1, USART1, SPI1, TIM1, TIM17, TIM16, TIM15, GPIO, DAC2, DAC1, I2C2, I2C1, UART5, UART4, USART3, USART2, SPI2, SPI3, TIM7, TIM6, TIM5, TIM4, TIM3, TIM2, CEC, TIM14, TIM13, and TIM12. DMA Request lines are shown from the peripherals to DMA1 and DMA2.
Figure 2. High density value line system architecture diagram. The diagram shows a central 'Bus matrix' connected to four masters: Cortex-M3 (via ICode, DCode, System, and DMA buses), DMA1 (via DMA bus), DMA2 (via DMA bus), and Reset & clock control (RCC) (via AHB system bus). The bus matrix connects to four slaves: FLASH (Flash interface) (connected to Flash memory), SRAM, FSMC, and Bridge 2. Bridge 2 connects to Bridge 1, which connects to APB2. APB2 connects to a group of peripherals: ADC1, USART1, SPI1, TIM1, TIM17, TIM16, TIM15, GPIO, DAC2, DAC1, I2C2, I2C1, UART5, UART4, USART3, USART2, SPI2, SPI3, TIM7, TIM6, TIM5, TIM4, TIM3, TIM2, CEC, TIM14, TIM13, and TIM12. DMA Request lines are shown from the peripherals to DMA1 and DMA2.

ICode bus

This bus connects the instruction bus of the Cortex ® -M3 core to the flash memory instruction interface. Instruction fetches are performed on this bus.

DCode bus

This bus connects the DCode bus (literal load and debug access) of the Cortex ® -M3 core to the flash memory data interface.

System bus

This bus connects the system bus of the Cortex ® -M3 core (peripherals bus) to a bus matrix which 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 which manages the access of CPU DCode and DMA to the SRAM, flash memory and 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. In low and medium-density value line devices the bus matrix is composed of three masters (CPU DCode, System bus, DMA1 bus) and three slaves (FLITF, SRAM and AHB to APB bridges).

In high-density value line devices the bus matrix is composed of four masters (CPU DCode, System bus, DMA1 bus and DMA2 bus) and four slaves (FLITF, SRAM, FSMC and AHB to APB bridges).

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

AHB/APB bridges (APB)

The two AHB/APB bridges provide full synchronous connections between the AHB and the two APB buses. APB buses operate at full speed (up to 24 MHz).

Refer to Table 2 for the address mapping of the peripherals connected to each bridge.

After each device reset, all peripheral clocks are disabled (except for the SRAM and FLITF). Before using a peripheral its clock in the RCC_AHBENR, RCC_APB2ENR or RCC_APB1ENR register must 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

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.

For the detailed mapping of peripheral registers, refer to the related sections.

The addressable memory space is divided into 8 main blocks, each of 512 MB.

All the memory areas that are not allocated to on-chip memories and peripherals are considered "reserved"). Refer to the memory map figure in the corresponding product datasheet.

2.3 Memory map

See the datasheet corresponding to the used device for a comprehensive diagram of the memory map. Table 1 and Table 2 give the boundary addresses of the peripherals available in all STM32F100xx devices.

Table 1. Low and medium-density device register boundary addresses

Boundary addressPeripheralBusRegister map
0x4002 3000 - 0x4002 33FFCRCAHBSection 3.4.4 on page 49
0x4002 2400 - 0x4002 2FFFReserved-
0x4002 2000 - 0x4002 23FFFlash memory interface-
0x4002 1400 - 0x4002 1FFFReserved-
0x4002 1000 - 0x4002 13FFReset and clock control RCCSection 6.3.12 on page 101
0x4002 0400 - 0x4002 0FFFReserved-
0x4002 0000 - 0x4002 03FFDMA1Section 9.4.7 on page 159
0x4001 4C00 - 0x4001 FFFFReservedAPB2-
0x4001 4800 - 0x4001 4BFFTIM17 timerSection 15.6.16 on page 454
0x4001 4400 - 0x4001 47FFTIM16 timerSection 15.6.16 on page 454
0x4001 4000 - 0x4001 43FFTIM15 timerSection 15.5.18 on page 434
0x4001 3C00 - 0x4001 3FFFReserved-
0x4001 3800 - 0x4001 3BFFUSART1Section 23.6.8 on page 646
0x4001 3400 - 0x4001 37FFReserved-
0x4001 3000 - 0x4001 33FFSPI1Section 21.4.8 on page 565
0x4001 2C00 - 0x4001 2FFFTIM1 timerSection 12.4.21 on page 282
0x4001 2800 - 0x4001 2BFFReserved-
0x4001 2400 - 0x4001 27FFADC1Section 10.11.15 on page 188
0x4001 1C00 - 0x4001 23FFReserved-
0x4001 1800 - 0x4001 1BFFGPIO Port ESection 7.5 on page 130
0x4001 1400 - 0x4001 17FFGPIO Port DSection 7.5 on page 130
0x4001 1000 - 0x4001 13FFGPIO Port CSection 7.5 on page 130
0x4001 0C00 - 0x4001 0FFFGPIO Port BSection 7.5 on page 130
0x4001 0800 - 0x4001 0BFFGPIO Port ASection 7.5 on page 130
0x4001 0400 - 0x4001 07FFEXTISection 8.3.7 on page 143
0x4001 0000 - 0x4001 03FFAFIOSection 7.5 on page 130
Table 1. Low and medium-density device register boundary addresses (continued)
Boundary addressPeripheralBusRegister map
0x4000 7C00 - 0x4000 FFFFReservedAPB1-
0x4000 7800 - 0x4000 7BFFCECSection 24.9.8 on page 668
0x4000 7400 - 0x4000 77FFDACSection 11.5.15 on page 210
0x4000 7000 - 0x4000 73FFPower control PWRSection 4.4.3 on page 63
0x4000 6C00 - 0x4000 6FFFBackup registers (BKP)Section 5.4.5 on page 69
0x4000 5C00 - 0x4000 6BFFReserved-
0x4000 5800 - 0x4000 5BFFI2C2Section 22.6.10 on page 598
0x4000 5400 - 0x4000 57FFI2C1Section 22.6.10 on page 598
0x4000 4C00 - 0x4000 53FFReserved-
0x4000 4800 - 0x4000 4BFFUSART3Section 23.6.8 on page 646
0x4000 4400 - 0x4000 47FFUSART2Section 23.6.8 on page 646
0x4000 3C00 - 0x4000 3FFFReserved-
0x4000 3800 - 0x4000 3BFFSPI2Section 21.4.8 on page 565
0x4000 3400 - 0x4000 37FFReserved-
0x4000 3000 - 0x4000 33FFIndependent watchdog (IWDG)Section 18.4.5 on page 486
0x4000 2C00 - 0x4000 2FFFWindow watchdog (WWDG)Section 19.6.4 on page 493
0x4000 2800 - 0x4000 2BFFRTCSection 17.4.7 on page 480
0x4000 1800 - 0x4000 27FFReserved-
0x4000 1400 - 0x4000 17FFTIM7 timerSection 16.4.9 on page 468
0x4000 1000 - 0x4000 13FFTIM6 timerSection 16.4.9 on page 468
0x4000 0C00 - 0x4000 0FFFReserved-
0x4000 0800 - 0x4000 0BFFTIM4 timerSection 13.4.19 on page 340
0x4000 0400 - 0x4000 07FFTIM3 timerSection 13.4.19 on page 340
0x4000 0000 - 0x4000 03FFTIM2 timerSection 13.4.19 on page 340
Table 2. High-density device register boundary addresses
Boundary addressPeripheralBusRegister map
0x4002 3000 - 0x4002 33FFCRCAHBSection 3.4.4 on page 49
0x4002 2400 - 0x4002 2FFFReserved-
0x4002 2000 - 0x4002 23FFFlash memory interface-
0x4002 1400 - 0x4002 1FFFReserved-
0x4002 1000 - 0x4002 13FFReset and clock control RCCSection 6.3.12 on page 101
0x4002 0800 - 0x4002 0FFFReserved-
0x4002 0400 - 0x4002 07FFDMA2Section 9.4.7 on page 159
0x4002 0000 - 0x4002 03FFDMA1Section 9.4.7 on page 159

Table 2. High-density device register boundary addresses (continued)

Boundary addressPeripheralBusRegister map
0x4001 4C00 - 0x4001 FFFFReservedAPB2-
0x4001 4800 - 0x4001 4BFFTIM17 timerSection 15.6.16 on page 454
0x4001 4400 - 0x4001 47FFTIM16 timerSection 15.6.16 on page 454
0x4001 4000 - 0x4001 43FFTIM15 timerSection 15.5.18 on page 434
0x4001 3C00 - 0x4001 3FFFReserved-
0x4001 3800 - 0x4001 3BFFUSART1Section 23.6.8 on page 646
0x4001 3400 - 0x4001 37FFReserved-
0x4001 3000 - 0x4001 33FFSPI1Section 21.4.8 on page 565
0x4001 2C00 - 0x4001 2FFFTIM1 timerSection 12.4.21 on page 282
0x4001 2800 - 0x4001 2BFFReserved-
0x4001 2400 - 0x4001 27FFADC1Section 10.11.15 on page 188
0x4001 2000 - 0x4001 23FFGPIO Port GSection 7.5 on page 130
0x4001 1C00 - 0x4001 1FFFGPIO Port FSection 7.5 on page 130
0x4001 1800 - 0x4001 1BFFGPIO Port ESection 7.5 on page 130
0x4001 1400 - 0x4001 17FFGPIO Port DSection 7.5 on page 130
0x4001 1000 - 0x4001 13FFGPIO Port CSection 7.5 on page 130
0x4001 0C00 - 0x4001 0FFFGPIO Port BSection 7.5 on page 130
0x4001 0800 - 0x4001 0BFFGPIO Port ASection 7.5 on page 130
0x4001 0400 - 0x4001 07FFEXTISection 8.3.7 on page 143
0x4001 0000 - 0x4001 03FFAFIOSection 7.5 on page 130

Table 2. High-density device register boundary addresses (continued)

Boundary addressPeripheralBusRegister map
0x4000 7C00 - 0x4000 FFFFReserved-
0x4000 7800 - 0x4000 7BFFCECSection 24.9.8 on page 668
0x4000 7400 - 0x4000 77FFDACSection 11.5.15 on page 210
0x4000 7000 - 0x4000 73FFPower control PWRSection 4.4.3 on page 63
0x4000 6C00 - 0x4000 6FFFBackup registers (BKP)Section 5.4.5 on page 69
0x4000 5C00 - 0x4000 6BFFReserved-
0x4000 5800 - 0x4000 5BFFI2C2Section 22.6.10 on page 598
0x4000 5400 - 0x4000 57FFI2C1Section 22.6.10 on page 598
0x4000 5000 - 0x4000 53FFUART5Section 23.6.8 on page 646
0x4000 4C00 - 0x4000 4FFFUART4Section 23.6.8 on page 646
0x4000 4800 - 0x4000 4BFFUSART3Section 23.6.8 on page 646
0x4000 4400 - 0x4000 47FFUSART2Section 23.6.8 on page 646
0x4000 4000 - 0x4000 43FFReserved-
0x4000 3C00 - 0x4000 3FFFSPI3Section 21.4.8 on page 565
0x4000 3800 - 0x4000 3BFFSPI2APB1Section 21.4.8 on page 565
0x4000 3400 - 0x4000 37FFReserved-
0x4000 3000 - 0x4000 33FFIndependent watchdog (IWDG)Section 18.4.5 on page 486
0x4000 2C00 - 0x4000 2FFFWindow watchdog (WWDG)Section 18.4.5 on page 486
0x4000 2800 - 0x4000 2BFFRTCSection 17.4.7 on page 480
0x4000 2400 - 0x4000 27FFReserved-
0x4000 2000 - 0x4000 23FFTIM14 timerSection 14.5.11 on page 387
0x4000 1C00 - 0x4000 1FFFTIM13 timerSection 14.5.11 on page 387
0x4000 1800 - 0x4000 1BFFTIM12 timerSection 14.4.14 on page 377
0x4000 1400 - 0x4000 17FFTIM7 timerSection 16.4.9 on page 468
0x4000 1000 - 0x4000 13FFTIM6 timerSection 16.4.9 on page 468
0x4000 0C00 - 0x4000 0FFFTIM5 timerSection 13.4.19 on page 340
0x4000 0800 - 0x4000 0BFFTIM4 timerSection 13.4.19 on page 340
0x4000 0400 - 0x4000 07FFTIM3 timerSection 13.4.19 on page 340
0x4000 0000 - 0x4000 03FFTIM2 timerSection 13.4.19 on page 340

2.3.1 Embedded SRAM

The STM32F100xx features up to 32 Kbytes of static SRAM. It can be accessed as bytes, half-words (16 bits) or full words (32 bits). The SRAM start address is 0x2000 0000.

2.3.2 Bit banding

The Cortex®-M3 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 STM32F100xx, both peripheral registers and SRAM are mapped in a bit-band region. This allows single bit-band write and read operations to be performed.

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:

bit_word_addr is the address of the word in the alias memory region that maps to the targeted bit

bit_band_base is the starting address of the alias region

byte_offset is the number of the byte in the bit-band region that contains the targeted bit

bit_number is the bit position (0-7) of the targeted bit

Example:

The following example shows how to map bit 2 of the byte located at SRAM address 0x2000 0300 in the alias region:

\[ 0x2200\ 6008 = 0x2200\ 0000 + (0x300 \times 32) + (2 \times 4). \]

Writing to address 0x2200 6008 has the same effect as a read-modify-write operation on bit 2 of the byte at SRAM address 0x2000 0300.

Reading address 0x2200 6008 returns the value (0x01 or 0x00) of bit 2 of the byte at SRAM address 0x2000 0300 (0x01: bit set; 0x00: bit cleared).

For more information on bit-banding, refer to the Cortex®-M3 Technical Reference Manual .

2.3.3 Embedded flash memory

The high-performance flash memory module has the following key features:

The flash memory interface (FLASH) features:

Table 3. Flash module organization (low-density value line devices)

BlockNameBase addressesSize (bytes)
Main memoryPage 00x0800 0000 - 0x0800 03FF1 Kbyte
Page 10x0800 0400 - 0x0800 07FF1 Kbyte
Page 20x0800 0800 - 0x0800 0BFF1 Kbyte
Page 30x0800 0C00 - 0x0800 0FFF1 Kbyte
Page 40x0800 1000 - 0x0800 13FF1 Kbyte
Page 310x0800 7C00 - 0x0800 80001 Kbyte
Information blockSystem memory0x1FFF F000 - 0x1FFF F7FF2 Kbytes
Option Bytes0x1FFF F800 - 0x1FFF F80F16
Flash memory interface registersFLASH_ACR0x4002 2000 - 0x4002 20034
FLASH_KEYR0x4002 2004 - 0x4002 20074
FLASH_OPTKEYR0x4002 2008 - 0x4002 200B4
FLASH_SR0x4002 200C - 0x4002 200F4
FLASH_CR0x4002 2010 - 0x4002 20134
FLASH_AR0x4002 2014 - 0x4002 20174
Reserved0x4002 2018 - 0x4002 201B4
FLASH_OBR0x4002 201C - 0x4002 201F4
FLASH_WRPR0x4002 2020 - 0x4002 20234
Table 4. Flash module organization (medium-density value line devices)
BlockNameBase addressesSize (bytes)
Main memoryPage 00x0800 0000 - 0x0800 03FF1 Kbyte
Page 10x0800 0400 - 0x0800 07FF1 Kbyte
Page 20x0800 0800 - 0x0800 0BFF1 Kbyte
Page 30x0800 0C00 - 0x0800 0FFF1 Kbyte
Page 40x0800 1000 - 0x0800 13FF1 Kbyte
...
Page 1270x0801 FC00 - 0x0801 FFFF1 Kbyte
Information blockSystem memory0x1FFF F000 - 0x1FFF F7FF2 Kbytes
Option Bytes0x1FFF F800 - 0x1FFF F80F16
Flash memory interface registersFLASH_ACR0x4002 2000 - 0x4002 20034
FLASH_KEYR0x4002 2004 - 0x4002 20074
FLASH_OPTKEYR0x4002 2008 - 0x4002 200B4
FLASH_SR0x4002 200C - 0x4002 200F4
FLASH_CR0x4002 2010 - 0x4002 20134
FLASH_AR0x4002 2014 - 0x4002 20174
Reserved0x4002 2018 - 0x4002 201B4
FLASH_OBR0x4002 201C - 0x4002 201F4
FLASH_WRPR0x4002 2020 - 0x4002 20234
Table 5. Flash module organization (high-density value line devices)
BlockNameBase addressesSize (bytes)
Main memoryPage 00x0800 0000 - 0x0800 07FF2 Kbytes
Page 10x0800 0800 - 0x0800 0FFF2 Kbytes
Page 20x0800 1000 - 0x0800 17FF2 Kbytes
Page 30x0800 1800 - 0x0800 1FFF2 Kbytes
...
Page 2550x0807 F800 - 0x0807 FFFF2 Kbytes
Information blockSystem memory0x1FFF F000 - 0x1FFF F7FF2 Kbytes
Option Bytes0x1FFF F800 - 0x1FFF F80F16
Table 5. Flash module organization (high-density value line devices) (continued)
BlockNameBase addressesSize (bytes)
Flash memory interface registersFLASH_ACR0x4002 2000 - 0x4002 20034
FLASH_KEYR0x4002 2004 - 0x4002 20074
FLASH_OPTKEYR0x4002 2008 - 0x4002 200B4
FLASH_SR0x4002 200C - 0x4002 200F4
FLASH_CR0x4002 2010 - 0x4002 20134
FLASH_AR0x4002 2014 - 0x4002 20174
Reserved0x4002 2018 - 0x4002 201B4
FLASH_OBR0x4002 201C - 0x4002 201F4
FLASH_WRPR0x4002 2020 - 0x4002 20234

Note: For further information on the flash memory interface registers, refer to PM0063.

Reading flash memory

Flash memory accesses are performed through the AHB bus. Accesses are either instruction fetches over the ICode bus, or data accesses (e.g. literal pool) over the D-code bus. Since these two buses have the same flash memory as target, the interface gives priority to D-code bus accesses over I-code bus, instruction fetch accesses.

Read accesses can be performed without any wait state and with the following configuration options:

  1. Note:
    1. 1 Half cycle configuration is not available in combination with a prescaler on the AHB. The system clock (SYSCLK) should be equal to the HCLK clock. This feature can therefore be used only with a low-frequency clock of 8 MHz or less. It can be generated from the HSI or the HSE but not from the PLL.
    2. 2 Using DMA: DMA accesses flash memory on the DCode bus and has priority over ICode instructions. The DMA provides one free cycle after each transfer. Some instructions can be performed together with DMA transfer.

Programming and erasing flash memory

The flash memory can be programmed 16 bits (half words) at a time. For write and erase operations on the flash memory (write/erase), the internal RC oscillator (HSI) must be ON.

The flash memory erase operation can be performed at page level or on the whole area (mass erase). Mass erase does not affect the information blocks.

To ensure that there is no overprogramming, the flash programming and erase controller blocks are clocked by a fixed clock.

The end of write operation (programming or erasing) can trigger an interrupt. This interrupt can be used to exit the WFI mode, only if the FLASH clock is enabled. Otherwise, the interrupt is served only after exiting WFI.

The FLASH_ACR register is used to enable/disable flash memory half-cycle access. The tables below provide the bit map and bit descriptions for this register.

For complete information on flash memory operations and register configurations, refer to PM00063).

Flash access control register (FLASH_ACR)

Address offset: 0x00
Reset value: 0x0000 0000

31302928272625242322212019181716
Reserved
1514131211109876543210
ReservedHLFCYA
rw
Reserved

Bits 31:4 Reserved, must be kept cleared.

Bit 3 HLFCYA : Flash half cycle access enable
0: Half cycle is disabled
1: Half cycle is enabled

Bits 2:0 Reserved, must be kept cleared.

2.4 Boot configuration

In the STM32F100xx, three different boot modes can be selected through the BOOT[1:0] pins as shown in Table 6 .

Table 6. Boot modes

Boot mode selection pinsBoot modeAliasing
BOOT1BOOT0
x0Main flash memoryMain flash memory is selected as the boot space
01System memorySystem memory is selected as the boot space
11Embedded SRAMEmbedded SRAM is selected as the boot space

The values on the BOOT pins are latched on the 4th rising edge of SYSCLK after a reset. It is up to the application to set the BOOT1 and BOOT0 pins after reset to select the required boot mode.

The BOOT pins are also resampled when exiting the Standby mode. Consequently, they must be kept in the required boot mode configuration in the 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 starting from 0x0000 0004.

Due to its fixed memory map, the code area starts from address 0x0000 0000 (accessed through the ICode/DCode buses) while the data area (SRAM) starts from address 0x2000 0000 (accessed through the system bus). The Cortex-M3 CPU always fetches the reset vector on the ICode bus, which implies to have the boot space available only in the code area (typically, flash memory). STM32F100xx microcontrollers implement a special mechanism to be able to boot also from SRAM and not only from main flash memory and System memory.

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

Note: When booting from SRAM, in the application initialization code, the vector table in SRAM must be relocated using the NVIC exception table and offset register.

Embedded boot loader

The embedded boot loader is used to reprogram the flash memory using the USART1 serial interface. This program is located in the system memory and is programmed by ST during production. For further details refer to AN2606.