How to use flash in the Bluetooth C SDK?
There are at least 2 option for this:
For PS Key usage check the Persistent Store chapter in Bluetooth Smart API Reference manual. Most of the cases the PSKeys features fulfills the application needs.
If the application needs special flash handling it is possible via the em_msc.c/h emlib driver for the EFR32 Memory System Controller.
The attached example uses the User Data flash area which is from 0x0FE00000 to 0x0FE00800. This area is not used by the Bluetooth stack (* so the application code can use it.
*) EDIT: Starting from Bluetooth SDK v2.11, you can optionally use User Data to store the HFXO crystal tuning value. More details are found in the KB article KBA_BT_1308: Saving CTUNE value as manufacturing token. If you use User Data page for your own purposes, then make sure that reding the CTUNE value from UD page is disabled.
The example uses the J-Link CDC COM port @ 115200 8N1 no flow control for reporting the UD flash status.
This is a great article. It is easy to integrate into your project. Thanks!
Sorry for the late answer. PSstore will be substituted with NVM3 in the future, which is a common storage driver across all Silicon Labs protocol stacks. NVM3 will be introduced in Bluetooth SDK early next year, so PSstore is still supported, and will be led out only after NVM3 is fully integrated and supported.
Your comment has me a bit concerned. I would prefer using the PSstore over emlib, but if it is going to be deprecated relatively soon would you recommend I use emlib instead? Also, when support for NVM3 comes out, will support for PSstore be dropped the same day, or will the SDK support both for a few iterations before dropping support for PSstore completely?
Sorry for the confusion - and for the late answer.
I encourage you to use PSstore. We do not intend to give up persistent storage support; "deprecated" here simply means that API calls may change in the future. I can't share more details on this currently as there are no definite plans yet. You will find the important changes in the Release Notes.
Any news on the usage of NVM3 driver?