Subsys: settings
Overview
This sample demonstrates how to use the atm_settings related functions to load tag data (key-value pairs) from the factory data and settings storage partitions , and to save tag data (key-value pairs) to the settings storage partition.
Requirements
Atmosic EVK <board | serial>
Note
This sample relies on building the settings subsystem with
CONFIG_SETTINGS=y
CONFIG_ATM_SETTINGS=y
which will compile the settings and atm_settings related functions for the application to access factory data and settings storage.
Building and Running
This sample is built from openair/samples/subsys/settings
.
Build command:
west build -p always -b <BOARD>//ns openair/samples/subsys/settings --sysbuild -T samples.subsys.settings.atm
Flash command:
west flash --skip-rebuild --verify --device <DEVICE_ID> [--jlink] --fast_load [--erase_flash]
Note
Before running this sample, the factory data and settings storage binary files must be programmed. When using sysbuild, these binary files are automatically generated by the Atmosic Zephyr Settings Generator Tool <ZSG Tool> based on the YAML files in the tag_data folder. Using west flash will also automatically program these binary files.
Sample Output
When the device boots up, the console output shows:
load FACTORY/COMPANY_ID key: 0xa24
load FACTORY/SERIAL_NUMBER key: 0x12345678
load SETTINGS/VERSION key: 1.23
save SETTINGS/TEST_KEY key: 0x5aa50ff0
load SETTINGS/TEST_KEY key: 0x5aa50ff0
save SETTINGS/TEST_KEY key: 0xa55af00f
load SETTINGS/TEST_KEY key: 0xa55af00f