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.

RTOS/CC2640: Using the SNV Flash to Store Bytes

Part Number: CC2640

Tool/software: TI-RTOS

Hello, 

I am looking to use the SNV Flash pages on the cc2640 to store a series of bytes. I have read through some of the documentation on the SNV Flash storage but I've yet to fully grasp it.

http://www.ti.com/lit/ug/swru393e/swru393e.pdf

http://dev.ti.com/tirex/content/simplelink_cc2640r2_sdk_1_40_00_45/docs/blestack/ble_user_guide/html/cc2640/memory_management.html

Basically, I am attempting to store a bytes of data when a bluetooth connection is lost. Instead of sending the data off via bluetooth, it would save it to the SNV. Once the connection is reestablished, the SNV can be read.

I Imagine the SNV code to look similar to this:

//Connection lost 

osal_snv_write(0x80, 1,  (uint8 *)writebuf);

// Connection reestablished

storestatus = osal_snv_read(0x80, 1, (uint8 *)readbuf);

if (storestatus = read_success )

{
DATA_SEND = readbuf[0];
}

However when I run the above pseudo-code, I am only seeing the latest data written to the SNV at the 0x80 ID.

Is it possible to write individual bytes to an ID and iterate through the values, or do i have to write them in a large (255 bytes) array?    (One large Array per ID)

Thanks, 

Kevin