xWRL6432 MMWAVE-L-SDK  05.04.00.01
Shared Memory Usage

Introduction

xWRL6432 has 512KB Shared Memory in following configurations:

  • 256KB between HWASS and APPSS
  • 96KB between HWASS and FECSS
  • 160KB dedicated to HWASS.

This example shows the usage of 256KB HWASS/APPSS Shared memory as APPSS memory and usage of 160KB HWASS dedicated Memory plus 96KB of HWA/FECSS (configured for HWASS by default) shared memory in APPSS software (helpful in cases when complete 160KB + 96KB memory is not used for HWA). Following registers will help in configuring 256KB Memory between APPSS and HWASS (Refer to Technical Reference Manual for more details):

  • TOP_PRCM:HWA_PD_MEM_SHARE_REG
  • APP_CTRL:APPSS_SHARED_MEM_CLK_GATE </ul

    When running in functional mode RBL can be leveraged to perform these configurations. This can be done through modifying "SH_MEM_CONFIG" macro found in build files ("makefile" , "makefile_ccs_bootimage_gen"). The following configurations are possible:

    SH_MEM_CONFIG VALUE TOTAL APPSS RAM (INCL. SHARED RAM) HWASS (FECSS shared Memory to be taken care by HWASS)
    SH_MEM_CONFIG=0 0x00400000 - 0x0047FFFF (512 KB) 0x60000000 - 0x6007FFFF (512 KB)
    SH_MEM_CONFIG=1 0x00400000 - 0x0049FFFF (640 KB) 0x60000000 - 0x6005FFFF (384 KB)
    SH_MEM_CONFIG=2 0x00400000 - 0x0047FFFF
    0x004A0000 - 0x004BFFFF
    (640KB)
    0x60000000 - 0x6005FFFF (384 KB)
    SH_MEM_CONFIG=3 0x00400000 - 0x004BFFFF (768 KB) 0x60000000 - 0x6003FFFF (256 KB)


    In case complete HWASS 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 M4F_SHRM section in the linker file
    Shared Memory Demonstration:



    To configure FECSS/HWA Shared Memory (96KB) for HWASS(Configured for HWASS by default), Following registers have to be configured (Refer to Technical Reference Manual for more details):
    TOP_PRCM:HWA_PD_MEM_SHARE_REG
    FEC_CTRL:FECSS_SHARED_MEM_CLK_GATE
    When this memory is configured for HWASS the address range is in continuation to HWASS (160KB) Memory.

    The .l3 section is assigned to the start of the HWASS dedicated memory space in the linker file. The array created spans more than the 160 KB forcing allocation into the FECSS shared memory area. This example writes 0xFF to these memory locations.

    Important Notes: When shared memory is allocated to M4/M3, back to back full word write access to a location followed by sub-word write access to another location corrupts data in previously written location. Refer to Errata Dig#14 "Corrupted Data Store for Partial Write in Shared Memory" in Errata document. Workarounds:

    1. Disable ECC for non functional safety devices – ECC is disabled for shared memories in RBL for non functional safety devices.
    2. Use shared memories as code memory "only" when shared with M3/M4 processor.
      Though this examples demonstrates the use of shared memory for data section etc. precautions mentioned above must be taken care of.

Supported Combinations

Parameter Value
CPU + OS m4fss0-0 freertos
Toolchain ti-arm-clang
Boards xWRL6432-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:
    • As this example is designed to run from APPSS-HWASS 256KB shared memory, following configurations are needed prior to running it.
    • Make sure to confirm that the Region Size of CONFIG_MPU_REGION1 is set to 1MB in example.syscfg
    • If we want this example to run from flash in functional mode, this example (sharedmemory.xxx.appimage) can be flashed using visualizer tool (Visualizer Tool) or UniFlash tool
    • If we want to use CCS to run this example as per CCS Launch, Load and Run, following changes have to be made in empty project and empty project has to be rebuilt before using it:
      • Modify "SH_MEM_CONFIG" to "0x3" in "makefile" and "makefile_ccs_bootimage_gen" files of empty project.
      • Ensure the MPU configuration in Sys config of empty project for RAM is of 1MB 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 HWASS SHARED RAM *************
value of testhwameml3[0] (HWA) is 255
value of testhwameml3[1] (HWA)is 255
*************Accessing Variables stored in FECSS SHARED RAM *************
value of testhwameml3[163900] (FECSS) is 255
value of testhwameml3[163901] (FECSS)is 255