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

Store Data without Soft Device

I have to store some data in the flash. Because I need to keep data when I power off and power on the device. Now I found on the SDK 11.0/peripheral a falshwrite example. Is this for application which needs to store data, but dont use softdevice?

I know for pstorage. But I'm not sure, if I can use pstorage without softdevice.

Parents
  • Hi,

    pstorage (and the newer fstorage/FDS) does not work without a softdevice. You can use the non-volatile memory controller (NVMC) driver, or you can base your application on the flashwrite example that you mention.

    Best regards,

    Jørgen

  • I would recommend that you use a similar method to what is used in the flashwrite example:

    • Select a free location in memory to store your data. In example, last page is selected.
    • Calculate start address - addr = (uint32_t *)(pg_size * pg_num);
    • Increase the address for each write

    You do not have to "change pages", when you have filled one page, your address will point at the next page in flash.

Reply
  • I would recommend that you use a similar method to what is used in the flashwrite example:

    • Select a free location in memory to store your data. In example, last page is selected.
    • Calculate start address - addr = (uint32_t *)(pg_size * pg_num);
    • Increase the address for each write

    You do not have to "change pages", when you have filled one page, your address will point at the next page in flash.

Children
No Data