1# Non-volatile Storage NVS
2
3# Copyright (c) 2018 Laczen
4# SPDX-License-Identifier: Apache-2.0
5
6config NVS
7	bool "Non-volatile Storage"
8	depends on FLASH
9	select CRC
10	select FLASH_PAGE_LAYOUT
11	help
12	  Enable support of Non-volatile Storage.
13
14if NVS
15
16config NVS_LOOKUP_CACHE
17	bool "Non-volatile Storage lookup cache"
18	help
19	  Enable Non-volatile Storage cache, used to reduce the NVS data lookup
20	  time. Each cache entry holds an address of the most recent allocation
21	  table entry (ATE) for all NVS IDs that fall into that cache position.
22
23config NVS_LOOKUP_CACHE_SIZE
24	int "Non-volatile Storage lookup cache size"
25	default 128
26	range 1 65536
27	depends on NVS_LOOKUP_CACHE
28	help
29	  Number of entries in Non-volatile Storage lookup cache.
30	  It is recommended that it be a power of 2.
31
32config NVS_DATA_CRC
33	bool "Non-volatile Storage CRC protection on the data"
34	help
35	  Enable a CRC-32 on the data part of each NVS element.
36	  The ATE CRC is not impacted by this feature and stays the same.
37	  The CRC-32 is transparently stored at the end of the data field,
38	  in the NVS data section, so 4 more bytes are needed per NVS element.
39
40config NVS_INIT_BAD_MEMORY_REGION
41	bool "Non-volatile Storage bad memory region recovery"
42	help
43	  Enable automatic initialization of a NVS on a memory region that does
44	  not contain a valid NVS. A region containing an invalid NVS can be
45	  caused by corruption or by providing a non-empty region. This option
46	  ensures a new NVS can be created.
47
48module = NVS
49module-str = nvs
50source "subsys/logging/Kconfig.template.log_config"
51
52endif # NVS
53