www.ti.com
Other Peripherals
67
SWRU271H–October 2010–Revised April 2019
Submit Documentation Feedback
Copyright © 2010–2019, Texas Instruments Incorporated
Drivers
6.9 Other Peripherals
For examples of hardware peripherals without drivers, such as the timers, see CC2541/43/44/45
Peripherals Software Examples. For an explanation of the hardware peripherals, see CC254x Chip User’s
Guide.
6.10 Simple NV (SNV)
The SNV area of flash securely stores persistent data, such as encryption keys from bonding or custom
parameters. The protocol stack reserves two 2-kB flash pages for SNV. These pages are the last two
pages of flash by default. To minimize the number of erase cycles on the flash, the SNV manager
performs compactions on the flash sector when the sector has 80% invalidated data. A compaction is
copying valid data to a temporary area then erasing the sector where the data was stored. The SNV driver
uses the hal_flash driver.
SNV can be read from or written to using the following APIs:
uint8 osal_snv_read( osalSnvId_t id, osalSnvLen_t len, void *pBuf) Read data from NV
Parameters id – valid NV item
len – Length of data to read
pBuf – pointer to buffer to store data read
Returns SUCCESS: NV item read successfully
NV_OPER_FAILED: failure reading NV item
uint8 osal_snv_write( osalSnvId_t id, osalSnvLen_t len, void *pBuf) Write data to NV
Parameters id – valid NV item
len – Length of data to write
pBuf – pointer to buffer containing data to be written
Returns SUCCESS: NV item read successfully
NV_OPER_FAILED: failure reading NV item
Because SNV is shared with other modules in the Bluetooth Low Energy SDK such as the GAPBondMgr,
carefully manage the IDs of the NV item. The available IDs are defined in bcomdef.h by default: