Part Number: CC2640R2F
Simplelink Academy 1.50
TI-RTOS
CCS ver 8.0.0
OSAL_SNV = 1 ( SNV set to 1 page)
Background:
For our application, we plan on storing 10-20 bytes of device specific user information in the Flash memory at specific known memory location. We would like to access the memory locations post build and modify the device information in the hex file.
Approach used:
After looking at the CC2640R2 documentation, it looks like the SNV section in the Flash memory is what we need. But the API calls (osal_snv_read and osal_snv_write) give no control on the actual memory address. So our approach is to store it in the SNV section using LOCATION pragma and read it using the flashread functions from the driverlib library. This enables us to store the device info at a specific location and modify it post-build successfully using flash programming tools.
#pragma DATA_SECTION(bufferB, "my_section")
#pragma LOCATION(bufferB, 0x001D200)
const char bufferB[5] = {'B', '0', '0', '0', '0'};
Here 0x001D200 is a random memory location which falls within the SNV section of the Flash memory ( 0x1D000 to 0x1DFFF)
The SNV section is, however, used by the gapbondmgr as well.
Concern:
- To avoid device info to be overwritten, is it recommended to make changes to the linker file in order to reserve some memory in the SNV section for user information?
- Is it a good idea to write to the SNV section without using the API provided (osal_snv_read/ osal_snv_write)?
- Is there any other recommended solution for storing device information in the Flash memory that can be modified post build from the output hex file?