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

Advertisement Data stored in Flash Memory

I have nrf52840 dongle and sdk nRF5_SDK_17.0.0_9d13099.

I would like to know, is there is an example in which, Advertisement Data is stored in flash memory and reading and writing can be done on it.

In order to protect data from getting erase after dongle turns off and on.

I saw the example of storing data in flash memory, but would like to know, how do I point the advertisement data to flash memory.

regards

Shailesh

  • Hi Jared ,

    I want to modify an existing record.

    I will explain the flow of the code when I want to write the exiting record

    first, I use fds_record_find to get the record then I use fds_record_update function.

    if I use fds_record_write instead of fds_record_update, then the record in flash memory doesn't change.

    so I tried to delete the record, by calling fds_record_delete function and then fds_record_write.

    Even after that, all the records are shown in flash memory.

    regards

    Shailesh

  • Hi,

    fds_record_update() will update the descriptor to a new record and invalidate the old one. The old will then be deleted when you run the gc. fds_record_write() however will make a new record, and the old record will not be deleted, resulting in more usage of space. The method of fds_record_update() would be the correct method if you want to update a record.

    regards

    Jared 

Related