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.

Linking error while using osal_nv_ functions

Other Parts Discussed in Thread: CC2540

Hello,

I am using BLE stack v1.4.1.43908 and am trying to write and read some data to and from the non-volatile memory locations. But on compiling the project on IAR, it shows following error:

Error[e46]: Undefined external "osal_nv_item_init::?relay" referred in simpleBLESwitch ( C:\Texas Instruments\BLE-CC254x-1.4.1.43908\Projects\ble\SimpleBLESwitch_EM\ 
CC2540DB\CC2540EM\Obj\simpleBLESwitch.r51 ) 
Error[e46]: Undefined external "osal_nv_write::?relay" referred in simpleBLESwitch ( C:\Texas Instruments\BLE-CC254x-1.4.1.43908\Projects\ble\SimpleBLESwitch_EM\ 
CC2540DB\CC2540EM\Obj\simpleBLESwitch.r51 ) 
Error[e46]: Undefined external "osal_nv_read::?relay" referred in simpleBLESwitch ( C:\Texas Instruments\BLE-CC254x-1.4.1.43908\Projects\ble\SimpleBLESwitch_EM\ 
CC2540DB\CC2540EM\Obj\simpleBLESwitch.r51 ) 
Error while running Linker

Can anyone suggest some solution to get rid of these errors?

Thanks and regards,

Manan

  • You need to include the "osal_snv.h" file in your project. Then you can use osal_snv_read(), osal_snv_write(), etc.
  • Hello,

    I wish to use osal_nv_* functions because I also need to erase the written flash memory in some situation and osal_snv_ functions are not available for that purpose as far as I know. Can this be done?

    Thanks and regards,

    Manan

  • If you try to write to a location that already has been written to, osal_snv will realize this, transfer the current NV page to an empty page, erase the original page, and rewrite with the new value.

    Once you start doing manual erases, you will break osal_snv and will need to use your own NV scheme.
  • Hello,

    Okay. Thanks for that. But if I really need delete NV page, how do I do it? Because on using osal_nv_ scheme of functions, the IAR gives me a linker error (BLE Stack 1.4.1.43908).

    Can you also tell me is there any limit to the number read or write cycles to be performed on the NV memory of CC2540?

    Thanks and regards,

    Manan

  • You can refer to 2.2.3 Physical Memory in CC254x user guide.

    Flash Memory. The on-chip flash memory is primarily intended to hold program code and constant data.

    The flash memory has the following features:

    • Page size: 1 KB or 2 KB (details are given in the data sheet of the device.)

    • Flash-page erase time: 20 ms

    • Flash-chip (mass) erase time: 20 ms

    • Flash write time (4 bytes): 20 μs

    • Data retention (at room temperature): 100 years

    • Program and erase endurance: 20,000 cycles