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.
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{}
#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 the wiki 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.
// 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)
.
#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.)
- For IAR, open the linker configuration file
cc26xx_app.icf
. UnderMemory 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
, addif ( isdefinedsymbol(AUX_AS_RAM) ) { define region AUX_RAM = mem:[from AUX_RAM_START to AUX_RAM_END]; }
Under
Memory Placement
, addif ( 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.
// 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)
.
if ( isdefinedsymbol(AUX_AS_RAM) ) { // AUX_RAM define block AUXDATA { section my_section object simple_peripheral.o }; place in AUX_RAM { block AUXDATA }; }