This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Most efficient/smart way of persisting characteristic values on nRF52

Hello, Can anyone help me figuring out the best possible way to store certain characteristics which I want to never reset values on the events of controller RESET or power cycle (OFF/ON). The only way to reset those characteristics must be through flash (firmware) programming.

I am looking into Flash Data Storage (FDS) and App context (having support in Device Manager). Can anyone tell me what's the difference between these and which one will be better in my case. Please note that I am using Peer Manager instead of Device Manager on my nRF52 device. I am also worried about maximum flash write endurance (may be 20k times) and power consumption. Please address these issues in your answer as well.

Also, do I need to save the bonded device info for using App context? What if I delete the bond every time I disconnect (I am doing this so that nRF52 asks for passkey every time a connection is made no matter if the device was previously bonded or not).

Looking for your expert opinion. Thanks

  • If you are using Peer Manager you are already using FDS (and Fstorage), so I would recommend to only use this. Device Manager uses Pstorage which could conflict with Fstorage.

    There are some threads in here on how to use FDS to store application data. I would just update the data in flash every time a characteristic value is written to, and then every time the device starts up set the characteristic values with sd_ble_gatts_value_set().

    FDS implements wear leveling, so the flash endurance shouldn't be a problem, this if course depends on how many writes we are talking about here.

Related