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

Pstorage data after re-initializing softdevice

I would like to use pstorage to store some data.

From the developer zone I know, that the softdevice has to be used for pstorage.

I'm asking me, what will happen with the data when I activate the softdevice, store some data, disable softdevice and than again activate the softdevice. Will the data still be stored?

Or will they be deleted when I disable the softdevice?

And how I can avoid, that data will be deleted after power off?

  • Hello, the Pstorage class uses persistent storage, so you can savely disable the softdevice and reboot / shutdown the device after everything has been written. Once you get the callback that you data has been written, it should be somewhere in the last few pages of your flash memory (Your flash has probably something like 256 pages with each holding 1024 bytes.) If you do not use a bootloader, page 256 is used as swap space for the library and you should find your content in page 255 (depends on the number of blocks you have reserved and if they occupy more than 1024 bytes).

    You can check this by using nrfGo Studio, then you can dump the flash of your chip to a file and open it in an appropriate editor. Everything should be 0xFFFFF except the part where your data is now stored.

Related