1# Copyright (c) 2018 Nordic Semiconductor ASA
2# SPDX-License-Identifier: Apache-2.0
3
4menuconfig SETTINGS
5	bool "Enable settings subsystem with non-volatile storage"
6	help
7	  The settings subsystem allows its users to serialize and
8	  deserialize state in memory into and from non-volatile memory.
9	  It supports several back-ends to store and load serialized data from
10	  and it can do so atomically for all involved modules.
11
12if SETTINGS
13module = SETTINGS
14module-str = settings
15source "subsys/logging/Kconfig.template.log_config"
16endif
17
18config SETTINGS_RUNTIME
19	bool "runtime storage back-end"
20	depends on SETTINGS
21	help
22	  Enables runtime storage back-end.
23
24config SETTINGS_DYNAMIC_HANDLERS
25	bool "dynamic settings handlers"
26	depends on SETTINGS
27	default y
28	help
29	  Enables the use of dynamic settings handlers
30
31# Hidden option to enable encoding length into settings entry
32config SETTINGS_ENCODE_LEN
33	depends on SETTINGS
34	bool
35
36config SETTINGS_USE_BASE64
37	bool "encoding value using base64 (deprecated)"
38	depends on SETTINGS
39	select BASE64
40	help
41	  This option has been deprecated and will not be supported
42	  in future releases.
43	  Enables values encoding using Base64.
44
45choice
46	prompt "Storage back-end"
47	default SETTINGS_NVS if NVS
48	default SETTINGS_FCB if FCB
49	default SETTINGS_FS if FILE_SYSTEM
50	default SETTINGS_NONE
51	depends on SETTINGS
52	help
53	  Storage back-end to be used by the settings subsystem.
54
55config SETTINGS_FCB
56	bool "FCB"
57	depends on FCB
58	help
59	  Use FCB as a settings storage back-end.
60
61config SETTINGS_FS
62	bool "File System"
63	depends on FILE_SYSTEM
64	select SETTINGS_ENCODE_LEN
65	help
66	  Use a file system as a settings storage back-end.
67
68config SETTINGS_NVS
69	bool "NVS non-volatile storage support"
70	depends on NVS
71	depends on FLASH_MAP
72	help
73	  Enables NVS storage support
74
75config SETTINGS_CUSTOM
76	bool "CUSTOM"
77	help
78	  Use a custom settings storage back-end.
79
80config SETTINGS_NONE
81	bool "NONE"
82	help
83	  No storage back-end.
84endchoice
85
86config SETTINGS_FCB_NUM_AREAS
87	int "Number of flash areas used by the settings subsystem"
88	default 8
89	depends on SETTINGS && SETTINGS_FCB
90	help
91	  Number of areas to allocate in the settings FCB. A smaller number is
92	  used if the flash hardware cannot support this value.
93
94config SETTINGS_FCB_MAGIC
95	hex "FCB magic for the settings subsystem"
96	default 0xc0ffeeee
97	depends on SETTINGS && SETTINGS_FCB
98	help
99	  Magic 32-bit word for to identify valid settings area
100
101config SETTINGS_FS_DIR
102	string "Serialization directory"
103	default "/settings"
104	depends on SETTINGS && SETTINGS_FS
105	help
106	  Directory where the settings data is stored
107
108config SETTINGS_FS_FILE
109	string "Default settings file"
110	default "/settings/run"
111	depends on SETTINGS && SETTINGS_FS
112	help
113	  Full path to the default settings file.
114
115config SETTINGS_FS_MAX_LINES
116	int "Compression threshold"
117	default 32
118	depends on SETTINGS && SETTINGS_FS
119	help
120	  Limit how many items stored in a file before compressing
121
122config SETTINGS_NVS_SECTOR_SIZE_MULT
123	int "Sector size of the NVS settings area"
124	default 1
125	depends on SETTINGS && SETTINGS_NVS
126	help
127	  The sector size to use for the NVS settings area as a multiple of
128	  FLASH_ERASE_BLOCK_SIZE.
129
130config SETTINGS_NVS_SECTOR_COUNT
131	int "Sector count of the NVS settings area"
132	default 8
133	depends on SETTINGS && SETTINGS_NVS
134	help
135	  Number of sectors used for the NVS settings area
136