Using the AUX RAM as RAM

If your application does not use the Sensor Controller, you can use this memory as RAM for your application. However, access to this memory is significantly slower than access to the SRAM. This may lead to increased power consumption and slower program execution. Additionally, if using the AUX RAM as RAM it is important that you test thoroughly. Certain objects, when put in AUX RAM can cause the application to crash. One should test for each object they want to store in AUX RAM.

Important

The Application Processor (AP) can do other tasks while the data is being transferred to AUX RAM, but if the bus buffer gets full during back to back writes, it will stall the AP until there is free space in the buffer. After you write a series of data to AUX RAM you should implement a singe read access to make sure all the data has been written. The read access will stall the AP until all the data has been transferred to AUX RAM.

In order to use the AUX RAM with you application, follow these steps (CCS is first described, then IAR).

1. Make a new define in the linker command file predefines: In CCS; Project -> Properties -> ARM Linker -> Advanced Options -> Command File Preprocessing. In IAR; Options -> Linker -> Config. Add AUX_AS_RAM=1.

2. The linker command/configuration files are somewhat different from CCS to IAR. The instructions for altering the linker configuration file in IAR follows the CCS specific explanations.

  • In the linker command file cc26xx_app.cmd, define the AUX_RAM memory area:

    #ifdef AUX_AS_RAM
    #define AUX_RAM_BASE            0x400E0000
    #define AUX_RAM_SIZE            0x800
    #endif /* AUX_AS_RAM */
    
  • Create a AUX_RAM memory section in MEMORY{}

#ifdef AUX_AS_RAM
AUX_RAM (RWX) : origin = AUX_RAM_BASE, length = AUX_RAM_SIZE
#endif /* AUX_AS_RAM */
  • Add sections of memory or code to AUX_RAM in SECTIONS{}

    Listing 23. Move object files into AUX_RAM. Example from simple_peripheral (cc26xx_app.cmd).
    #ifdef AUX_AS_RAM
      reorganized_into_auxram
      {
        simple_peripheral.obj(.data)
        devinfoservice.obj(.data)
        simple_gatt_profile.obj(.data)
        icall.obj(.data)
        board.obj(.bss)
        } > AUX_RAM
    #endif/* AUX_AS_RAM */
    

The .obj files are listed in the FlashROM folder of the app project. They are also listed with size in the .map file. A detailed description of the linker command file and memory sections is given in this article Linker Command File Primer.

If you want more control over what is stored in AUX_RAM, individual variables can be stored there with the #pragma DATA_SECTION command. Please note that this is only possible for global variables.

Listing 24. Move the global display handle variable into a new AUX RAM section called my_section.
// Display Interface
#pragma DATA_SECTION(dispHandle, "my_section")
Display_Handle dispHandle = NULL;

You can find my_section in the map-file. Here you will find the names of the objects included in my_section. In this case, the object is simple_peripheral.obj (my_section).

Listing 25. In the linker command file (cc26xx_app.cmd), add the section to AUX_RAM.
#ifdef AUX_AS_RAM
  reorganized_into_auxram
  {
    simple_peripheral.obj(my_section)
  } > AUX_RAM
#endif /* AUX_AS_RAM */

Important

When making alterations only to the linker command file, please make sure to press Rebuild, not just Build. (CCS will not recognize that you have made changes to the project before you press Rebuild.)

  1. For IAR, open the linker configuration file cc26xx_app.icf. Under Memory Definitions, add
////////////////////////////////////////////////////////////////////////////////
// AUX_RAM
//
if ( isdefinedsymbol(AUX_AS_RAM) )
{
  define symbol AUX_RAM_START        = 0x400E0000;
  define symbol AUX_RAM_SIZE         = 0x800;
  define symbol AUX_RAM_END          = AUX_RAM_START + AUX_RAM_SIZE;
}
  • Under Memory Regions, add

    if ( isdefinedsymbol(AUX_AS_RAM) )
    {
      define region AUX_RAM               = mem:[from AUX_RAM_START to AUX_RAM_END];
    }
    
  • Under Memory Placement, add

    Listing 26. Move object files into AUX_RAM. Example from simple_peripheral (cc26xx_app.icf).
    if ( isdefinedsymbol(AUX_AS_RAM) )
    {
      // AUX_RAM
      define block AUXDATA { section .data object simple_peripheral.o,
                             section .data object devinfoservice.o,
                             section .data object simple_gatt_profile,
                             section .data object icall.o,
                             section .data object board.o};
      place in AUX_RAM { block AUXDATA };
    }
    

The .o-files are listed in the .map file. For more information on the linker configuration file, please see IAR C/C++ Development Guide.

If you want more control over what is stored in AUX_RAM, individual variables can be stored there with the #pragma location command. Please note that this is only possible for global variables.

Listing 27. Move the global display handle variable into a new Cache RAM section called my_section.
// Display Interface
#pragma location="my_section"
Display_Handle dispHandle = NULL;

You can find my_section in the map-file. Here you will find the names of the objects included in my_section. In this case, the object is simple_peripheral.o (my_section).

Listing 28. In the linker configuration file (cc26xx_app.cmd), add the section to AUX_RAM.
if ( isdefinedsymbol(AUX_AS_RAM) )
{
  // AUX_RAM
  define block AUXDATA { section my_section object simple_peripheral.o };
  place in AUX_RAM { block AUXDATA };
}