This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC2340R5: Define NVS memory region on CC2340R5

Part Number: CC2340R5
Other Parts Discussed in Thread: SYSCONFIG

Tool/software:

Hi,

SDK is the latest simplelink_f3_sdk being used.

Currently we are using the CC2340R5 for our Bluetooth application and we are in need of add configuring the NVS to store some persistence related data to internal flash.

I have gone through the SDK code which talks about the NVS module with a simple example.

However, I have a doubt on how do we configure the base memory area where the data has to be written.

As per the SDK code, There is an "NVS_Params_init" function which is used to create initialize the NVS module,

void NVS_Params_init(NVS_Params *params)
{
    *params = NVS_defaultParams;
}
Here the NVS_defaultParams is defined as below which is a NULL pointer:

/* Default NVS parameters structure */
const NVS_Params NVS_defaultParams = {
    NULL /* custom */
};
Kindly help me understand how to configure the NVS base memory region.
Thanks,
Sandeep 
  • Hi !

    The NVS_Params object is not used to configure the base memory region. This object is unused in the NVS driver, and is only there to help users to create their own custom parameters if needed.

    To configure the NVS base memory region, you should create an instance of NVS in sysconfig, and set all your desired data here. You can find the NVS in Sysconfig under TI Drivers > Storage Interfaces > NVS. From there you can then se the region base and region size.

    This will create a NVS_Config object array in the ti_drivers_config.c file, which is then read by the NVS_open function. In your call to NVS_open, you need to give the index of the NVS_Config element you created in sysconfig. You can give the name of your NVS config, which should be CONFIG_NVSINTERNAL by default.

    Kind regards,
    Maxence