Data Fields
NVSRAM_HWAttrs Struct Reference

NVSRAM Hardware Attributes. More...

#include <NVSRAM.h>

Data Fields

void * regionBase
 
size_t regionSize
 
size_t sectorSize
 

Detailed Description

NVSRAM Hardware Attributes.

The 'sectorSize' is the minimal amount of data to that is cleared on an erase operation. Devices which feature internal FLASH memory usually have a 4096 byte sector size (refer to device specific documentation). It is recommended that the 'sectorSize' used match the FLASH memory sector size.

The 'regionBase' field must point to the base address of the region to be managed. It is also required that the region be aligned on a sectorSize boundary (example below to demonstrate how to do this).

The 'regionSize' must be an integer multiple of the 'sectorSize'.

Defining and reserving RAM memory regions can be done entirely within the Board.c file.

The example below defines a char array, 'ramBuf' and uses compiler pragmas to place 'ramBuf' at an aligned address within RAM.

#define SECTORSIZE (4096)
#if defined(__TI_COMPILER_VERSION__)
#pragma DATA_ALIGN(ramBuf, 4096)
#elif defined(__IAR_SYSTEMS_ICC__)
#pragma data_alignment=4096
#elif defined(__GNUC__)
__attribute__ ((aligned (4096)))
#endif
static char ramBuf[SECTORSIZE * 4];
NVSRAM_HWAttrs NVSRAMHWAttrs[1] = {
{
.regionBase = (void *) ramBuf,
.regionSize = SECTORSIZE * 4,
.sectorSize = SECTORSIZE
}
};

Field Documentation

§ regionBase

void* NVSRAM_HWAttrs::regionBase

Base address of RAM region

§ regionSize

size_t NVSRAM_HWAttrs::regionSize

The size of the region in bytes

§ sectorSize

size_t NVSRAM_HWAttrs::sectorSize

Sector size in bytes


The documentation for this struct was generated from the following file:
Copyright 2018, Texas Instruments Incorporated