NVSMSP432 attributes. More...
#include <NVSMSP432.h>
Data Fields | |
void * | regionBase |
size_t | regionSize |
NVSMSP432 attributes.
The 'regionBase' field must point to the base address of the region to be managed.
The regionSize must be an integer multiple of the flash sector size. For most MSP432 devices, the flash sector size is 4096 bytes. The NVSMSP432 driver will determine the device's actual sector size by reading internal system configuration registers.
Care must be taken to ensure that the linker does not unintentionally place application content (e.g., code/data) in the flash regions.
For CCS and IAR tools, defining and reserving flash memory regions can be done entirely within the Board.c file. For GCC, additional content is required in the application's linker command file to achieve the same result.
The example below defines a char array, 'flashBuf' and uses compiler CCS and IAR compiler pragmas to place 'flashBuf' at a specific address within the flash memory.
For GCC, the 'flashBuf' array is placed into a named linker section. Corresponding linker commands are added to the application's linker command file to place the section at a specific flash memory address. The section placement command is carefully chosen to only RESERVE space for the 'flashBuf' array, and not to actually initialize it during the application load process, thus preserving the content of flash.
The 'regionBase' fields of the two HWAttrs region instances are initialized to point to the base address of 'flashBuf' and to some offset from the base of the char array.
The linker command syntax is carefully chosen to only RESERVE space for the char array and not to actually initialize it during application load.
void* NVSMSP432_HWAttrs::regionBase |
Base address of flash region
size_t NVSMSP432_HWAttrs::regionSize |
The size of the region in bytes