The Flash Data Storage (FDS) module is a minimalistic file system for the flash storage on the chip that minimizes the risk of data corruption and simplifies your interaction with the persistent storage. It does this by organizing data in files , which consist of one or more records . The records contain the actual data and can be written, deleted, updated, or retrieved.
The concept of treating data as files provides a much higher level of abstraction than, for example, the Persistent Storage Manager module. You can use the FDS module without detailed knowledge of the actual data format that is used internally. Instead, you can just work with files and records and use the module as a black box.
The module has been designed to provide the following benefits:
- Minimizing the risk of accessing corrupted data by constant validation: In case of power loss, data might be written incompletely. Validation ensures that FDS recognizes invalid data and never returns corrupted data to the user.
- Offering (optional) CRC verification when opening a record to ensure that data has not changed since it was written.
- Minimizing flash operations (updating and deleting): Instead of deleting full pages, FDS stores copies of new data and invalidates outdated data by a single word write.
- Basic wear leveling: Sequential writes and garbage collection provide for an even level of flash usage.
- Making it easy to access data without copying it, which makes the impact of accessing data independent of the size of the data.
- Minimizing memory usage by allowing for flexible data size.
- Offering full flexibility regarding the data that is stored: A record can be composed of several chunks of data that might be non-contiguous in memory, but are stored together in flash. Also, there are not restrictions on the content of the data (which means that it can contain special characters).
FDS uses Experimental: Flash Storage as backend to write to flash. Flash Storage, in turn, relies on the SoftDevice to execute the write. Flash Data Storage supports synchronous read operations and asynchronous writes.
Note that FDS and Experimental: Flash Storage might replace the Persistent Storage Manager in the future, and new features will be added mainly to FDS and Flash Storage. If you currently use the Persistant Storage Manager in an application, you should therefore consider switching to FDS or Flash Storage, depending on the level of abstraction that you need.
See Functionality for an explanation of the functionality that FDS provides. Storage format shows how records are stored in flash. Usage presents code examples and shows how to use FDS in an application.