KM4 IMG3 BD RAM, can be merged to KM4 BD RAM if not need
x
KM4 BD RAM
0x2002_2000
280
KM4 BDRAM data, BSS and heap
√
KM0 BD RAM
0x2006_8000
96
KM0 BDRAM data, BSS and heap
√
KM4 BD PSRAM TZ
0x6000_0000
64
KM4 IMG3 PSRAM, can be merged to KM4 PSRAM if not need
x
KM4 BD PSRAM
0x6001_0000
3220
KM4 BD PSRAM code and data
√
KM0 BD PSRAM
0x6032_5000
876
KM0 BD PSRAM code and data
√
KM4 HEAP EXT
0x6FFF_FFFF
0
If KM4 heap is not enough, it can be used to extend the heap size
x
KM0 HEAP EXT
0x6FFF_FFFF
0
If KM0 heap is not enough, it can be used to extend the heap size
x
Note
When Trustzone is disabled, the KM4BDRAMTZ and KM4BDPSRAMTZ will be configured as Non-secure regions, and will be merged into KM4BDRAM and KM4BDPSRAM respectively.
RTL8720E:
RAM layout With PSRAM
Note
If Trustzone is not enabled, the KM4_BD_PSRAM_TZ are non-secure and would be merged into KM4_BD_PSRAM.
Item
Start address
Size
Description
Mandatory
SRAM FIXED
0x2000_0000
40KB
For ROM BSS, MSP …
√
KM4 BOOTLOADER
0x3000_A000
28KB
For Bootloader
√
KM4 BD RAM
0x2001_1000
348KB
KM4 BDRAM data, BSS and heap
√
KR4 BD RAM
0x2006_8000
96KB
KR4 BDRAM data, BSS and heap
√
KM4 BD PSRAM TZ
0x6000_0000
64KB
KM4 IMG3, can be merged into KM4 PSRAM if IMG3 is not needed
x
KM4 BD PSRAM
0x6001_0000
1472KB
KM4 code
√
KR4 BD PSRAM
0x6018_0000
1536KB
KR4 code
√
KM4 HEAP EXT
0x6FFF_FFFF
0
If KM4 Heap is not enough, it can be used to extend the heap size
x
KR4 HEAP EXT
0x6FFF_FFFF
0
If KR4 Heap is not enough, it can be used to extend the heap size
x
RAM layout Without PSRAM
Note
If Trustzone is not enabled, the KM4_BD_RAM_TZ are non-secure and would be merged into KM4_BD_RAM.
Item
Start address
Size
Description
Mandatory
SRAM FIXED
0x2000_0000
40KB
For ROM BSS, MSP …
√
KM4 BOOTLOADER
0x3000_A000
28KB
For Bootloader
√
KM4 BD RAM TZ
0x2001_1000
64KB
KM4 IMG3, can be used by users if IMG3 is not needed
x
KM4 BD RAM
0x2002_0000
288KB
KM4 BDRAM data, BSS and heap
√
KR4 BD RAM
0x2006_8000
96KB
KR4 BDRAM data, BSS and heap
√
RTL8726E:
Note
If Trustzone is not enabled, the KM4_BD_PSRAM_TZ are non-secure and would be merged into KM4_BD_PSRAM.
Item
Start address
Size
Description
Mandatory
SRAM FIXED
0x2000_0000
40KB
For ROM BSS, MSP and so on
√
KM4 BOOTLOADER
0x3000_A000
28KB
For Bootloader
√
KM4_BD_PSRAM_TZ
0x6000_0000
64KB
KM4 IMG3, can be merged into KM4 BD PSRAM if IMG3 is not needed
x
KM4 BD PSRAM
0x6001_0000
1472KB
KM4 code, data, BSS and heap
√
KR4 BD PSRAM
0x6018_0000
1536KB
KR4 code, data, BSS and heap
√
DSP BD PSRAM
0x6030_0000
5120KB
DSP PSRAM
√
KM4 HEAP EXT
0x6FFF_FFFF
0
If KM4 Heap is not enough, it can be used to extend the heap size
x
KR4 HEAP EXT
0x6FFF_FFFF
0
If KR4 Heap is not enough, it can be used to extend the heap size
x
RTL8713E:
Note
If Trustzone is not enabled, the KM4_BD_PSRAM_TZ are non-secure and would be merged into KM4_BD_PSRAM.
Item
Start address
Size
Description
Mandatory
SRAM FIXED
0x2000_0000
40KB
For ROM BSS, MSP and so on
√
KM4 BOOTLOADER
0x3000_A000
28KB
For Bootloader
√
KM4_BD_PSRAM_TZ
0x6000_0000
64KB
KM4 IMG3, can be merged into KM4 BD PSRAM if IMG3 is not needed
x
KM4 BD PSRAM
0x6001_0000
1472KB
KM4 code, data, BSS and heap
√
KR4 BD PSRAM
0x6018_0000
1536KB
KR4 code, data, BSS and heap
√
DSP BD PSRAM
0x6030_0000
5120KB
DSP PSRAM
√
KM4 HEAP EXT
0x6FFF_FFFF
0
If KM4 Heap is not enough, it can be used to extend the heap size
x
KR4 HEAP EXT
0x6FFF_FFFF
0
If KR4 Heap is not enough, it can be used to extend the heap size
x
RTL8730E:
Item
Sub-item
Physical address
Size
Description
Mandatory
KM4 DRAM
KM4_IMG2_RAM_NS
0x6000_0000
1388KB
KM4 image2 SRAM, including code, data, BSS and heap
√
KM4_BD_RAM_NSC
0x6015_B000
4KB
KM4 Non-secure Callable region
x
KM4_BD_RAM_ENTRY
0x6015_C000
16KB
KM4 Non-secure Callable function entry
x
KM4_BD_RAM_S
0x7016_0000
128KB
KM4 secure image, including secure code, data, BSS and heap
x
KM4_DRAM_HEAP_EXT
0x6070_0000
1MB
KM4 heap extend
√
CA32 DARM
BL1_RO
0x6018_0000
128KB
AP BL1 code and RO data
√
BL1_RW
0x601A_0000
64KB
AP BL1 Stack and BSS
√
SHARED_RAM
0x601B_0000
64KB
AP shared memory for multi-core
√
BL2
0x601C_0000
256KB
AP BL2 code, data, stack and BSS
√
BL32
0x6020_0000
1MB
AP BL32 code, data, stack and BSS
For FreeRTOS SDK, BL32 is SP_MIN.
√
BL33
0x6030_0000
4MB
AP BL33 code, data, stack and BSS
For FreeRTOS SDK, BL33 is image2 (application).
√
KM4 SRAM
KM4_BOOT_RAM_S
0x3000_3000
68KB
KM4 Secure bootloader, including data and code
√
KM4_BD_RAM
0x2001_4000
28KB
KM4 MAIN SRAM, used when XIP only
x
ATF SHARE SRAM
0x3001_F000
3.5KB
used for atf share ram when XIP only
x
CA32_BL1 SRAM_S
0x3001_FE00
512B
CA32 BL1 SRAM
√
RSVD for Audio
0x2002_0000
128KB
Reserved for Audio
√
KM0 SRAM
KM0_BD_RAM
0x2300_2000
119.25KB
KM0 image2 SRAM, including code, data, BSS and heap
√
IPC_MEM
0x2301_FD00
768B
Buffer for IPC between CPUs
√
Note
If Trustzone is not enabled, the KM4BDRAMTZ and KM4BDPSRAMTZ are non-secure and would be merged into KM4BDRAM and KM4BDPSRAM, respectively.
RTL8721F:
Item
Start address
Size (KB)
Description
Mandatory
SRAM FIXED
0x2000_0000
20
For ROM BSS, MSP, …
√
KM4TZ Bootloader
0x3000_5000
32
KM4TZ secure bootloader, including code and data
√
KM4TZ BD RAM TZ
0x2000_D000
64
KM4TZ IMG3 BD RAM, can be merged to KM4TZ BD RAM if not need
x
KM4TZ BD RAM
0x2001_D000
204
KM4TZ BDRAM data, BSS and heap
√
KM4NS BD RAM
0x2005_0000
192
KM4NS BDRAM data, BSS and heap
√
KM4TZ BD PSRAM TZ
0x6000_0000
148
KM4TZ IMG3 PSRAM, can be merged to KM4TZ PSRAM if not need
x
KM4TZ BD PSRAM
0x6002_5000
3072
KM4TZ BD PSRAM code, data and heap
√
KM4NS BD PSRAM
0x6032_5000
876
KM4NS BD PSRAM code, data and heap
√
KM4TZ HEAP EXT
0x6FFF_FFFF
0
If KM4TZ heap is not enough, it can be used to extend heap size
x
KM4NS HEAP EXT
0x6FFF_FFFF
0
If KM4NS heap is not enough, it can be used to extend heap size
x
Note
If Trustzone is not enabled, the KM4TZBDRAMTZ and KM4TZBDPSRAMTZ are non-secure and would be merged into KM4TZBDRAM and KM4TZBDPSRAM, respectively.
RTL8735C:
Item
Start address
Size
Description
Mandatory
NP_PSRAM
0x2000_0020
2MB - 32B
NP PSRAM memory
√
VP_PSRAM
0x2020_0020
~1.8MB
VP PSRAM memory
√
NP_PSRAM_S
0x3000_0020
NP PSRAM secure section
√
AP_PSRAM_SECURE0
0x303C_FFE0
188KB
AP secure section0
√
AP_PSRAM_SECURE1
0x303F_F000
4KB
AP secure section 1
√
Item
Start address
Size
Description
Mandatory
AP_DDR_SECURE0
0xA000_0000
1MB
AP secure section 0
√
AP_DDR_SECURE1
0xA010_0000
1MB
AP secure section 1
√
AP_DDR_SECURE2
0xA020_1000
124KB
AP secure section 3
√
AP_DDR_RO
0x8022_0000
2MB
AP read-only region
√
AP_DDR
0x8042_0000
~28MB
AP main memory
√
AP_DDR_STK
0x81FE_0000
256KB
AP stack region
√
EN_DDR
0x8200_0000
32MB
Encoder memory
√
VP_DDR
0x8400_0000
48MB
VP memory
√
TG_DDR
0x8700_0000
4MB
Tensor generator memory
√
NN_DDR
0x8740_0000
12MB
Neural network memory
√
Note
If TrustZone is enabled, part of NP_PSRAM is reserved as the secure section NP_PSRAM_S, and the remaining NP_PSRAM is used as non-secure memory with a reduced size.
menuconfig provides configuration options for controlling code/data loading locations. Navigate to CONFIG Link Option
IMG1(Bootloader) running on FLASH or SRAM? (FLASH) --->IMG2(Application) running on FLASH or PSRAM? (FLASH) --->[ ] PSRAM AS HEAP
Option descriptions:
IMG1(Bootloader)runningonFLASHorSRAM? :
FLASH : Entire bootloader code runs from FLASH.
SRAM : Load full bootloader code into SRAM. Typically used for high-security scenarios with sufficient SRAM space.
IMG2(Application)runningonFLASHorPSRAM? :
FLASH: Execute application code directly from FLASH (NOR FLASH only).
PSRAM: Load application code into PSRAM for faster execution or higher security requirements.
PSRAMASHEAP: Allocate PSRAM free space to application heap.
Note
Verify PSRAM integration (internal/external) before selecting PSRAM-related options.
RTL8720E:
menuconfig provides configuration options for controlling code/data loading locations. Navigate to CONFIG Link Option
IMG1(Bootloader) running on FLASH or SRAM? (FLASH) --->IMG2(Application) running on FLASH or PSRAM? (FLASH) --->
Option descriptions:
IMG1(Bootloader)runningonFLASHorSRAM? :
FLASH : Entire bootloader code runs from FLASH.
SRAM : Load full bootloader code into SRAM. Typically used for high-security scenarios with sufficient SRAM space.
IMG2(Application)runningonFLASHorPSRAM? :
FLASH: Execute application code directly from FLASH (NOR FLASH only).
PSRAM: Load application code into PSRAM for faster execution or higher security requirements.
Note
Verify PSRAM integration (internal/external) before selecting PSRAM-related options.
RTL8726E:
menuconfig provides configuration options for controlling code/data loading locations. Navigate to CONFIG Link Option
IMG1(Bootloader) running on FLASH or SRAM? (FLASH) --->IMG2(Application) running on FLASH or PSRAM? (FLASH) --->
Option descriptions:
IMG1(Bootloader)runningonFLASHorSRAM? :
FLASH : Entire bootloader code runs from FLASH.
SRAM : Load full bootloader code into SRAM. Typically used for high-security scenarios with sufficient SRAM space.
IMG2(Application)runningonFLASHorPSRAM? :
FLASH: Execute application code directly from FLASH (NOR FLASH only).
PSRAM: Load application code into PSRAM for faster execution or higher security requirements.
Note
Verify PSRAM integration (internal/external) before selecting PSRAM-related options.
RTL8713E:
menuconfig provides configuration options for controlling code/data loading locations. Navigate to CONFIG Link Option
IMG1(Bootloader) running on FLASH or SRAM? (FLASH) --->IMG2(Application) running on FLASH or PSRAM? (FLASH) --->
Option descriptions:
IMG1(Bootloader)runningonFLASHorSRAM? :
FLASH : Entire bootloader code runs from FLASH.
SRAM : Load full bootloader code into SRAM. Typically used for high-security scenarios with sufficient SRAM space.
IMG2(Application)runningonFLASHorPSRAM? :
FLASH: Execute application code directly from FLASH (NOR FLASH only).
PSRAM: Load application code into PSRAM for faster execution or higher security requirements.
Note
Verify PSRAM integration (internal/external) before selecting PSRAM-related options.
RTL8730E:
menuconfig provides configuration options for controlling code/data loading locations. Navigate to CONFIG Link Option
IMG1(Bootloader) running on FLASH or SRAM? (FLASH) --->IMG2(Application) running on FLASH or PSRAM? (FLASH) --->[ ] PSRAM AS HEAP
Option descriptions:
IMG1(Bootloader)runningonFLASHorSRAM? :
FLASH : Entire bootloader code runs from FLASH.
SRAM : Load full bootloader code into SRAM. Typically used for high-security scenarios with sufficient SRAM space.
IMG2(Application)runningonFLASHorPSRAM? :
FLASH: Execute application code directly from FLASH (NOR FLASH only).
PSRAM: Load application code into PSRAM for faster execution or higher security requirements.
PSRAMASHEAP: Allocate PSRAM free space to application heap.
Note
Verify PSRAM integration (internal/external) before selecting PSRAM-related options.
RTL8721F:
menuconfig provides configuration options for controlling code/data loading locations. Navigate to CONFIG Link Option
IMG1(Bootloader) running on FLASH or SRAM? (FLASH) --->IMG2(Application) running on FLASH or PSRAM? (FLASH) --->[ ] PSRAM AS HEAP
Option descriptions:
IMG1(Bootloader)runningonFLASHorSRAM? :
FLASH : Entire bootloader code runs from FLASH.
SRAM : Load full bootloader code into SRAM. Typically used for high-security scenarios with sufficient SRAM space.
IMG2(Application)runningonFLASHorPSRAM? :
FLASH: Execute application code directly from FLASH (NOR FLASH only).
PSRAM: Load application code into PSRAM for faster execution or higher security requirements.
PSRAMASHEAP: Allocate PSRAM free space to application heap.
Note
Verify PSRAM integration (internal/external) before selecting PSRAM-related options.
RTL8735C:
menuconfig provides configuration options for controlling code/data loading locations. Navigate to CONFIG Link Option
IMG1(Bootloader) running on SRAM? (SRAM) --->IMG2(FP Application) running on SRAM (SRAM) --->IMG2(NP Application) running on PSRAM (PSRAM) --->IMG2(VP Application) running on PSRAM? (PSRAM) --->IMG2(AP Application) running on DDR? (DDR) --->
Option descriptions:
IMG1(Bootloader)runningonSRAM? : Bootloader code is loaded into SRAM for execution.
IMG2(FPApplication)runningonSRAM : FP (Function Processor) application code runs from SRAM.
IMG2(NPApplication)runningonPSRAM : NP (Network Processor) application code runs from PSRAM.
IMG2(VPApplication)runningonPSRAM? : VP (Video Processor) application code runs from PSRAM.
IMG2(APApplication)runningonDDR? : AP (Application Processor) application code runs from DDR.
Note
Memory assignments for RTL8735C are fixed per processor core. Each processor is allocated a specific memory type based on its role and performance requirements.
Remaining SRAM space (after Fixed RAM and IMG1 allocation) is distributed to KM4_IMG3, KM0_IMG2, and KM4_IMG2. RAM_KM4_IMG3_SIZE defines KM4_IMG3’s SRAM size, RAM_KM0_IMG2_SIZE defines KM0_IMG2’s size. Users can adjust these values.
PSRAM space allocation sequence: KM4_IMG3 -> KM4_IMG2 -> KM0_IMG2. Default size 4MB (PSRAM_BASE to PSRAM_END). Adjust PSRAM_END for actual PSRAM size.
To reallocate space between PSRAM_BASE-PSRAM_END: Modify PSRAM_KM4_IMG3_SIZE for KM4_IMG3, PSRAM_KM4_IMG2_SIZE for KM4_IMG2. Remaining space goes to KM0_IMG2.
Space after PSRAM_END (if exists) can be used as extended heap xxx_PSRAM_HEAP_EXT (disabled by default).
KM4_BD_RAM and KR4_BD_RAM allocate all remaining SRAM space (excluding IMG1 and Fixed RAM). Modify RAM_KR4_IMG2_SIZE or RAM_KM4_IMG2_SIZE to adjust their allocation ratio.
PSRAM space between PSRAM_BASE to PSRAM_DSP_START is allocated to KM4_IMG3, KM4_IMG2 and KR4_IMG2. Adjust via PSRAM_KM4_IMG3_SIZE (KM4_IMG3), PSRAM_KM4_IMG2_SIZE (KM4_IMG2), remaining space goes to KR4_IMG2.
Space after PSRAM_DSP_START can be: 1) Used as extended heap 2) Merged into BD_PSRAM by adjusting PSRAM_DSP_START (keep within PSRAM physical range).
Space between PSRAM_BASE-PSRAM_DSP_START: Allocated to KM4_IMG3/KM4_IMG2/KR4_IMG2 in order. Adjust via PSRAM_KM4_IMG3_SIZE (KM4_IMG3), PSRAM_KM4_IMG2_SIZE (KM4_IMG2), remaining space auto-allocated to KR4_IMG2.
PSRAM_DSP_START-PSRAM_END: For DSP (adjust PSRAM_END per actual PSRAM size)
Beyond PSRAM_END (if any): Available as xxx_PSRAM_HEAP_EXT (disabled by default)
Space between PSRAM_BASE-PSRAM_DSP_START: Allocated to KM4_IMG3/KM4_IMG2/KR4_IMG2 in order. Adjust via PSRAM_KM4_IMG3_SIZE (KM4_IMG3), PSRAM_KM4_IMG2_SIZE (KM4_IMG2), remaining space auto-allocated to KR4_IMG2.
PSRAM_DSP_START-PSRAM_END: For DSP (adjust PSRAM_END per actual PSRAM size)
Beyond PSRAM_END (if any): Available as xxx_PSRAM_HEAP_EXT (disabled by default)
Remaining SRAM (after Fixed RAM and IMG1) allocated to KM4TZ_IMG3/KM4NS_IMG2/KM4TZ_IMG2. Adjust via RAM_KM4TZ_IMG3_SIZE (KM4_IMG3), RAM_KM4NS_IMG2_SIZE (KM4NS_IMG2), remaining space → KM4TZ_IMG2