Go to file
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
.known-issues net: stats: Add traffic class statistics 2018-03-27 10:06:54 -04:00
arch arch: arc: explictly list all def config 2018-05-15 09:48:11 +02:00
boards boards: em_starterkit: add pmod mux init 2018-05-15 09:48:11 +02:00
cmake arch: arc: refactor the soc part of em_starterkit 2018-05-15 09:48:11 +02:00
doc subsys: fs: Add Non Volatile Storage (NVS) for zephyr 2018-05-15 10:29:16 +02:00
drivers dts: optimize and bug fixes the dts of em_starterkit 2018-05-15 09:48:11 +02:00
dts dts: optimize and bug fixes the dts of em_starterkit 2018-05-15 09:48:11 +02:00
ext drivers: watchdog: Add shim for nrfx WDT driver 2018-05-14 10:28:23 -05:00
include subsys: fs: Add Non Volatile Storage (NVS) for zephyr 2018-05-15 10:29:16 +02:00
kernel newlib: fix heap user mode access for MPU devices 2018-05-10 15:09:02 -07:00
lib newlib: fix heap user mode access for MPU devices 2018-05-10 15:09:02 -07:00
misc kconfig: Move CPLUSPLUS from root to "Compiler Options" 2018-04-30 13:12:01 -04:00
samples subsys: fs: Add Non Volatile Storage (NVS) for zephyr 2018-05-15 10:29:16 +02:00
scripts menuconfig: Make search more flexible and search prompts 2018-05-11 16:44:47 -04:00
subsys subsys: fs: Add Non Volatile Storage (NVS) for zephyr 2018-05-15 10:29:16 +02:00
tests Bluetooth: GATT: Make BT_GATT_CHARACTERISTIC declare its value 2018-05-14 18:51:22 +03:00
.checkpatch.conf checkpatch: define typedefsfile to deal with a few false positives 2017-10-09 10:43:05 -04:00
.codecov.yml ci: add .codecov.yml for codecov.io configuration 2018-01-03 13:12:03 -05:00
.gitattributes
.gitignore kconfig: Remove the C Kconfig implementation 2018-05-07 21:53:37 +02:00
.gitlint gitlint: use custom rule for line length violations 2018-02-07 15:28:36 -05:00
.mailmap
.shippable.yml ci: Clean the capability cache when the ccache is cleaned 2018-05-14 13:47:09 -04:00
.uncrustify.cfg scripts: cleanup scripts directory 2018-04-03 09:28:09 -04:00
CMakeLists.txt makefile: Fix dependencies for privileged stacks 2018-05-02 10:59:40 -04:00
CODEOWNERS CODEOWNERS: Add pfalcon for various net directories 2018-05-11 07:39:18 -07:00
CONTRIBUTING.rst doc: change https://zephyrproject.org/doc refs 2018-05-02 18:32:44 -04:00
Kconfig
Kconfig.zephyr kconfig: Make 'source' non-globbing and use 'gsource' 2018-05-08 11:14:12 +02:00
LICENSE
Makefile build: add top-level Makefile for docs 2017-11-08 20:00:22 -05:00
README.rst doc: fix references to mailing lists 2018-05-09 21:10:52 -05:00
VERSION release: Post-release patch level update 2018-03-09 20:18:38 -05:00
version.h.in Introduce cmake-based rewrite of KBuild 2017-11-08 20:00:22 -05:00
zephyr-env.cmd build: doc: Add support for a Windows equivalent to .zephyrrc 2018-03-29 10:35:19 -04:00
zephyr-env.sh env: Remove usage of -P in grep 2017-07-15 11:12:35 -07:00

Zephyr Project
##############

.. raw:: html

   <a href="https://bestpractices.coreinfrastructure.org/projects/74"><img
   src="https://bestpractices.coreinfrastructure.org/projects/74/badge"></a>
   <img
   src="https://api.shippable.com/projects/58ffb2b8baa5e307002e1d79/badge?branch=master">


The Zephyr Project is a scalable real-time operating system (RTOS) supporting
multiple hardware architectures, optimized for resource constrained devices,
and built with security in mind.

The Zephyr OS is based on a small-footprint kernel designed for use on
resource-constrained systems: from simple embedded environmental sensors and
LED wearables to sophisticated smart watches and IoT wireless gateways.

The Zephyr kernel supports multiple architectures, including ARM Cortex-M,
Intel x86, ARC, NIOS II, Tensilica Xtensa, and RISC V, and a large number of
`supported boards`_.

.. below included in doc/introduction/introduction.rst

.. start_include_here

Community Support
*****************

The Zephyr Project Developer Community includes developers from member
organizations and the general community all joining in the development of
software within the Zephyr Project. Members contribute and discuss ideas,
submit bugs and bug fixes, and provide training. They also help those in need
through the community's forums such as mailing lists and IRC channels. Anyone
can join the developer community and the community is always willing to help
its members and the User Community to get the most out of the Zephyr Project.

Welcome to the Zephyr community!

Resources
*********

Here's a quick summary of resources to find your way around the Zephyr Project
support systems:

* **Zephyr Project Website**: The https://zephyrproject.org website is the
  central source of information about the Zephyr Project. On this site, you'll
  find background and current information about the project as well as all the
  relevant links to project material.  For a quick start, refer to the
  `Zephyr Introduction`_ and `Getting Started Guide`_.

* **Releases**: Source code for Zephyr kernel releases are available at
  https://zephyrproject.org/developers/#downloads. On this page,
  you'll find release information, and links to download or clone source
  code from our GitHub repository.  You'll also find links for the Zephyr
  SDK, a moderated collection of tools and libraries used to develop your
  applications.

* **Source Code in GitHub**: Zephyr Project source code is maintained on a
  public GitHub repository at https://github.com/zephyrproject-rtos/zephyr.
  You'll find information about getting access to the repository and how to
  contribute to the project in this `Contribution Guide`_ document.

* **Samples Code**: In addition to the kernel source code, there are also
  many documented `Sample and Demo Code Examples`_ that can help show you
  how to use Zephyr services and subsystems.

* **Documentation**: Extensive Project technical documentation is developed
  along with the Zephyr kernel itself, and can be found at
  http://docs.zephyrproject.org.  Additional documentation is maintained in
  the `Zephyr GitHub wiki`_.

* **Cross-reference**: Source code cross-reference for the Zephyr
  kernel and samples code is available at
  https://elixir.bootlin.com/zephyr/latest/source.

* **Issue Reporting and Tracking**: Requirements and Issue tracking is done in
  the Github issues system: https://github.com/zephyrproject-rtos/zephyr/issues.
  You can browse through the reported issues and submit issues of your own.

* **Security-related Issue Reporting and Tracking**: For security-related
  inquiries or reporting suspected security-related bugs in the Zephyr OS,
  please send email to vulnerabilities@zephyrproject.org.  We will assess and
  fix flaws according to our security policy outlined in the Zephyr Project
  `Security Overview`_.

  Security related issue tracking is done in JIRA.  The location of this JIRA
  is https://zephyrprojectsec.atlassian.net.

* **Mailing List**: The `Zephyr Development mailing list`_ is perhaps the most convenient
  way to track developer discussions and to ask your own support questions to
  the Zephyr project community.  There are also specific `Zephyr mailing list
  subgroups`_ for announcements, builds, marketing, and Technical
  Steering Committe notes, for example.
  You can read through the message archives to follow
  past posts and discussions, a good thing to do to discover more about the
  Zephyr project.

* **IRC Chatting**: You can chat online with the Zephyr project developer
  community and other users in our IRC channel #zephyrproject on the
  freenode.net IRC server. You can use the http://webchat.freenode.net web
  client or use a client-side application such as pidgin.


.. _supported boards: http://docs.zephyrproject.org/boards/boards.html
.. _Zephyr Introduction: http://docs.zephyrproject.org/introduction/introducing_zephyr.html
.. _Getting Started Guide: http://docs.zephyrproject.org/getting_started/getting_started.html
.. _Contribution Guide: http://docs.zephyrproject.org/contribute/contribute_guidelines.html
.. _Zephyr GitHub wiki: https://github.com/zephyrproject-rtos/zephyr/wiki
.. _Zephyr Development mailing list: https://lists.zephyrproject.org/g/devel
.. _Zephyr mailing list subgroups: https://lists.zephyrproject.org/g/main/subgroups
.. _Sample and Demo Code Examples: http://docs.zephyrproject.org/samples/samples.html
.. _Security Overview: http://docs.zephyrproject.org/security/security-overview.html