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.

Storing and retrieving application specific data in/from NV + CC2530

Hello TI,

I have to store a app specific structure in NV memory and then have to retrieve it.

I tried to do that as mentioned below but I can not able to do it correctly.

I defined a NV item id for the app 

#define NV_APP_DATA_ID 0x0402

and then I initialize the memory OSAL apis and then i write the bytes into NV.

But when I read it it is showing some garbage value.

So please guide me for the above.

Regards

SS.

  • Try the following sample code and check if nv_test_read will be equal to nv_test_write after osal_nv_write and osal_nv_read.

    uint8 nv_test_write=0x12;
    uint8 nv_test_read=0x0;
    uint16 nv_test_id=0x0402; //Ref from ZComDef.h

    osal_nv_item_init(nv_test_id, 1, NULL);
    osal_nv_write(nv_test_id, 0, 1, &nv_test_write);
    osal_nv_read(nv_test_id, 0, 1, &nv_test_read);