2. Memory and bus architecture

The following definitions are used in this section:

When ESE = 0, CPU2 is non-secure. When ESE = 1, CPU2 is secure.

2.1 System architecture

The main system consists of a 32-bit multilayer AHB bus matrix that interconnects the following masters and slaves:

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

Figure 1. System architecture diagram showing a bus matrix connecting CPU1, CPU2, DMA1, and DMA2 to various memory and peripheral components.

The diagram illustrates the system architecture based on a bus matrix. At the top, four components are shown: CPU1 (Arm Cortex-M4), CPU2 (Arm Cortex-M0+), DMA1, and DMA2. These are connected to a central 'Bus matrix' through source ports S0, S1, S2, S3, S4, and S5. The bus matrix has eight target ports labeled M0 through M7. The connections are as follows:

The target ports are connected to the following components:

A legend indicates that a grey circle represents a connection 'when remapped'. The diagram is labeled MSv60752V1.

Figure 1. System architecture diagram showing a bus matrix connecting CPU1, CPU2, DMA1, and DMA2 to various memory and peripheral components.

2.1.1 S0: CPU1 I-bus

This bus connects the instruction bus of the CPU1 core to the bus matrix. This bus is used by the core to fetch instructions. The targets of this bus are the internal flash memory, SRAM1 and SRAM2.

2.1.2 S1: CPU1 D-bus

This bus connects the data bus of the CPU1 core to the bus matrix. This bus is used by the core for literal load and debug access. The targets of this bus are the internal flash memory, SRAM1 and SRAM2.

2.1.3 S2: CPU1 S-bus

This bus connects the system bus of the CPU1 core to the bus matrix. This bus is used by the core to access data located in a peripheral or SRAM area. The targets of this bus are the SRAM1, SRAM2, the AHB1 peripherals including the APB1 and APB2 peripherals, the AHB2 peripherals and the AHB3 peripherals including the APB3.

2.1.4 S3: CPU2 S-bus

This bus connects the system bus of the CPU2 core to the bus matrix. This bus is used by the core to fetch instructions, for literal load and debug access, and access data located in a peripheral or SRAM area. The targets of this bus are the internal flash memory, SRAM1,

SRAM2, the AHB1 peripherals including the APB1 and APB2 peripherals, the AHB2 peripherals and the AHB3 peripherals including the APB3 peripherals.

2.1.5 S4, S5: DMA-bus

These buses connect the AHB master interface of the DMAs to the bus matrix. The targets of this bus are the internal flash memory, SRAM1, SRAM2 the AHB1 peripherals including the APB1 and APB2 peripherals, the AHB2 peripherals and the AHB3 peripherals including the APB3 peripherals.

AHB/APB bridges

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

The bridge AHB to APB3 provides full synchronous connections between the AHB and the APB bus, allowing flexible selection of the frequency between the AHB and peripherals.

Refer to Section 2.6.2: Memory map and register boundary addresses 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 the flash memory interface. Before using a peripheral, its clock must be enabled in the RCC_AHBxENR and 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 Boot configuration

Three different CPU1 boot modes and one CPU2 boot mode can be selected through the BOOT0 pin and nBOOT1 bit in the user options.

Boot is furthermore conditioned by the CPU1 boot lock enable, CPU2 boot lock enable and the user flash memory empty check, as shown in the table below.

Table 1. Device boot mode

Boot mode selectionValid optionsUser flash emptyCPU1 aliasing spaceCPU2 boot
nBOOT1 optionnBOOT0 optionPH3/BOOT0nSWBOOT0 optionBOOT_LOCKC2BOOT_LOCK
xx0XxxNoxHoldSFI/RSS boot (1)(2)(3)
1SRAM1 bootHold

Table 1. Device boot mode (continued)

Boot mode selectionValid optionsUser flash emptyCPU1 aliasing spaceCPU2 boot
nBOOT1 optionnBOOT0 optionPH3/BOOT0nSWBOOT0 optionBOOT_LOCKC2BOOT_LOCK
1x010xYes0User flash bootSBRV boot
1System flash bootSBRV boot
0000xHoldSFI/RSS boot (1)(2)(3)
101HoldSBRV boot (2)
010System flash bootSBRV boot
xx1xSRAM1 bootSBRV boot
User flash bootSBRV boot
11x00xYes0User flash bootSBRV boot
1System flash bootSBRV boot
0100xHoldSFI/RSS boot (1)(2)(3)
101HoldSBRV boot (2)
000System flash bootSBRV boot
xx1xSRAM1 bootSBRV boot
User flash bootSBRV boot
  1. 1. When engi bytes are invalid or PKA or AES is not available in the product, the SFI/RSS boot firmware installation is not available.
  2. 2. Since CPU1 is kept in hold at reset boot, the system is not able to enter low-power modes (Stop, Standby or Shutdown).
  3. 3. Warning: If one of the user options FSD, BRSD, or NBRSD are set to "Security enable" or when RDP is not set to Level 0, the device must not be boot in SFI/RSS mode.

Values on BOOT0 and BOOT1 are latched after a reset. It is up to the user to provide the correct value for the required boot mode.

BOOT0 and BOOT1 are also re-sampled when exiting Standby mode. Consequently they must be kept in the required boot mode. After the startup delay, the CPU1 fetches the top-of-stack 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 flash memory and SRAM1 are accessible as follows:

The main flash memory is aliased in the CPU1 boot memory space at address 0x0000 0000 and is also still accessible from its physical address 0x0800 0000. In other words,

the flash memory contents can be accessed starting from address 0x0000 0000 or 0x0800 0000.

The system flash memory is aliased in the CPU1 or CPU2 boot memory space at address 0x0000 0000 and is also still accessible from its physical address 0x1FFF 0000.

The SRAM memory is aliased in the CPU1 boot memory space at address 0x0000 0000 and is also still accessible from its physical address 0x2000 0000.

CPU1 SRAM physical remap

Following CPU1 boot, the application software can modify the memory map at address 0x0000 0000. This modification is performed by programming the SYSCFG memory remap register (SYSCFG_MEMRMP) in the SYSCFG controller.

The following memories can be remapped:

Embedded bootloader

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

The embedded bootloader runs on the CPU1 and can be used to load content in non-secure memory areas.

Embedded secure firmware install and root security services

The embedded secure firmware install and root security services (SFI/RSS) are located in the system flash memory, programmed by STMicroelectronics during production. They allow programming of the flash memory with the same device interfaces than the ones used by the embedded bootloader. The embedded SFI/RSS run on the CPU2 and can be used to load content in secure and non-secure memory areas.

2.3 CPU2 boot

Following a device reset when CPU1 boots, CPU2 only boots after CPU1 has set the C2BOOT bit in the power control register 4 (PWR_CR4). The C2BOOT value is retained in Standby modes and CPU2 boots accordingly when exit from Standby.

CPU2 boots from its boot reset vector as defined by the flash memory user option C2OPT and SBRV. CPU2 may boot from anywhere in user flash memory, SRAM1 or SRAM2.

CPU2 system flash boot

CPU2 system flash memory SFI/RSS boot can be selected via BOOT0 and BOOT1.

If, after a reset, the user options are not valid and BOOT0/BOOT1 select CPU1 to boot from the main flash memory, CPU2 boots instead from the system flash memory SFI/RSS.

Note: When Engi bytes are not valid, or PKA or AES is not available in the product, the SFI/RSS boot firmware install is not available.

2.4 SRAM erase

SRAM1, SRAM2 and PKA SRAM provide an SRAM erase feature.

These SRAMs are erased under the conditions detailed in the table below.

Table 2. SRAM erase conditions

ConditionSRAM1 (1)SRAM2 (1)PKA SRAM (2)
System reset (3) (user option SRAM_RST = 1)RetainedRetainedHardware erased
System reset (user option SRAM_RST = 0)Hardware erasedHardware erasedHardware erased
OBL with invalid user optionsHardware erasedHardware erasedHardware erased
RDP regression from 1 to 0, on OPTSTRT.Hardware erased (4)Hardware erasedHardware erased
Tamper (5)RetainedHardware erasedHardware erased
SYSCFG_SCSR SRAM2ERRetainedHardware erasedRetained
  1. 1. An ongoing SRAM1 or SRAM2 erase can be monitored by SYSCFG_SCSR.SRAMBSY flag.
  2. 2. An ongoing PKA SRAM erase can be monitored by SYSCFG_SCSR.PKASRAMBSY flag.
  3. 3. POR, NRST, and wake-up from Standby.
  4. 4. For more details, see Table 19: RDP regression from level 1 to level 0 and memory erase .
  5. 5. To be able to debug without SRAM erase on tamper, especially ITAM6 debug access, the tamper erase must be disabled in the TAMP by firmware.

2.5 Memory protection

System memory protection (security, privilege, and hide protection) is only available when the system is secure (ESE = 1).

Flash memory, SRAM1 and SRAM2 can be protected by security and privilege at system level in addition to any privilege protection in the CPUs MPU. Security is defined in flash memory user options and privilege is defined in GTZC_TZSC registers.

The security and privilege definition protects the memory areas from being accessed by any non authorized bus master.

The memory protection allows the following areas to be defined within a memory:

Or

For more information see Section 3.1: GTZC introduction .

Further more a hide protection area can be defined in the flash memory by the hide protection area address offset defined in HDPSA user option.

When enabled, the flash memory area starting from the HDPSA address offset up to the end of the flash memory is hide protected. This means that the area is accessible from device reset or wake up from Standby mode, and can be protected from any access by disabling the hide protection area with the HDPADIS bit in flash memory access control register 2 (FLASF_ACR2).

Memory protection is controlled by the parameters as listed below:

When enabled, the memory area starting from the security address offset up to the end of the memory is secure.

When enabled, the unprivileged area starts from the memory base address up to the watermark address offset, and the area above the watermark up to the end of the memory is privileged.

A memory protection example with all different areas is given in Figure 2: Memory protection example . In this example the secure privileged hide protection area is only accessible read, write, execute by the secure privileged bus masters when hide protection area access is enabled in HDPADIS bit.

The secure privileged areas is only accessible read, write, execute by the secure privileged bus masters.

The secure privileged write area is only accessible write by the secure privileged bus masters, and read and execute by the privileged and unprivileged bus masters.

The secure unprivileged areas are accessible read, write, execute by the secure privileged and unprivileged bus masters.

The non-secure unprivileged areas are accessible read write by the secure and non-secure privileged and unprivileged bus masters, and are only accessible execute by the non-secure privileged and unprivileged bus masters.

The secure bus masters are CPU2 and a secure DMA channel.

The non-secure bus masters are CPU1 and non-secure DMA channels.

Figure 2. Memory protection example

Diagram illustrating memory protection zones for Flash, SRAM1, and SRAM2. Each memory block is divided into sections with specific access permissions (Secure privileged, Secure unprivileged, Non-secure unprivileged) controlled by configuration registers and base addresses. Vertical arrows on the right of each block indicate the hierarchy of access permissions.

The diagram shows three memory regions: Flash, SRAM1, and SRAM2, each with different protection zones.

MSV60756V2

Diagram illustrating memory protection zones for Flash, SRAM1, and SRAM2. Each memory block is divided into sections with specific access permissions (Secure privileged, Secure unprivileged, Non-secure unprivileged) controlled by configuration registers and base addresses. Vertical arrows on the right of each block indicate the hierarchy of access permissions.

This example show only a secure and privileged protected memory map. The security and unprivileged parameters can freely be programmed in any order as detailed below:

Memory access protection overview

The secure area of the memories have exclusively read, write, execute access only from the secure CPU2 and secure DMA channels. CPU1 and non-secure DMA channels have no execute, read, nor write access to these areas.

The non-secure area of the memories grants full read, write, execute access to CPU1 and all DMA channels. CPU2 has only read and write access to the non-secure areas. CPU2 is prevented from executing from non-secure areas.

Access rules from the different bus masters and secure, non-secure, privileged and unprivileged access types to the different memory areas is given in the table below.

Table 3. Memory security and privilege access

SoC level memory areaCPU2 hide protection privilegedCPU2 privilegedCPU2 unprivilegedCPU1 privilegedCPU1 unprivilegedDMA ch sub-lv secure privDMA ch sub-lv secureDMA ch sub-lv non-secureDMA ch sub-lv Non-secure
Flash memoryHide protection secure privilegedno access (1)no access (2)(rd, wr) (1)no access (2)
Secure privilegedex, rd, wrno access (2)no access (2)
Secure privileged Unprivileged executionex, rd, wrex, rd (3)rdno access (2)
Secure unprivilegedex, rd, wrrd, wrrd, wr
Non-secure privilegedrd, wrrd, wrno access (2)(4)ex, rd, wrno access (2)(4)rd, wr
Non-secure unprivilegedrd, wrex, rd, wrrd, wrrd, wr

Table 3. Memory security and privilege access (continued)

SoC level memory areaCPU2 hide protection privilegedCPU2 privilegedCPU2 unprivilegedCPU1 privilegedCPU1 unprivilegedDMA ch sub-lv secure privDMA ch sub-lv secureDMA ch sub-lv non-secureDMA ch sub-lv Non-secure
SRAM2Secure privilegedex (5) ,
rd, wr
ex (5) ,
rd, wr
no access
(2)
no access
(6)
no access
(6)
rd, wrno access
(2)(6)
no access
(2)(6)
no access
(2)(6)
Secure unprivilegedex (5) ,
rd, wr
rd, wr
Non-secure privilegedrd, wrrd, wrno access
(2)(4)
ex (5) ,
rd, wr
ex (5) ,
rd, wr
no access
(2)(4)
rd, wrrd, wr
Non-secure unprivilegedrd, wrrd, wr
SRAM1Secure privilegedex (5) ,
rd, wr
ex (5) ,
rd, wr
no access
(2)
no access
(6)
no access
(6)
rd, wrno access
(2)
no access
(2)
no access
(2)
Secure unprivilegedex (5) ,
rd, wr
rd, wr
Non-secure privilegedrd, wrrd, wrno access
(2)(4)
ex (5) ,
rd, wr
ex (5) ,
rd, wr
no access
(2)(4)
rd, wrrd, wr
Non-secure unprivilegedrd, wrrd, wr
  1. 1. Access to the hide protection secure privileged area is disabled by flash memory hide protection secure privileged HDPADIS bit.
  2. 2. Read access returns a zero value, write access is ignored and, in both cases, an illegal access event is generated.
  3. 3. The secure privileged and unprivileged, read and execute protected pages cannot be written by a secure unprivileged access. However it can be erased by a secure unprivileged page erase.
  4. 4. Privileged area start address < secure area start address.
  5. 5. Execution from SRAM1 and SRAM2 can be disabled by the execute never feature available from the MPU in the respective CPU.
  6. 6. Read access returns a zero value, write access is ignored and, in both cases, an illegal access event is generated. When RDP level is 1 and CPU1 boots from SRAM1, SRAM2 is locked and no illegal access event is generated.

2.6 Memory organization

2.6.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.6.2 Memory map and register boundary addresses

Figure 3. Memory map

Memory map diagram showing CPU1 and CPU2 internal peripherals, Peripherals, SRAM, and CODE memory regions with their corresponding address ranges and system components.

The memory map illustrates the distribution of memory between CPU1 and CPU2 internal peripherals, various system components, and user-defined CODE and SRAM regions. The diagram is divided into two main columns of addresses. The left column shows the physical memory layout from 0x0000 0000 to 0xFFFF FFFF, with regions for CODE, SRAM, Peripherals, CPU1 internal peripherals, and CPU2 internal peripherals. The right column shows the system component memory map from 0x0000 0000 to 0x5801 FFFF, including Reserved areas, Flash, SRAM2, System Flash, OTP area, Option Bytes, APB1, APB2, AHB1, AHB2, AHB3, and APB3. Lines connect the CODE and SRAM regions to their respective system addresses.

Address RangeComponent / Region
0x0000 0000 – 0x0003 FFFFCPU1 Flash, system memory or SRAM1, depending on BOOT configuration / CPU2 Flash, system memory, SRAM1 or SRAM2, depending on BOOT and SBRV configuration
0x0003 FFFF – 0x0004 0000Reserved
0x0004 0000 – 0x0800 0000Flash 1)
0x0800 0000 – 0x0803 FFFFReserved
0x0803 FFFF – 0x1000 0000SRAM2 1)3)
0x1000 0000 – 0x1000 7FFFReserved
0x1000 7FFF – 0x1FFF 7000System Flash
0x1FFF 7000 – 0x1FFF 7400OTP area
0x1FFF 7400 – 0x1FFF 7800Reserved
0x1FFF 7800 – 0x2000 0000Option Bytes
0x2000 0000 – 0x2000 8000SRAM1 1)
0x2000 8000 – 0x2000 FFFFSRAM2 1)
0x2000 FFFF – 0x4000 0000Reserved
0x4000 0000 – 0x4001 0000APB1
0x4001 0000 – 0x4800 0000APB2
0x4800 0000 – 0x4802 0000AHB1 2)
0x4802 0000 – 0x5800 0000AHB2
0x5800 0000 – 0x5801 0000AHB3 2)
0x5801 0000 – 0x5801 FFFFAPB3 2)

Legend:

Notes:

  1. Part or all of the memory can be made secure via User Option, granting only exclusive access to the CPU2.
  2. Some peripherals can be made secure, granting only exclusive access to the CPU2.
  3. SRAM2 at these address is only accessible by the CPU1.

MSv60754V1

Memory map diagram showing CPU1 and CPU2 internal peripherals, Peripherals, SRAM, and CODE memory regions with their corresponding address ranges and system components.

Any memory area not allocated to on-chip memories and peripherals is considered “Reserved”.

The table below details the boundary addresses of peripherals available in the device.

Table 4. Memory map and peripheral register boundary addresses

BusBoundary addressSize (bytes)PeripheralPeripheral register map
APB30x5801 0400 - 0x5801 FFFF-Reserved-
0x5801 0000 - 0x5801 03FF1 KSUBGHZSPISection 37.9.10: SPI/I2S register map
AHB30x5800 40C0 - 0x5800 FFFF-Reserved-
0x5800 4800 - 0x5800 4BFF1 KGTZC_TZICSection 3.6.4: GTZC TZIC register map
0x5800 4400 - 0x5800 47FF1 KGTZC_TZSCSection 3.5.8: GTZC TZSC register map
0x5800 4000 - 0x5800 43FF1 KFLASHSection 4.10.21: FLASH register map
0x5800 3400 - 0x5800 3FFF8 KPKA continueSection 24.7.5: PKA register map
0x5800 2400 - 0x5800 33FFPKA RAM
0x5800 2000 - 0x5800 23FFPKA
0x5800 1C00 - 0x5800 1FFF-Reserved-
0x5800 1800 - 0x5800 1BFF1 KAESSection 23.7.18: AES register map
0x5800 1400 - 0x5800 17FF1 KHSEMSection 8.4.9: HSEM register map
0x5800 1000 - 0x5800 13FF1 KTrue RNGSection 22.7.5: RNG register map
0x5800 0C00 - 0x5800 0FFF1 KIPCCSection 9.4.9: IPCC register map
0x5800 0800 - 0x5800 0BFF1 KEXTISection 16.6.13: EXTI register map
0x5800 0400 - 0x5800 07FF1 KPWRSection 6.6.23: PWR register map
0x5800 0000 - 0x5800 03FF1 KRCCSection 7.4.47: RCC register map
AHB20x4800 2000 - 0x57FF FFFF-Reserved-
0x4800 1C00 - 0x4800 1FFF8 KGPIOSection 10.4.36: GPIOH register map
0x4800 0C00 - 0x4800 1BFFReserved
0x4800 0800 - 0x4800 0BFFSection 10.4.35: GPIOC register map
0x4800 0400 - 0x4800 07FFSection 10.4.34: GPIOB register map
0x4800 0000 - 0x4800 03FFSection 10.4.33: GPIOA register map

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

BusBoundary addressSize (bytes)PeripheralPeripheral register map
AHB10x4260 0000 - 0x47FF FFFF-Reserved-
0x4240 0000 - 0x425F FFFF2048 KAHB1 bit banding (CPU1 only)-
0x4220 0000 - 0x423F FFFF2048 KAPB2 bit banding (CPU1 only)-
0x4200 0000 - 0x421F FFFF2048 KAPB1 bit banding (CPU1 only)-
0x4002 3400 - 0x41FF FFFF-Reserved-
0x4002 3000 - 0x4002 33FF1 KCRCSection 17.4.6: CRC register map
0x4002 0C00 - 0x4002 2FFF-Reserved-
0x4002 0800 - 0x4002 0BFF1 KDMAMUX1Section 14.6.7: DMAMUX register map
0x4002 0400 - 0x4002 07FF1 KDMA2Section 13.6.7: DMA register map
0x4002 0000 - 0x4002 03FF1 KDMA1Section 13.6.7: DMA register map
APB20x4001 4C00 - 0x4001 FFFF-Reserved-
0x4001 4800 - 0x4001 4BFF1 KTIM17Section 27.4.23: TIM16/TIM17 register map
0x4001 4400 - 0x4001 47FF1 KTIM16Section 27.4.23: TIM16/TIM17 register map
0x4001 3C00 - 0x4001 43FF-Reserved-
0x4001 3800 - 0x4001 3BFF1 KUSART1Section 35.8.15: USART register map
0x4001 3400 - 0x4001 37FF-Reserved-
0x4001 3000 - 0x4001 33FF1 KSPI1Section 37.9.10: SPI/I2S register map
0x4001 2C00 - 0x4001 2FFF1 KTIM1Section 25.4.30: TIM1 register map
0x4001 2800 - 0x4001 2BFF-Reserved-
0x4001 2400 - 0x4001 27FF1 KADCSection 18.13: ADC register map
0x4001 0400 - 0x4001 23FF-Reserved-
0x4001 0200 - 0x4001 03FF1 KCOMPSection 21.6.3: COMP register map
0x4001 0100 - 0x4001 01FFSYSCFG continueSection 11.2.16: SYSCFG register map
0x4001 0030 - 0x4001 00FFVREFBUFSection 20.3.3: VREFBUF register map
0x4001 0000 - 0x4001 002FSYSCFGSection 11.2.16: SYSCFG register map

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

BusBoundary addressSize (bytes)PeripheralPeripheral register map
APB10x4000 B400 - 0x4000 FFFF-Reserved-
0x4000 B000 - 0x4000 B3FF1 KTAMPSection 33.6.11: TAMP register map
0x4000 9C00 - 0x4000 AFFF-Reserved-
0x4000 9800 - 0x4000 9BFF1 KLPTIM3Section 28.7.13: LPTIM register map
0x4000 9400 - 0x4000 97FF1 KLPTIM2Section 28.7.13: LPTIM register map
0x4000 8400 - 0x4000 93FF-Reserved-
0x4000 8000 - 0x4000 83FF1 KLPUART1Section 36.7.13: LPUART register map
0x4000 7C00 - 0x4000 7FFF1 KLPTIM1Section 28.7.13: LPTIM register map
0x4000 7800 - 0x4000 7BFF-Reserved-
0x4000 7400 - 0x4000 77FF1KDACSection 19.7.13: DAC register map
0x4000 6000 - 0x4000 73FF-Reserved-
0x4000 5C00 - 0x4000 5FFF1 KI2C3Section 34.9.12: I2C register map
0x4000 5800 - 0x4000 5BFF1 KI2C2Section 34.9.12: I2C register map
0x4000 5400 - 0x4000 57FF1 KI2C1Section 34.9.12: I2C register map
0x4000 4800 - 0x4000 53FF-Reserved-
0x4000 4400 - 0x4000 47FF1 KUSART2Section 35.8.15: USART register map
0x4000 3C00 - 0x4000 43FF-Reserved-
0x4000 3800 - 0x4000 3BFF1 KSPI2S2Section 37.9.10: SPI/I2S register map
0x4000 3400 - 0x4000 37FF-Reserved-
0x4000 3000 - 0x4000 33FF1 KIWDGSection 30.4.6: IWDG register map
0x4000 2C00 - 0x4000 2FFF1 KWWDGSection 31.5.4: WWDG register map
0x4000 2800 - 0x4000 2BFF1 KRTCSection 32.6.23: RTC register map
0x4000 0400 - 0x4000 27FF-Reserved-
0x4000 0000 - 0x4000 03FF1 KTIM2Section 26.4.25: TIMx register map
-0x2220 0000 - 0x3FFF FFFF-Reserved-
AHB30x2210 0000 - 0x221F FFFF1024 KSRAM2 bit banding (CPU1 only)-
0x2200 0000 - 0x220F FFFF1024 KSRAM1 bit banding (CPU1 only)-
-0x2001 0000 - 0x21FF FFFF-Reserved-
AHB30x2000 8000 - 0x2000 FFFF32 KSRAM2-
0x2000 0000 - 0x2000 7FFF32 KSRAM1-
-0x1FFF 8080 - 0x1FFF FFFF-Reserved-
Table 4. Memory map and peripheral register boundary addresses (continued)
BusBoundary addressSize (bytes)PeripheralPeripheral register map
AHB30x1FFF 7800 - 0x1FFF 7FFF2 KFlash user optionsSection 4.10.21: FLASH register map
0x1FFF 7400 - 0x1FFF 77FF1 KFlash Engi-
0x1FFF 7000 - 0x1FFF 73FF1 KFlash OTP-
0x1FFF 0000 - 0x1FFF 6FFF28 KFlash RSS and bootloader-
-0x1000 8000 - 0x1FFE FFFF-Reserved-
AHB30x1000 0000 - 0x1000 7FFF32 KSRAM2 (CPU1 only)-
-0x0804 0000 - 0x0FFF FFFF-Reserved-
AHB30x0800 0000 - 0x0803 FFFF256 KUser flash (1)-
-0x0004 0000 - 0x07FF FFFF-Reserved-
BOOT (2)0x0000 0000 - 0x0003 FFFF256 KCPU1n boot area-

1. This address corresponds to the maximum flash memory. For products with smaller flash memory size (128 and 64 Kbytes), the end address is lower.

2. Bus depends on the selected CPU1n boot area.

2.6.3 CPU1 bit banding

The CPU1 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.

The AHB1, APB1, APB2 peripheral registers and the SRAM1 and SRAM2 are mapped to a bit-band region, so that single bit-band write and read operations are allowed. The operations are only available for CPU1 accesses and not from other bus masters (such as DMA).

The peripheral bit-band alias is located from address 0x4200 0000 to 0x425F FFFF.

The SRAM bit-band alias is located from address 0x2200 0000 to 0x221F FFFF.

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 the following:

\[ \text{bit\_word\_addr} = \text{bit\_band\_base} + (\text{byte\_offset} * 32) + (\text{bit\_number} * 4) \]

where:

Example

The following example shows how to map bit [2] of the byte located at SRAM1 address 0x2000 0300 to the alias region. The formula is then:

\[ 0x2200\ 6008 = 0x2200\ 0000 + 0x0300 * 32 + 2 * 4 \]

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

Reading address 0x2200 6008 returns the value 0x01 or 0x00 of bit [2] of the byte at SRAM1 address 0x2000 0300.

For more information on bit-band, refer to the Cortex-M4 programming manual.