From 42c09c99e94b7133db17c27e753c712e9f1e257c Mon Sep 17 00:00:00 2001 From: Andrzej Puzdrowski Date: Fri, 17 Jan 2020 12:45:48 +0100 Subject: [PATCH] samples/subsys/settings: add the readme doc Added readme file for the sample Signed-off-by: Andrzej Puzdrowski --- doc/reference/runtime_conf/index.rst | 3 + samples/subsys/settings/README.rst | 100 +++++++++++++++++++++++++++ 2 files changed, 103 insertions(+) create mode 100644 samples/subsys/settings/README.rst diff --git a/doc/reference/runtime_conf/index.rst b/doc/reference/runtime_conf/index.rst index 586e2436d80..1a68eefc21d 100644 --- a/doc/reference/runtime_conf/index.rst +++ b/doc/reference/runtime_conf/index.rst @@ -15,6 +15,9 @@ storage medium, and even change it later as needs change. The runtime configuration system is used by various Zephyr components and can be used simultaneously by user applications. +For an example of the settings module refer to +:ref:`the sample `. + .. toctree:: :maxdepth: 1 diff --git a/samples/subsys/settings/README.rst b/samples/subsys/settings/README.rst new file mode 100644 index 00000000000..2f8ece89f64 --- /dev/null +++ b/samples/subsys/settings/README.rst @@ -0,0 +1,100 @@ +.. _settings_subsys_sample: + +Settings sample +############### + +Overview +******** + +This is a simple application demonstrating use of the settings runtime +configuration module. In this application some configuration values are loaded +form persistient storage and exported to persistent storage using different +settings method. The example shows how to implement module handlers, how to +register them. + +Requirements +************ + +* A board with settings support, for instance: nrf52840_pca10056 +* Or qemu_x86 target + +Building and Running +******************** + +This sample can be found under :zephyr_file:`samples/subsys/settings` in +the Zephyr tree. + +The sample can be build for several platforms, the following commands build the +application for the qemu_x86. + +.. zephyr-app-commands:: + :zephyr-app: samples/subsys/settings + :board: qemu_x86 + :goals: build flash + :compact: + +After running the image to the board the output on the console shows the +settings manipulation messages. + +Sample Output +============= + +.. code-block:: console + + ***** Booting Zephyr OS build v2.1.0-rc1-123-g41091eb1d5e0 ***** + + *** Settings usage example *** + + settings subsys initialization: OK. + subtree handler registered: OK + subtree has static handler + + ############## + # iteration 0 + ############## + + ================================================= + basic load and save using registered handlers + + load all key-value pairs using registered handlers + loading all settings under handler is done + loading all settings under handler is done + + save key directly: OK. + + load key-value pairs using registered handlers + = -3025 + loading all settings under handler is done + + save all key-value pairs using registered handlers + export keys under handler + export keys under handler + + load all key-value pairs using registered handlers + export keys under handler + export keys under handler + + ================================================= + loading subtree to destination provided by the caller + + direct load: + direct load: + direct load: + direct.length = 100 + direct.length_1 = 41 + direct.length_2 = 59 + + ================================================= + Delete a key-value pair + + immediate load: OK. + value exist in the storage + delete : OK. + Can't to load the value as expected + + ================================================= + Service a key-value pair without dedicated handlers + + = 0 (default) + save key directly: OK. + ...