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.

OSAL Nonvolatile functions (some missing and some seems bugged)

Other Parts Discussed in Thread: CC2540

Hi

Tried to use osal_nv_ functions but they are existing only in the osal api.pdf, they are missing from the SDK.

Tried to use osal_snv_ instead but I got strange errors (fail flag set to 1) in many cases when trying to save data.

This happens mostly if the code gets into the lines:

setXferPage();

compactPage(activePg);

Something is happening when snv page is changed - my opinion that is a bug somewhere there in the API.

 

Than I looked into the code and I've found something strange in the osal_snv.c file:

static void writeWord( uint8 pg, uint16 offset, uint8 *pBuf )

{

  uint16 addr = (offset >> 2) + ((uint16)pg << 9);

What's that <<9 ? That is a multiply with 512, as far as I know the usual flash page for the CC2540 is 2048! Should that be <<11? Or the snv functions are using a different paging wrapped over the normal one?

Anyway the current code starts to give errors after 2-3x 250 bytearray saved, tough the reserved SNV is 4k (2x2k).

Can any TI programmer check this and also explain the missing osal_nv_ functions from the API?

regards,

B.