Memory Organization

Introduction

The chip integrates several distinct address regions: ROM stores factory-programmed boot code and is read-only, SRAM serves as the primary working memory for program execution, Flash provides non-volatile storage for firmware and persistent data, and DRAM (PSRAM/DDR) supports large-capacity extended memory for demanding applications. In addition, the chip maps various peripherals onto the bus system through memory mapping, allowing peripheral access via the peripheral register region. All these resources are mapped within a unified 4GB linear address space, with data encoded in Little-Endian format.

The addressable space is divided into multiple main blocks, as shown in the following table and figure. All the areas that are not allocated to on-chip memories and peripherals are considered as RSVD (reserved).

Memory Layout

The following table lists the memory address allocation for each chip.

RTL8721Dx:

Base Address

End Address

Size (bytes)

Description

Type

TrustZone

0x0000_0000

0x0007_FFFF

512K

KM4 Internal ROM

ROM

-

0x0000_0000

0x0007_FFFF

512K

KM0 Internal ROM

ROM

-

0x0008_0000

0x000F_FFFF

512K

RSVD

-

-

0x0010_0000

0x07FF_FFFF

127M

RSVD

-

-

0x0800_0000

0x0FFF_FFFF

128M

SPI Flash

Flash

-

0x1000_0000

0x1FFF_FFFF

256M

RSVD

-

-

0x2000_0000

0x2007_FFFF

512K

SRAM

SRAM

-

0x2008_0000

0x200F_FFFF

512K

Shared SRAM

SRAM

-

0x2010_0000

0x2FFF_FFFF

255M

RSVD

-

-

0x3000_0000

0x3FFF_FFFF

256M

TrustZone secure address (SRAM)

-

Secure

0x4000_0000

0x40FF_FFFF

16M

High-Speed peripherals group

Peripherals

-

0x4100_0000

0x41FF_FFFF

16M

Low-Speed peripherals group

Peripherals

-

0x4200_0000

0x4FFF_FFFF

224M

RSVD

-

-

0x5000_0000

0x5FFF_FFFF

256M

TrustZone secure address (Peripherals)

-

Secure

0x6000_0000

0x6FFF_FFFF

256M

PSRAM

DRAM

-

0x7000_0000

0x7FFF_FFFF

256M

TrustZone secure address (PSRAM)

-

Secure

0x8000_0000

0xFFFF_FFFF

2048M

RSVD

-

-

Note

  • This is the division of address space, not representing actual physical occupation.

  • The TrustZone feature is only applicable to KM4, so the secure address spaces can only be accessed from the secure world of KM4 and other security-capable masters.

  • The security attribute of an address space is determined by bit[28] of that address.

  • Except for the specified processor-only address spaces, all other address spaces can be directly accessed by both KM0 and KM4.

The following figures show the corresponding memory address space diagrams:

RTL8721Dx:
../../_images/memory_map_rtl8721dx.svg

Memory Map

The following table lists the memory map and boundary addresses of registers available in the chip.

RTL8721Dx:

Port ID

Port Name

Security

Base Address

End Address

Size (bytes)

S0

SPIC_AUTO_MODE

Non-secure

0x0800_0000

0x0FFF_FFFF

128M

S1

HS SRAM0

MPC

0x2000_0000

0x2007_FFFF

512K

S2

HS_SHARE_SRAM

MPC

0x2008_0000

0x200F_FFFF

512K

S3

WIFI_REG

PPC

0x4000_0000

0x4007_FFFF

512K

S3

BT_REG

PPC

0x4008_0000

0x400F_FFFF

512K

S3

AES_REG

PPC

0x4010_0000

0x4010_7FFF

32K

S3

SHA_REG

PPC

0x4010_8000

0x4010_FFFF

32K

S3

GDMA0_REG

PPC

0x4011_0000

0x4011_7FFF

32K

S3

PPE_REG

PPC

0x4011_8000

0x4011_FFFF

32K

S3

SDIO_REG

PPC

0x4012_0000

0x4012_3FFF

16K

S3

SPI0_REG

PPC

0x4012_4000

0x4012_4FFF

4K

S3

SPI1_REG

PPC

0x4012_5000

0x4012_5FFF

4K

S3

PSRAM_PHY_REG

PPC

0x4012_6000

0x4012_6FFF

4K

S3

PSRAM_REG

PPC

0x4012_7000

0x4012_7FFF

4K

S3

SPI_FLASH_CTRL

PPC

0x4012_8000

0x4012_8FFF

4K

S3

QSPI_REG

PPC

0x4012_9000

0x4012_9FFF

4K

S3

SPORT0_REG

PPC

0x4012_A000

0x4012_AFFF

4K

S3

SPORT1_REG

PPC

0x4012_B000

0x4012_BFFF

4K

S3

USB_REG

PPC

0x4012_C000

0x4017_FFFF

336K

S4

OTPC_REG

PPC

0x4100_0000

0x4100_7FFF

32K

S4

SYSTEM_CTRL

PPC

0x4100_8000

0x4100_BFFF

16K

S4

PINMUX_REG

PPC

0x4100_8800

0x4100_89FF

512

S4

RTC_REG

PPC

0x4100_8A00

0x4100_8BFF

512

S4

IWDG_REG

PPC

0x4100_8C00

0x4100_8CFF

256

S4

WDG0_REG

PPC

0x4100_8D00

0x4100_8D3F

64

S4

WDG1_REG

PPC

0x4100_8D40

0x4100_8D7F

64

S4

WDG2_REG

PPC

0x4100_8D80

0x4100_8DBF

64

S4

RETENTION_RAM

PPC

0x4100_8E00

0x4100_8FFF

512

S4

UART0_REG

PPC

0x4100_C000

0x4100_CFFF

4K

S4

UART1_REG

PPC

0x4100_D000

0x4100_DFFF

4K

S4

UART2_REG

PPC

0x4100_E000

0x4100_EFFF

4K

S4

LOGUART_REG

PPC

0x4100_F000

0x4100_FFFF

4K

S4

GPIO_REG

PPC

0x4101_0000

0x4101_0FFF

4K

S4

ADC_REG

PPC

0x4101_1000

0x4101_17FF

2K

S4

CMP_REG

PPC

0x4101_1800

0x4101_1FFF

2K

S4

CTC_REG

PPC

0x4101_2000

0x4101_2FFF

4K

S4

KSCAN_REG

PPC

0x4101_3000

0x4101_3FFF

4K

S4

IPC0_REG

PPC

0x4101_4000

0x4101_47FF

2K

S4

IPC1_REG

PPC

0x4101_4800

0x4101_4FFF

2K

S4

DEBUGTIMER_REG

PPC

0x4101_5000

0x4101_5FFF

4K

S4

PMC_TIMER_REG

PPC

0x4101_6000

0x4101_6FFF

4K

S4

TIMER0_REG

PPC

0x4101_7000

0x4101_71FF

512

S4

TIMER1_REG

PPC

0x4101_7200

0x4101_73FF

512

S4

TIMER2_REG

PPC

0x4101_7400

0x4101_75FF

512

S4

TIMER3_REG

PPC

0x4101_7600

0x4101_77FF

512

S4

TIMER4_REG

PPC

0x4101_7800

0x4101_79FF

512

S4

TIMER5_REG

PPC

0x4101_7A00

0x4101_7BFF

512

S4

TIMER6_REG

PPC

0x4101_7C00

0x4101_7DFF

512

S4

TIMER7_REG

PPC

0x4101_7E00

0x4101_7FFF

512

S5

TIMER8_REG

PPC

0x4110_0000

0x4110_01FF

512

S5

TIMER9_REG

PPC

0x4110_0200

0x4110_03FF

512

S5

TIMER10_REG

PPC

0x4110_0400

0x4110_05FF

512

S5

TIMER11_REG

PPC

0x4110_0600

0x4110_07FF

512

S5

TRNG_REG

PPC

0x4110_1000

0x4110_1FFF

4K

S5

RXI300M4_REG

PPC

0x4110_2000

0x4110_3FFF

8K

S5

RSIP_REG

PPC

0x4110_4000

0x4110_4FFF

4K

S5

LEDC_REG

PPC

0x4110_5000

0x4110_5FFF

4K

S5

AUDIO_REG

PPC

0x4110_6000

0x4110_6FFF

4K

S5

IR_REG

PPC

0x4110_7000

0x4110_7FFF

4K

S5

I2C0_REG

PPC

0x4110_8000

0x4110_9FFF

8K

S5

I2C1_REG

PPC

0x4110_A000

0x4110_BFFF

8K

S6

PSRAM

MPC

0x6000_0000

0x6FFF_FFFF

256M

ROM

ROM is factory-programmed and contains Boot ROM startup code; it cannot be modified. In general, each CPU has a physically separate ROM that can only be accessed by that CPU, ensuring boot security and inter-core isolation. Some chips also have a shared ROM that is accessible by all CPUs.

RTL8721Dx:

ROM address space: 0x0000_0000 – 0x0007_FFFF.

  • KM4: 288KB ITCM ROM

  • KM0: 160KB ITCM ROM

TCM

TCM (Tightly Coupled Memory) is directly connected to the CPU, providing the lowest access latency and is suitable for time-critical tasks. It is repurposed from partially or fully disabled I-Cache/D-Cache. A given region operates in either Cache mode or TCM mode — the two cannot be used simultaneously.

RTL8721Dx:

Not supported.

SRAM

On-chip SRAM is the primary working memory for program execution, used for system stack, dynamic memory allocation, and application data. Some SRAM regions are shared with the Wi-Fi/BT protocol stacks; once the corresponding feature is enabled, those regions are occupied by the protocol stack and are no longer available as general-purpose SRAM.

RTL8721Dx:

The on-chip SRAM starts from 0x2000_0000 and consists of two blocks:

  • A general-purpose 512KB contiguous SRAM for system heap and application, connected to S1.

  • A dedicated 160KB SRAM, including 40KB shared with Wi-Fi and 120KB shared with BT, connected to S2. If the user application uses Wi-Fi or BT functionality, the corresponding SRAM will be occupied and can no longer be used as general-purpose SRAM.

All SRAM supports byte/half-word/word (8/16/32-bit) access. It can be enabled or disabled via the PMU to save power, and can enter retention mode for fast wake-up when the system enters sleep mode.

Flash

Flash is a non-volatile storage medium for firmware code and user data; data is retained when power is removed. The Flash memory consists of a SPI Flash controller and a Flash memory array module. The controller acts as an interface between the system bus and the Flash device, implements erase/program operations and read/write protection mechanisms, and accelerates code execution speed through an instruction prefetch and cache line system.

RTL8721Dx:

The SPI Flash controller supports Single/Dual/Quad-wire SPI NOR Flash, up to 100MHz SDR.

DRAM

Some chips integrate stacked high-speed DRAM (DDR or PSRAM) to provide large-capacity extended memory, suitable for applications requiring large data buffers such as audio/video processing and image transfer. For chip models that do not support DRAM, refer to the description in the corresponding tab.

PSRAM

PSRAM (Pseudo Static RAM) is based on the HyperBus interface and uses Double Data Rate (DDR) transfer. Its internal refresh logic is transparent to the host; the host does not need to manage refresh operations, making the usage experience similar to SRAM.

RTL8721Dx:

Supports DDR HyperBus PSRAM.

  • Clock rate: up to 200MHz

  • 8-bit I/O

  • Supports half-sleep mode and deep power-down mode

DDR

The DDR interface uses Double Data Rate synchronous technology, transferring two data bytes per clock cycle on the DQ signals, enabling high-speed read/write throughput.

RTL8721Dx:

Not supported.