Persistent storage of keys and data using the nRF Connect SDK

Persistent storage of keys and data using the nRF Connect SDK

This blog has been converted to documentation. 

See Data storage in the nRF Connect SDK and Key storage in the nRF Connect SDK.

  • Thanks for the advise, I added a WiFi Credential chapter.

    Our PSA Protected Storage API implementation does not support storing data to external flash as of now.
    Instead, it is up to the user application to encrypt data stored to the external flash. The encryption can for example be done using the PSA Crypto API.

  • Thanks for the writeup, it's a very comprehensive overview!  I would add that in NCS v2.5.0 there's also a "WiFi Credentials Management subsystem" that can use PSA as the backend for storing SSID's and passwords.

    Is there any support for an encrypted filesystem or other storage on external flash?  If not, is there a mechanism for using the PSA API's directly to encrypt data on an external flash?

  • A note on the NVMC drivers:

    Flash writes on nRF chips take time, and can interfere with Bluetooth Low Energy or other radio operation.
    Therefore, if the radio is used, flash drivers such as NVS does not use nvmc driver directly. Instead, we use a layer in between which directs the flash write to use MPSL for scheduling flash writes.
    In practice, this means that you should not use the nvmc driver directly when working with the radio. If you use other storage systems, this will be handled automatically.

    For some more depth into this, see my answer to this devzone ticket.