nRF5 SDK v17.1.0
Flash Data Storage Example

This example presents the functionality of the Flash Data Storage (FDS) library.

Two example projects are available for each supported board: with and without the SoftDevice.

After starting the example, it prints some information about the status of the file system, such as the number of pages available, the number of records present, or the number of dirty records.

Then, the example attempts to locate a dummy configuration record. If it is found, the record is updated. Otherwise, a new record is created. The key of the record is 0x7010 and it belongs to the file 0xF010.

This example uses the Command Line Interface library to receive user input and to display information about the result and status of the operations.

Setup

You can find the source code and the project file of the example in the following folder: <InstallFolder>\examples\peripheral\flash_fds

Testing

Test the Flash Data Storage Example application by performing the following steps:

  1. Compile and program the application.
  2. Start a terminal emulator like PuTTY (recommended) with the following Terminal settings and establish a UART connection.
  3. A menu is printed on the console. You can test the available commands. The commands are:
    • print: Print the list of records or the contents of the configuration file.
    • write: Write a record to flash.
    • delete: Delete a record from flash.
    • update: Update the configuration record.
    • delete_all: Delete all records.
    • gc: Run garbage collection.
    • stat: Print file system statistics.

Documentation feedback | Developer Zone | Subscribe | Updated