xWRL684x MMWAVE-L-SDK  06.00.04
Shared Memory Usage

Introduction

Shared memory is a mechanism that allows multiple processes or subsystems in a system to access the same physical memory space. Here, Only one subsystem at a time can access shared memory space. This technique enables fast and efficient communication between different subsystems and memory. It allows the DSS subsystem's memory to be directly utilized as RAM for the APPSS subsystem, ensuring efficient data sharing and enhanced performance across both subsystems. This solution optimizes memory usage, reduces data transfer overhead, and improves the overall system efficiency, making it ideal for applications that require high-performance computing and real-time data processing.

xWRL684x has 896KB Shared Memory in following configurations:

  • 512KB TCMA shared memory between DSS and APPSS
  • 256KB TCMB shared memory between DSS and APPSS
  • 128KB shared between DSS and FECSS.

This example shows the usage of 768KB DSS/APPSS Shared memory as APPSS memory and usage of 128KB DSS/FECSS (configured for DSS by default) shared memory in APPSS software. Following registers will help in configuring 768KB Memory between APPSS and HWASS (Refer to Technical Reference Manual for more details):

  • TOP_PRCM:DSS_PD_MEM_SHARE_REG
  • APP_CTRL:APPSS_SHARED_MEM_CLK_GATE

To configure FECSS/DSS Shared Memory (128KB) for FECSS(Configured for DSS by default), Following registers have to be configured (Refer to Technical Reference Manual for more details):
TOP_PRCM:DSS_PD_MEM_SHARE_REG
FEC_CTRL:FECSS_SHARED_MEM_CLK_GATE

When running in functional mode RBL can be leveraged to perform these configurations. This can be done through modifying "sharedRamAllocationControl" field found in metaimage_cfg."profile".json macro found in build. The below diagram and table demonstrate how "sharedRamAllocationControl" field allows us to allocate different shared memory. The following configurations are possible:

SHARED RAM ALLOCATION CONTROL FIELD DESCRIPTION

  • 4 BYTE FIELD.
Bits Field Description
[1:0] TCMA shared RAM 0b00: Don't allocate TCMA to APPSS
0b01: Allocate immediate 256 KB to APPSS
0b10: Invalid
0b11: Allocate 512 KB to APPSS
[2:2] Extend APPSS TCMB 0b0: Don't allocate TCMA to APPSS
0b1: Allocate 256 KB to APPSS (i.e. extend TCMB)
[3:3] FECSS Shared RAM Allocation 0b0: Don't allocate shared RAM to FECSS
0b1 Allocated shared RAM to FECSS
[15:4] Reserved
[16:16] FECSS ROM Eclipse 0b0: Don't eclipse the FECSS ROM with shared RAM
0b1: Eclipse FECSS ROM with shared RAM
[31:17] Reserved -


HOW TO RUN SHARED MEMORY APPLICATION FROM CCS DEBUGGER

To ensure everything functions as expected, especially when using a debugger, a specific initialization process must be followed:

  1. Build and run a minimal(empty) application by modifying "sharedRamAllocationControl" field in metaimage_cfg."profile".json to enable the shared memory. Refer SHARED RAM ALLOCATION CONTROL FIELD DESCRIPTION.
  2. Once this step is complete, you can load and run your main application using the debugger.

This initialization process is important to ensure the system is set up correctly for shared memory usage during debugging.

SHARED RAM ALLOCATION TABLE

SHARED RAM ALLOCATION CONTROL VALUE TOTAL APPSS RAM (INCL. SHARED RAM) DSS (FECSS shared Memory to be taken care by DSS)
"sharedRamAllocationControl": "0" 0x00000000 - 0x0007FFFF (512 KB)(TCMA address in eclipse mode) + 0x08000000 - 0x0803FFFF (256KB)(TCMB) 0x88000000 - 0x8815FFFF (1408 KB)
"sharedRamAllocationControl": "1", 0x00000000 - 0x000BFFFF (768 KB)(TCMA address in eclipse mode) + 0x08000000 - 0x0803FFFF (256KB)(TCMB) 0x88000000 - 0x8811FFFF (1152 KB)
"sharedRamAllocationControl": "3", 0x00000000 - 0x000FFFFF (1024 KB)(TCMA in eclipse mode) + 0x08000000 - 0x0803FFFF (256KB)(TCMB) 0x88000000 - 0x880DFFFF (896 KB)
"sharedRamAllocationControl": "5", 0x00000000 - 0x000BFFFF (768 KB)(TCMA in eclipse mode) + 0x08000000 - 0x0805FFFF (512KB)(TCMB) 0x88000000 - 0x880DFFFF (896 KB)
"sharedRamAllocationControl": "7", 0x00000000 - 0x000FFFFF (1024 KB)(TCMA in eclipse mode) + 0x08000000 - 0x0805FFFF (512KB)(TCMB) 0x88000000 - 0x8809FFFF (640 KB)


SHARED RAM ALLOCATION CONTROL VALUE TOTAL DSS RAM (INCL. SHARED RAM) FECSS (FECSS shared Memory)
"sharedRamAllocationControl": "8" 0x88000000 - 0x8815FFFF (1408 KB) 0x21080000 - 0x21097FFC (128 KB)
"sharedRamAllocationControl": "0" 0x88000000 - 0x8813FFFF (1280 KB) 0x21080000 - 0x2111FFFC (256 KB)


In case complete DSS Memory is not used, that memory can be used for APPSS Software. However as this memory is not initialized by RBL, application has to ensure that this memory is intitialized before use. Hence we cannot use it for .text, .data, .ro sections. This example demonstrates one such use case.
.text file is being assigned to the TCMA_SHARED_RAM | TCMB_SHARED_RAM section in the linker file
Shared Memory Demonstration:



When this memory is configured for DSS the address range is in continuation to DSS Memory.

The .bss.l3 section is assigned to the DSS/FECSS shared memory space in the linker file. Fisrt 256KB will be allocated in Native RAM. The array created spans 300 KB forcing allocation into the FECSS shared memory for the remaining data. This example writes 0xFF to these memory locations.

Supported Combinations

Parameter Value
CPU + OS r5fss0-0 freertos
r5fss0-0 nortos
Toolchain ti-arm-clang
Boards xWRL6844-evm
Example folder examples/drivers/sharedmemory/

Using SDK with SysConfig

A GUI tool SysConfig is used to configure different modules and peripherals of the example. Using this tool, users can select and customize different modules and peripherals. The SysConfig tool will generate the code for initializing and configuring these modules. This configuration is saved to a file called example.syscfg for every example. To know more about how to use SDK with SysConfig, Visit this page

Using SDK with SysConfig

Steps to Run the Example

  • When using CCS projects to build, import the CCS project for the required combination and build it using the CCS project menu (see Using SDK with CCS Projects).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles).
  • Important Notes:
    • If we want this example to run from flash in functional mode, this example (sharedmemory.xxx.appimage) can be flashed using visualizer tool (Booting Tools) or UniFlash tool
    • If we want to use CCS to run this example as per Code Composer Studio (CCS) Setup and Usage Guide, following changes have to be made in empty project and empty project has to be rebuilt before using it:
      • Ensure the MPU configuration in Sys config of empty project for RAM is of sufficient size.

Sample Output

Shown below is a sample output when the application is run,

************* Accessing Data Section stored in APPSS SHARED RAM *************
Initial value of test_var1 (APPSS Shared RAM) is 1
updating value of test_var1 (APPSS Shared RAM) to 10
value of test_var1 (APPSS Shared RAM) is 10
Initial value of test_var2 (APPSS Shared RAM) is 2
updating value of test_var2 (APPSS Shared RAM) to 20
value of test_var2 (APPSS Shared RAM) is 20
************* Accessing Variables stored in DSS NATIVE RAM *************
value of testDssMemL3[0] (DSS) is 255
value of testDssMemL3[1] (DSS)is 255
************* Accessing Variables stored in DSS/FECSS SHARED RAM *************
value of testDssMemL3[262144] (DSS) is 255
value of testDssMemL3[262145] (DSS)is 255