2018-02-02 21:30:56 +08:00
|
|
|
# Copyright (c) 2018 Nordic Semiconductor ASA
|
|
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
|
|
|
menuconfig SETTINGS
|
2020-08-23 00:59:45 +08:00
|
|
|
bool "Settings"
|
2018-02-02 21:30:56 +08:00
|
|
|
help
|
|
|
|
The settings subsystem allows its users to serialize and
|
|
|
|
deserialize state in memory into and from non-volatile memory.
|
|
|
|
It supports several back-ends to store and load serialized data from
|
|
|
|
and it can do so atomically for all involved modules.
|
|
|
|
|
2019-03-06 22:25:00 +08:00
|
|
|
if SETTINGS
|
|
|
|
module = SETTINGS
|
|
|
|
module-str = settings
|
|
|
|
source "subsys/logging/Kconfig.template.log_config"
|
|
|
|
endif
|
|
|
|
|
2019-04-02 17:06:05 +08:00
|
|
|
config SETTINGS_RUNTIME
|
|
|
|
bool "runtime storage back-end"
|
|
|
|
depends on SETTINGS
|
|
|
|
help
|
|
|
|
Enables runtime storage back-end.
|
|
|
|
|
2019-06-18 21:16:26 +08:00
|
|
|
config SETTINGS_DYNAMIC_HANDLERS
|
|
|
|
bool "dynamic settings handlers"
|
|
|
|
depends on SETTINGS
|
|
|
|
default y
|
|
|
|
help
|
|
|
|
Enables the use of dynamic settings handlers
|
|
|
|
|
2018-05-15 20:25:29 +08:00
|
|
|
# Hidden option to enable encoding length into settings entry
|
|
|
|
config SETTINGS_ENCODE_LEN
|
|
|
|
depends on SETTINGS
|
|
|
|
bool
|
|
|
|
|
2018-02-02 21:30:56 +08:00
|
|
|
choice
|
|
|
|
prompt "Storage back-end"
|
2019-10-08 18:18:46 +08:00
|
|
|
default SETTINGS_NVS if NVS
|
2018-02-02 21:30:56 +08:00
|
|
|
default SETTINGS_FCB if FCB
|
2019-10-08 18:18:46 +08:00
|
|
|
default SETTINGS_FS if FILE_SYSTEM
|
2019-04-02 17:06:05 +08:00
|
|
|
default SETTINGS_NONE
|
2018-02-02 21:30:56 +08:00
|
|
|
depends on SETTINGS
|
|
|
|
help
|
|
|
|
Storage back-end to be used by the settings subsystem.
|
|
|
|
|
|
|
|
config SETTINGS_FCB
|
|
|
|
bool "FCB"
|
|
|
|
depends on FCB
|
|
|
|
help
|
|
|
|
Use FCB as a settings storage back-end.
|
|
|
|
|
|
|
|
config SETTINGS_FS
|
|
|
|
bool "File System"
|
|
|
|
depends on FILE_SYSTEM
|
2018-05-15 20:25:29 +08:00
|
|
|
select SETTINGS_ENCODE_LEN
|
2018-02-02 21:30:56 +08:00
|
|
|
help
|
|
|
|
Use a file system as a settings storage back-end.
|
2019-04-02 17:06:05 +08:00
|
|
|
|
2019-06-24 17:10:18 +08:00
|
|
|
config SETTINGS_NVS
|
|
|
|
bool "NVS non-volatile storage support"
|
2019-10-10 18:17:46 +08:00
|
|
|
depends on NVS
|
|
|
|
depends on FLASH_MAP
|
2019-06-24 17:10:18 +08:00
|
|
|
help
|
|
|
|
Enables NVS storage support
|
|
|
|
|
2019-04-02 17:06:05 +08:00
|
|
|
config SETTINGS_CUSTOM
|
|
|
|
bool "CUSTOM"
|
|
|
|
help
|
|
|
|
Use a custom settings storage back-end.
|
|
|
|
|
|
|
|
config SETTINGS_NONE
|
|
|
|
bool "NONE"
|
|
|
|
help
|
|
|
|
No storage back-end.
|
2018-02-02 21:30:56 +08:00
|
|
|
endchoice
|
|
|
|
|
|
|
|
config SETTINGS_FCB_NUM_AREAS
|
2018-07-12 19:26:29 +08:00
|
|
|
int "Number of flash areas used by the settings subsystem"
|
2018-02-02 21:30:56 +08:00
|
|
|
default 8
|
|
|
|
depends on SETTINGS && SETTINGS_FCB
|
|
|
|
help
|
|
|
|
Number of areas to allocate in the settings FCB. A smaller number is
|
|
|
|
used if the flash hardware cannot support this value.
|
|
|
|
|
|
|
|
config SETTINGS_FCB_MAGIC
|
2018-07-12 19:26:29 +08:00
|
|
|
hex "FCB magic for the settings subsystem"
|
2018-02-02 21:30:56 +08:00
|
|
|
default 0xc0ffeeee
|
|
|
|
depends on SETTINGS && SETTINGS_FCB
|
|
|
|
help
|
|
|
|
Magic 32-bit word for to identify valid settings area
|
|
|
|
|
|
|
|
config SETTINGS_FS_DIR
|
2018-07-12 19:26:29 +08:00
|
|
|
string "Serialization directory"
|
2018-02-02 21:30:56 +08:00
|
|
|
default "/settings"
|
|
|
|
depends on SETTINGS && SETTINGS_FS
|
|
|
|
help
|
|
|
|
Directory where the settings data is stored
|
|
|
|
|
|
|
|
config SETTINGS_FS_FILE
|
2018-07-12 19:26:29 +08:00
|
|
|
string "Default settings file"
|
2018-02-02 21:30:56 +08:00
|
|
|
default "/settings/run"
|
|
|
|
depends on SETTINGS && SETTINGS_FS
|
|
|
|
help
|
|
|
|
Full path to the default settings file.
|
|
|
|
|
|
|
|
config SETTINGS_FS_MAX_LINES
|
2018-07-12 19:26:29 +08:00
|
|
|
int "Compression threshold"
|
2018-02-02 21:30:56 +08:00
|
|
|
default 32
|
|
|
|
depends on SETTINGS && SETTINGS_FS
|
|
|
|
help
|
2018-07-12 19:26:29 +08:00
|
|
|
Limit how many items stored in a file before compressing
|
2019-06-24 17:10:18 +08:00
|
|
|
|
|
|
|
config SETTINGS_NVS_SECTOR_SIZE_MULT
|
|
|
|
int "Sector size of the NVS settings area"
|
|
|
|
default 1
|
|
|
|
depends on SETTINGS && SETTINGS_NVS
|
|
|
|
help
|
|
|
|
The sector size to use for the NVS settings area as a multiple of
|
|
|
|
FLASH_ERASE_BLOCK_SIZE.
|
|
|
|
|
|
|
|
config SETTINGS_NVS_SECTOR_COUNT
|
|
|
|
int "Sector count of the NVS settings area"
|
|
|
|
default 8
|
|
|
|
depends on SETTINGS && SETTINGS_NVS
|
|
|
|
help
|
|
|
|
Number of sectors used for the NVS settings area
|