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.

CC2652R: Regarding External writing in NVS external flash

Part Number: CC2652R

Hi,

I am using external flash to write data in memory.

When I am using  NVS_write(nvsHandle, offset, (void *) Cfg_data, (Sizeofdatabuffer * sizeof(uint8_t)),NVS_WRITE_POST_VERIFY);

no data is getting written in NVS. (Sizeofdatabuffer  = 200)

What am I missing while writing data using above API ?

and When I am using  NVS_write(nvsHandle, offset, (void *) Cfg_data, (Sizeofdatabuffer * sizeof(uint8_t)),NVS_WRITE_ERASE | NVS_WRITE_POST_VERIFY);

Using NVS_WRITE_ERASE flag entire sector is getting erased because of which all the data written previously get erased.

So, there is API which I can use to ERASE sector using offset value.

I tried using NVS_erase(nvsHandle, offset, regionAttrs.sectorSize);

but value of offset anything other than zero is used than erase get failed.

So how to erase particular sector ?

And is it necessary to erase NVS flash before writing anything in flash ? 

Thank you