2. Memory and bus architecture

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: System architecture:

The system consists of a Cortex®-M0+ “Radio protocol and application” processor with its radio sub-system.

There is a single flash memory to be used by the CPU for both Sub-1 GHz protocols and application management.

The peripherals are located on the different system buses (AHB, APB0, APB1, APB2 for the radio system). There are up to 2 SRAM banks, SRAM0, which is always power supplied and SRAM1 (only on STM32WL33xx) that can be programmed to be always on or switchable. For more information see Control register 2 (PWR_CR2).

Figure 1. System architecture

Figure 1. System architecture diagram showing the ARM Cortex-M0+ core, DMA, Radio system, and their connections to a 6x7 BusMatrix. The BusMatrix connects to various peripherals and memory blocks including Flash, SRAM, and APB peripherals.

The diagram illustrates the system architecture of the STM32WL33xx microcontroller. At the top, the ARM Cortex-M0+ core, DMA (7 channels), and Radio system (with a sequencer) are shown. The Cortex-M0+ and DMA connect to the BusMatrix via S0 and S1 buses, respectively. The Radio system connects via an AHB UP Converter to the S2, S3, S4, and S5 buses. The BusMatrix is a 6x7 matrix with rows S0-S5 and columns M0-M6. Connections are indicated by dots at the intersections. The M0 column connects to the Flash Controller and Flash. The M1 and M2 columns connect to SRAM0 and SRAM1(1). The M3 and M4 columns connect to APB0 and APB1 peripherals via AHB2APB converters. The M5 column connects to AHB0 peripherals. The M6 column connects to APB2 LPAWUR(1) via an AHB DOWN converter and an AHB2APB converter. A blue dot is located at the intersection of S5 and M6. The label 'BusMatrix 6x7' is at the bottom of the matrix.

1. STM32WL33xx only.

MSV58347V1

Figure 1. System architecture diagram showing the ARM Cortex-M0+ core, DMA, Radio system, and their connections to a 6x7 BusMatrix. The BusMatrix connects to various peripherals and memory blocks including Flash, SRAM, and APB peripherals.

2.1.1 S0: CPU (Cortex®-M0+) S-bus

This bus connects the system bus of the CPU core to the BusMatrix. 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 all the possible peripherals (the internal flash and SRAM memories, the AHB0, APB0, APB1 and APB2 peripherals).

2.1.2 S1: DMA-bus

This bus connects the AHB master interface of the DMA to the BusMatrix. The targets of this bus are the two SRAM0 and SRAM1 (only on STM32WL33xx) banks and the AHB0, APB0 and APB1 peripherals.

2.1.3 S2-S5: Sub-1 GHz radio system-bus

This bus connects the 4 AHB master interfaces of the Radio system to the BusMatrix through a dedicate 4x1 BusMatrix. The targets of this bus are the two SRAM0 and SRAM1 (only on STM32WL33xx) banks and, only for the Sequencer AHB master port of the MR_SUBG IP, the APB peripherals internal to the MR_SUBG IP.

2.1.4 Bus matrix

The bus matrix manages the access arbitration between masters. The arbitration uses a round-robin algorithm. The bus matrix is composed of three masters (CPU, DMA1-bus and radio-system bus) and seven slaves (FLASH, SRAM0, SRAM1 (STM32WL33xx only), APB0 and APB1, AHB0 and AHBRF).

Bus matrix 4x1

The bus matrix 4x1 manages the access arbitration between 4 AHB master ports of the sub-GHz radio system. The arbitration uses a round-robin algorithm. The BusMatrix 4x1 is composed of four masters (Radio system-bus) and one slave (the main BusMatrix).

AHB/APB bridges

The two bridges AHB to APB0 and AHB to APB1 provide full synchronous connections between the AHB and the two APB buses.

All the AHB and APB ports of the MR_SUBG radio controller work at fixed 16 MHz frequency clock. Two blocks are added on the AHB/APB path to manage potential prescaled MR_SUBGHz frequency versus the system frequency:

Refer to Section 2.2.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 SRAM and flash memory interface). Before using a peripheral the user has 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 and registers 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 words least significant byte and the highest numbered byte the most significant.

Figure 2. Memory map

Memory map diagram showing address ranges from 0x0000 0000 to 0xFFFF FFFF. It details sections for CODE, SRAM, Peripherals, and various reserved areas, with zoomed-in views for specific regions like APB0, APB1, APB2, and flash memory.

The diagram illustrates the memory map of the STM32 microcontroller. It is organized into two main vertical sections: a primary view on the left and detailed zoomed-in views on the right, connected by lines indicating the corresponding address ranges.

Primary Memory Map (Left):

Zoomed-in Memory Maps (Right):

Legend: A shaded gray box represents "Reserved" memory.

Footnote: 1. STM32WL33xx only

Reference: MSv58211V3

Memory map diagram showing address ranges from 0x0000 0000 to 0xFFFF FFFF. It details sections for CODE, SRAM, Peripherals, and various reserved areas, with zoomed-in views for specific regions like APB0, APB1, APB2, and flash memory.

All the memory areas that are not allocated to on-chip memories and peripherals are considered “Reserved”. For the detailed mapping of available memory and registers areas, refer to the chapter and peripheral chapters.

2.2.2 Memory map and register boundary addresses

The Table 3 gives the boundary addresses of the peripherals available in the device.

Table 3. Memory map and peripheral register boundary addresses

BusBoundary addressActual size (bytes)PeripheralPeripheral register map
Misc0xE00F FFFF - 0xFFFF FFFF255 MReserved-
0xE000 0000 - 0xE00F FFFF1 MPrivate peripheral busCortex-M0+ registers (interrupt controller, SysTick, and so on.)
APB20x4900 1000 - 0x4900 13FF1 KLPAWURSubGHz wakeup radio registers
0x4900 0000 - 0x4900 07FF2 KMR_SUBGMR_SUBG registers
AHB00x4890 0000 - 0x4890 03FF1 KAESSee Section 18.7: AES register map
0x4880 0000 - 0x4880 03FF1 KDMAMUXSee Section 11.6: DMAMUX register map
0x4870 0000 - 0x4870 00FF256DMA slaveSee Section 10.5: DMA register map
0x4860 0000 - 0x4860 0FFF4 KRNGSee Section 17.2: RNG registers map
0x4850 0000 - 0x4850 03FF1 KPWRSee section Section 5.7: PWR register map
0x4840 0000 - 0x4840 03FF1 KRCCSee section Section 6.7: RCC register map
0x4830 0400 - 0x4830 13FF4 KReserved-
0x4830 0000 - 0x4830 03FF1 KReserved-
0x4820 0000 - 0x4820 03FF1 KCRCSee Section 19.5: CRC register map
0x4810 0000 - 0x4810 03FF1 KGPIOBSee section Section 7.5: GPIO register map
0x4800 0000 - 0x4800 03FF1 KGPIOASee section Section 7.5: GPIO register map
0x4800 0000 - 0x4800 03FF1 KGPIOASee section Section 7.5: GPIO register map
APB10x4100 7000 - 0x4100 73FF1 KSPI3See Section 27.10: SPI/I2S register map
0x4100 6000 - 0x4100 63FF1 KADCSee Section 12.7: ADC register map
0x4100 5000 - 0x4100 53FF1 KLPUARTSee Section 26.5.11: LPUART register map
0x4100 4000 - 0x4100 43FF1 KUSARTSee Section 25.8: USART register map
0x4100 3000 - 0x4100 33FF1 KReserved-
0x4100 2000 - 0x4100 23FF1 KSPI1See Section 27.10: SPI/I2S register map
0x4100 1000 - 0x4100 13FF1 KI2C2See Section 24.7: I2C register map
0x4100 0000 - 0x4100 03FF1 KI2C1See Section 24.7: I2C register map

Table 3. Memory map and peripheral register boundary addresses

BusBoundary addressActual size (bytes)PeripheralPeripheral register map
APB00x4000 A000 - 0x4000 A3FF1 KLCSCSee Section 15.9: LCSC register map
0x4000 9000 - 0x4000 93FF1 KCOMPSee Section 13.7: COMP register map
0x4000 8000 - 0x4000 83FF1 KDBGMCUSee Section 30.4: DBG register map
0x4000 7000 - 0x4000 73FF1 KLCDCSee Section 16.7: LCD register map
0x4000 6000 - 0x4000 63FF1 KDACSee Section 14.6: DAC register map
0x4000 5000 - 0x4000 53FF1 KTIM16See Section 21.4: TIM16 registers
0x4000 4000 - 0x4000 43FF1 KRTCSee Section 22.7: RTC register map
0x4000 3000 - 0x4000 33FF1 KIWDGSee Section 23.5: IWDG register map
0x4000 2000 - 0x4000 23FF1 KTIM2See Section 20.5: TIM2 register map
0x4000 1000 - 0x4000 1FFF4 KFLASH_CTRLSee Section 9.6: Flash controller register map
0x4000 0000 - 0x4000 03FF1 KSYSTEM_CTRLSee Section 8.3: System controller register map
SRAM0x2000 8000 - 0x3FFF FFFF512 KReserved-
0x2000 4000 - 0x2000 7FFF16 KSRAM1 (only on STM32WL33xx)-
0x2000 0030 - 0x2000 3FFF16 340SRAM0Start of user RAM
0x2000 0000 - 0x2000 002F48Reserved. See Table 4: SRAM0 reserved locations
Flash0x1004 0000 - 0x1007 FFFFUp to 256 KMain flash-
DESIG0x1000 1EF0 - 0x1000 1EF7--Section 31: Device electronic signature (DESIG)
OTP0x1000 1800 - 0x1000 1BFF1 KOTP areaSection 31: Device electronic signature (DESIG) applies only to the DESIG
Boot(1)0x0000 0000 - 0x0003 FFFFUp to 256 KCPU Boot areaMirroring of flash or SRAM0

1. This area is a mirroring area. The CPU accesses are redirected to other memory map depending in REMAP bit located in the flash controller CONFIG register. See Table 5 for remapping detail.

  1. Note:
  2. 1 Comparator, DAC, I2C2, LCSC, LCD, LPAWUR are available only on STM32WL33xx devices.
  3. 2 ADC, temperature sensor, I2C1, SPI1, I2S are available only on STM32WL31xx/33xx devices.
Table 4. SRAM0 reserved locations
AddressActual size (bytes)IdentifierDescription
0x2000 00044Reserved1Reserved for future use.
0x2000 00084SavedMSPUsed by the LPM module to save context information pointer.
0x2000 000C4WakeupFromSleepFlagUsed by the LPMmodule. Indicates whether the system has been woken up from Deepstop mode.
0x2000 00104ResetReasonCopy of last reset reason from register RCC_CSR. The register is read, copied to this location by the bootloader code and finally cleared. As a consequence, software reading the register always reads 0. Users should read this location to know the last reset reason.
0x2000 00144AppBaseRelocation of application base. The Bootloader jumps to the location pointed to by this value when a wakeup from DeepStop occurs.
0x2000 00184bootloader_vrBootloader virtual register
0x2000 001C4bootloader_vr1Bootloader virtual register1
0x2000 002016Reserved2Reserved for future use.
Table 5. Address remapping depending on the REMAP bit
REMAPMemory mapped
0Main flash memory
1SRAM0

2.3 ARM® Cortex®-M0+

Table 6. Address remapping depending on REMAP bit

REMAPMemory mapped
0Main flash
1SRAM0

The ARM® Cortex®-M0+ processor was developed to provide a low-cost platform that meets the needs of MCU implementation, with a reduced pin count and low-power consumption, while delivering outstanding computational performance and an advanced response to interrupts.

The embedded Cortex-M0+ embeds:

2.3.1 CPU memory remap

Following CPU boot the application software can modify the memory map at address 0x0000 0000. This modification is performed by programming the REMAP bit in the flash controller (see Configuration register (CONFIG)).

The following memory can be remapped:

Embedded boot loader

ST provides a boot loader executed after each CPU reboot. This boot loader has its own documentation.

Note: STM32WL30xx/31xx/33xx devices latch the PA8 / PA9 / PA10 / PA11 / PB12 / PB13 / PB14 / PB15 pads value at POR. The information is available in PWR_SR2 register (see Status register 2 (PWR_SR2)). One of those eight I/Os can be used by the boot loader as boot indication between a normal boot or a boot on serial interface.

2.3.2 Interrupts

Interrupts are handled by the Cortex-M0+ Nested Vector Interrupt Controller (NVIC). The NVIC controls specific Cortex-M0+ interrupts (address 0x00 to 0x3C) as well as 32 user interrupts (address 0x40 to 0xBC). In STM32WL30xx/31xx/33xx devices, the user interrupts have been connected to the interrupt signals of the different peripherals (GPIO, flash controller, timer, UART,...). These interrupts can be controlled using the ISER, ICER, ISPR and ICPR registers (see the Cortex-M0+ Devices Generic User Guide).

Vector table

On reset, the Cortex-M0+ vector table is fixed at address 0x0000_0000. The software may relocate the vector table address to a different memory location, in a range 0x0000_0000 to 0xFFFF_FF80 in multiples of 256 bytes through the Vector Table Offset Register (VTOR) located in the Cortex-M0+ registers area (see Cortex-M0+ Devices Generic User Guide).

The STM32WL30xx/31xx/33xx interrupt-vector mapping is detailed in Table 7.

Table 7. Interrupt vectors(1)(2)(3)

PositionPriorityType of priorityAcronymDescriptionAddress offset
----Initial main SP0x0000_0000
--3FixedResetReset_Handler0x0000_0004
--2FixedNmiSRNMI_Handler0x0000_0008
--1FixedFaultISRHardFault_handler0x0000_000C
--ReservedReservedReserved0x0000_000C - 0x0000_0038
-6SettableSysTickSystem tick timer0x0000_003C
0Init 0SettableNVMNon-volatile memory (flash) controller0x0000_0040
1Init 0SettableRCCReset and clock controller0x0000_0044
2Init 0SettableBATTERYPVD / BORH0x0000_0048
3Init 0SettableI2C1I2C1 interrupt0x0000_004C
4Init 0SettableI2C2I2C2 interrupt0x0000_0050
5Init 0SettableSPI1SPI1 interrupt0x0000_0054
6Init 0ReservedReservedReserved0x0000_0058
7Init 0SettableSPI3SPI3 interrupt0x0000_005C
8Init 0SettableUSARTUSART interrupt0x0000_0060
9Init 0SettableLPUARTLPUART interrupt0x0000_0064
10Init 0SettableTIM2TIM2 interrupt0x0000_0068
11Init 0SettableRTCRTC interrupt0x0000_006C
12Init 0ReservedReservedReserved0x0000_0070
12Init 0SettableADCADC interrupt0x0000_0070
13Init 0SettableAESAES interrupt0x0000_0074
14Init 0ReservedReservedReserved0x0000_0078
Table 7. Interrupt vectors(1)(2)(3)
PositionPriorityType of priorityAcronymDescriptionAddress offset
15Init 0SettableGPIOAGPIOA interrupt0x0000_007C
16Init 0SettableGPIOBGPIOB interrupt0x0000_0080
17Init 0SettableDMADMA interrupt0x0000_0084
18Init 0SettableLPAWURLPAWUR interrupt0x0000_0088
19Init 0SettableCOMPComp interrupt through SYSCFG0x0000_008C
20Init 0SettableMRSUBG_BUSYMRSUBG Busy interrupt0x0000_0090
21Init 0SettableMRSUBGMRSUBG interrupt0x0000_0094
22Init 0SettableMRSUBG_TX_RX_SEQUENCEMRSUBG TX/RX sequence interrupt0x0000_0098
23Init 0SettableMRSUBG_TIMER_CPU_WKUPMRSUBG TIMER CPU Wakeup interrupt0x0000_009C
24Init 0SettableMRSUBG_WKUPMRSUBG Wakeup interrupt0x0000_00A0
25Init 0SettableDACDAC interrupt0x0000_00A4
26Init 0SettableTIM16TIM16 interrupt0x0000_00A8
27Init 0SettableLCDLCD interrupt0x0000_00AC
28Init 0SettableLCSCLCSC interrupt0x0000_00B0
29Init 0SettableLCSCLCSC LC_ACTIVITY interrupt0x0000_00B4
30- 31Init 0ReservedReservedReserved0x0000_00B8- 0x0000_00BC
  1. 1. Priority level is set to 0 after reset, each interrupt can be programmed with 4 higher priorities.
  2. 2. Comparator, DAC, I2C2, LCSC, LCD, LPAWUR are available only in STM32WL33xx device.
  3. 3. ADC, temperature sensor, I2C1, SPI1, I2S are available only in STM32WL31xx/33xx devices.

Interrupt activation sequence

Safely activating a peripheral interrupt requires the following steps:

Note: Most peripherals require clearing interrupt requests on the peripheral side when handling interrupt service requests to prevent triggering continuous interrupts for the same event.

For more details on the Cortex-M0+ exception model, see ARMv6-M Architecture Reference Manual, §B1.5.

For more details on the Cortex-M0+ NVIC behavior and registers, see the ARMv6-M Architecture Reference Manual, §B3.4.