Commit graph

12 commits

Author SHA1 Message Date
Andrzej Puzdrowski c0aa294690 fs: remove NFFS subsystem
NFFS is removed as it has serious bugs (by design) which haven't
been resolved since extended range of time.
One of most serious issues bunch were described here:
https://github.com/apache/mynewt-nffs/issues/10

Since lack of support NFFS upsterem it doesn't make sense to keep
it in zephyr.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2020-01-21 15:32:47 +01:00
Peter A. Bigot fb73fcd4ba subsys/fs: add support for littlefs
littlefs is a fail-safe filesystem from ARM Mbed that has wear-leveling
capabilities.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
Signed-off-by: Jim Paris <jim@bolt.io>
2019-08-06 19:39:26 +02:00
Peter A. Bigot b8be48e6ca subsys/fs: clean up CMakeLists
Remove the disabled link interface commands.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-08-06 19:39:26 +02:00
Peter A. Bigot 312f05eaef subsys/fs: add implementation helper module
File system API functions that operate on paths are passed both the
absolute path including the mount point prefix, and the mount point
within which the path lies.

Unfortunately it's not entirely trivial to convert an arbitrary path
within the file system space to an absolute path within its mount point,
because the path may be to the mount point itself and not end with a
directory separator.  The effect is that a file system implementation
like nffs may be given an empty path when "/" is required.

Add an implementation module that does this transformation and use it to
transform paths within each filesystem wrapper.

Signed-off-by: Peter A. Bigot <pab@pabigot.com>
2019-07-22 12:46:50 +02:00
Jan Van Winkel a90c000790 native_posix: Added support to access flash via FUSE
Added support to access flash device partitions from host through
FUSE.

Signed-off-by: Jan Van Winkel <jan.van_winkel@dxplore.eu>
2019-06-11 08:31:54 -04:00
Anas Nashif 45868a2dfd fatfs: move fatfs filesystem to a module
Move the fatfs component into a module hosted at
https://github.com/zephyrproject-rtos/fatfs

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-05-28 08:28:57 -04:00
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00
Sebastian Bøe 4c60c510c3 cmake: default to linking 'app' with the interface library 'FS'
This patch removes the need for application build script code to
explicitly link 'app' with a filesystem implementation.

It does this by introducing a zephyr interface library called 'FS'
that contains the usage requirements for linking with the filesystem
library subsys__fs and using Kconfig to default to linking the 'app'
library with this interface library.

Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
2018-07-25 08:27:45 -04:00
Laczen JMS b1e45b413e subsys: fs: Add Non Volatile Storage (NVS) for zephyr
Zephyr supports fatfs, nffs and fcb as storage layer. fatfs and nffs
are less suited for application in memory restricted IC's. fcb has a
smaller footprint but has a complex api.

The proposed module is a module with a even smaller footprint compared
to fcb and a simple interface for reading and writing entries. The
module provides wear levelling of flash. This allows the module to be
used not only to store configuration settings but to store device state
(e.g. state of a light switch over reboots) of a zephyr device.

Fixes buffer overflow by introducing maximum read length in nvs_read()
and nvs_read_hist().

Fixes nvs_write() not to reflash the same data. Allows the user to do
call nvs_write() for all defined entries without worries about flash
wear.

Fixes garbage collection error where wrong data could be copied.

Add nvs_delete() to allow deleting a stored entry. A deleted entry will
not be copied to a new flash sector

Include flash wear information in the README.md documentation

0/25 Update module after reviewers remarks, added documentation to
nvs.h, removed README.md by nvs.rst in doc/subsystems folder

04/26 Update module after reviewers remarks, updated nvs.rst, added more
documentation to samples/subsys/nvs/src/main.c, updated doxygen info
in nvs.h (hope this time it works).

04/26 Update subsystems.rst to include nvs.restart

04/27 Updated nvs.c and nvs.h to avoid a possible flash deletion loop
when the file system is full.

04/29 Updated nvs_write to detect and ignore deletes of non-existing
items

05/06 Update NVS module to return standard error codes, removed low
level API, added configuration options. NVS now uses the board dts to
determine the flash storage location (FLASH_AREA_STORAGE_OFFSET).

05/06 Update nvs.rst. Updated intendation and added intermediate
variables in nvs.c to make the code easier to read.

05/06 Update nvs.rst.

05/07 Update nvs.rst

05/08 Changed the API to a more standard file system API.

05/08 Removed cnt_max from nvs_read() as it is not used.

05/08 Removed #ifdef(CONFIG_NVS_LOG) from nvs_priv.h, now the module can
be build with debugging off.

05/09 Removed configuration options for SECTOR_SIZE, SECTOR_COUNT and
MAX_ELEM_SIZE. It is now easy to support multiple NVS filesystems on
one or multiple devices. Changed logging to support newlib systems.
Thanks to Olivier Martin for reporting and proposed changes.

Signed-off-by: Laczen JMS <laczenjms@gmail.com>
2018-05-15 10:29:16 +02:00
Ramakrishna Pallala 25302b1980 subsys: fs: Add Virtual File system Switch (VFS) support
Add support for Virtual File system Switch (VFS) by
introducing mount point concept to Zephyr. This allows
the applications to mount multiple file systems at
different mount points (ex: "/fatfs" and "/nffs"). The
mount point structure contains all the necessary info
required to instantiate, mount and operate on file system.

Decouple applications from directly accessing individual
file systems API's or internal functions by introducing
file system registration mechanism in VFS.

Move the file system defination and mount responsibility
to application so that application can decide which file system
to use and where to mount.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
2018-03-10 21:38:04 -05:00
Andrzej Puzdrowski b7f1289847 subsys: fs: Add Flash Circular Buffer
Zephyr already supports NFFS as a storage layer, but it might
be a little bit too heavyweight for certain applications in
memory-restricted ICs.

This module is response for need of Lightweight flash storage
capability. FCB is ported form MyNewt as native zephyr module.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
2018-01-15 15:46:37 -05:00
Sebastian Bøe 12f8f76165 Introduce cmake-based rewrite of KBuild
Introducing CMake is an important step in a larger effort to make
Zephyr easy to use for application developers working on different
platforms with different development environment needs.

Simplified, this change retains Kconfig as-is, and replaces all
Makefiles with CMakeLists.txt. The DSL-like Make language that KBuild
offers is replaced by a set of CMake extentions. These extentions have
either provided simple one-to-one translations of KBuild features or
introduced new concepts that replace KBuild concepts.

This is a breaking change for existing test infrastructure and build
scripts that are maintained out-of-tree. But for FW itself, no porting
should be necessary.

For users that just want to continue their work with minimal
disruption the following should suffice:

Install CMake 3.8.2+

Port any out-of-tree Makefiles to CMake.

Learn the absolute minimum about the new command line interface:

$ cd samples/hello_world
$ mkdir build && cd build
$ cmake -DBOARD=nrf52_pca10040 ..

$ cd build
$ make

PR: zephyrproject-rtos#4692
docs: http://docs.zephyrproject.org/getting_started/getting_started.html

Signed-off-by: Sebastian Boe <sebastian.boe@nordicsemi.no>
2017-11-08 20:00:22 -05:00