Tool/software: Code Composer Studio
Hy,
in my CC1352 I need to persist some values. I want to use osal_snv to use internal flash to do so. Does that sound OK?
I read the user manual and tried the following:
In my source code I included
#include <Drivers/nv/nvintf.h> #include "osal_snv.h"
Then I defined some snv IDs:
#define BLE_NVID_CUST_VL53SETTINGS 0x80 #define BLE_NVID_CUST_TIMING 0x81 #define BLE_NVID_CUST_CALIBDATA 0x82
During start up from function RemoteDisplay_init after ICall_registerApp I call
uint8_t status; status = osal_snv_read(BLE_NVID_CUST_TIMING, sizeof(ttimingSettings), timingSettings); if (NVINTF_SUCCESS != status ) { memcpy(timingSettings, &defaultTimingSettings, sizeof(ttimingSettings)); }
When I try this, osal_snv_read always returns not NVINTF_SUCCESS, which is clear because I have never written any data into SNV.
But then I try to write data by calling
osal_snv_write(BLE_NVID_CUST_TIMING, 20, timingSettings)
This function also returns NVINTF_FAILURE and no data is written to flash.
I tried several project settings, at the moment I have
-DOSAL_SNV=2
in my .opts file of the application, also in the opts file of the stack library.
osal_snv_init seems to get called somewhere, at least nvFptrs is filled:
Any hints? Any help appreciated.
Regards
Harald