zephyr/subsys/fs
Laczen JMS 7d2e59813f subsys: fs/nvs: Rewrite for improved robustness
On flash NVS was stored one entry after another including the metadata
of each entry. This has the disadvantage that when an incomplete write
is performed (e.g. due to power failure) the complete sector had to be
rewritten to get a completely functional system.

The present rewrite changed the storage in flash of the data. For each
sector the data is now written as follows: the data itself at the
beginning of the sector (one after the other), the metadata (id, length,
data offset in the sector, and a crc of the metadata) is written from
the end of the sector. The metadata is of fixed size (8 byte) and for
a sector that is completely occupied a metadata entry of all zeros is
used.

Writing data to flash always is done by:
1. Writing the data,
2. Writing the metadata.

If an incomplete write is done NVS will ignore this incomplete write.

At the same time the following improvements were done:
1. NVS now support 65536 sectors of each 65536 byte.
2. The sector size no longer requires to be a power of 2 (but it
still needs to be a multiple of the flash erase page size).
3. NVS now also keeps track of the free space available.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2018-08-10 14:16:06 -07:00
..
fcb subsys: kconfig: Remove 'default n' properties and clean up a bit 2018-07-12 23:13:22 -04:00
nvs subsys: fs/nvs: Rewrite for improved robustness 2018-08-10 14:16:06 -07:00
CMakeLists.txt cmake: default to linking 'app' with the interface library 'FS' 2018-07-25 08:27:45 -04:00
Kconfig cmake: default to linking 'app' with the interface library 'FS' 2018-07-25 08:27:45 -04:00
fat_fs.c subsys: fs: Add the support for multiple instances of fs 2018-05-08 08:53:01 -04:00
fs.c subsys: fs: Add the support for multiple instances of fs 2018-05-08 08:53:01 -04:00
nffs_fs.c subsys: fs: Add the support for multiple instances of fs 2018-05-08 08:53:01 -04:00
shell.c subsys: fs: Fix fs_file_t and fs_dir_t usage 2018-03-13 09:47:58 -05:00