1# Copyright (c) 2018 Nordic Semiconductor ASA 2# SPDX-License-Identifier: Apache-2.0 3 4menuconfig SETTINGS 5 bool "Settings" 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 13 14module = SETTINGS 15module-str = settings 16source "subsys/logging/Kconfig.template.log_config" 17 18config SETTINGS_RUNTIME 19 bool "runtime storage back-end" 20 help 21 Enables runtime storage back-end. 22 23config SETTINGS_DYNAMIC_HANDLERS 24 bool "dynamic settings handlers" 25 default y 26 help 27 Enables the use of dynamic settings handlers 28 29# Hidden option to enable encoding length into settings entry 30config SETTINGS_ENCODE_LEN 31 bool 32 33choice SETTINGS_BACKEND 34 prompt "Storage back-end" 35 default SETTINGS_ZMS if ZMS 36 default SETTINGS_NVS if NVS 37 default SETTINGS_FCB if FCB 38 default SETTINGS_FILE if FILE_SYSTEM 39 default SETTINGS_NONE 40 help 41 Storage back-end to be used by the settings subsystem. 42 43config SETTINGS_ZMS 44 bool "ZMS (Zephyr Memory Storage)" 45 depends on ZMS 46 select SYS_HASH_FUNC32 47 help 48 Use ZMS as settings storage backend. 49 50config SETTINGS_FCB 51 bool "FCB" 52 depends on FCB 53 help 54 Use FCB as a settings storage back-end. 55 56config SETTINGS_FILE 57 bool "File" 58 depends on FILE_SYSTEM 59 select SETTINGS_ENCODE_LEN 60 help 61 Use a file (on mounted file system) as a settings storage back-end. 62 63config SETTINGS_NVS 64 bool "NVS non-volatile storage support" 65 depends on NVS 66 depends on FLASH_MAP 67 help 68 Enables NVS storage support 69 70if SETTINGS_NVS 71 72config SETTINGS_NVS_NAME_CACHE 73 bool "NVS name lookup cache" 74 help 75 Enable NVS name lookup cache, used to reduce the Settings name 76 lookup time. 77 78config SETTINGS_NVS_NAME_CACHE_SIZE 79 int "NVS name lookup cache size" 80 default 128 81 range 1 $(UINT16_MAX) 82 depends on SETTINGS_NVS_NAME_CACHE 83 help 84 Number of entries in Settings NVS name cache. 85 86endif # SETTINGS_NVS 87 88config SETTINGS_CUSTOM 89 bool "CUSTOM" 90 help 91 Use a custom settings storage back-end. 92 93config SETTINGS_NONE 94 bool "NONE" 95 help 96 No storage back-end. 97endchoice 98 99config SETTINGS_FCB_NUM_AREAS 100 int "Number of flash areas used by the settings subsystem" 101 default 8 102 depends on SETTINGS_FCB 103 help 104 Number of areas to allocate in the settings FCB. A smaller number is 105 used if the flash hardware cannot support this value. 106 107config SETTINGS_FCB_MAGIC 108 hex "FCB magic for the settings subsystem" 109 default 0xc0ffeeee 110 depends on SETTINGS_FCB 111 help 112 Magic 32-bit word for to identify valid settings area 113 114config SETTINGS_FILE_PATH 115 string "Default settings file" 116 default "/settings/run" 117 depends on SETTINGS_FILE 118 help 119 Full path to the default settings file. 120 121config SETTINGS_FILE_MAX_LINES 122 int "Compression threshold" 123 default 32 124 depends on SETTINGS_FILE 125 help 126 Limit how many items stored in a file before compressing 127 128config SETTINGS_NVS_SECTOR_SIZE_MULT 129 int "Sector size of the NVS settings area" 130 default 1 131 depends on SETTINGS_NVS 132 help 133 The sector size to use for the NVS settings area as a multiple of 134 FLASH_ERASE_BLOCK_SIZE. 135 136config SETTINGS_NVS_SECTOR_COUNT 137 int "Sector count of the NVS settings area" 138 default 8 139 depends on SETTINGS_NVS 140 help 141 Number of sectors used for the NVS settings area 142 143config SETTINGS_ZMS_SECTOR_SIZE_MULT 144 int "Sector size of the ZMS settings area" 145 default 1 146 depends on SETTINGS_ZMS 147 help 148 The sector size to use for the ZMS settings area as a multiple of 149 FLASH_ERASE_BLOCK_SIZE. 150 151config SETTINGS_ZMS_CUSTOM_SECTOR_COUNT 152 bool "Customize the sector count of the ZMS settings partition" 153 depends on SETTINGS_ZMS 154 help 155 The number of sectors used by default is the maximum value that can 156 fit in the settings storage partition. 157 Enabling this config allows to customize the number of used sectors. 158 159config SETTINGS_ZMS_SECTOR_COUNT 160 int "Sector count of the ZMS settings area" 161 default 8 162 depends on SETTINGS_ZMS && SETTINGS_ZMS_CUSTOM_SECTOR_COUNT 163 help 164 Number of sectors used for the ZMS settings area 165 166config SETTINGS_ZMS_MAX_COLLISIONS_BITS 167 int "number of bits reserved to handle collisions between hash numbers" 168 default 4 169 depends on SETTINGS_ZMS 170 help 171 The maximum number of hash collisions needs to be well sized depending 172 on the data that is going to be stored in ZMS and its hash values 173 174config SETTINGS_SHELL 175 bool "Settings shell" 176 depends on SHELL 177 help 178 Enable shell commands for listing and reading the settings. Note that 179 reading the settings requires quite a big stack buffer, so the stack 180 size of the shell thread may need to be increased to accommodate this 181 feature. 182 183endif # SETTINGS 184