@@ -12,14 +12,48 @@ if APP_STORAGE
1212
1313config APP_STORAGE_THREAD_STACK_SIZE
1414 int "Storage module thread stack size"
15- default 1536
15+ default 1720 if APP_STORAGE_BACKEND_RAM
16+ default 3000 if APP_STORAGE_BACKEND_LITTLEFS
17+
18+ choice APP_STORAGE_BACKEND
19+ prompt "Storage backend"
20+ default APP_STORAGE_BACKEND_RAM
21+ help
22+ Select the storage backend to use for storing data samples.
1623
1724config APP_STORAGE_BACKEND_RAM
1825 bool "RAM storage backend"
19- default y
2026 help
2127 Store data in RAM. Data will be lost on power loss or reset.
2228
29+ config APP_STORAGE_BACKEND_LITTLEFS
30+ bool "LittleFS storage backend"
31+ select FILE_SYSTEM
32+ select FILE_SYSTEM_LITTLEFS
33+ help
34+ Store data in LittleFS filesystem. Data will persist across power
35+ loss and resets, as long as the underlying flash storage is intact.
36+
37+ endchoice # APP_STORAGE_BACKEND
38+
39+ if APP_STORAGE_BACKEND_LITTLEFS
40+
41+ # Setup PM partition size for LittleFS to 64KB by default
42+ config PM_PARTITION_SIZE_LITTLEFS
43+ default 0x10000
44+
45+ config PM_PARTITION_REGION_LITTLEFS_EXTERNAL
46+ default y if PM_EXTERNAL_FLASH_ENABLED
47+
48+ config APP_STORAGE_LITTLEFS_MAX_PATH_LEN
49+ int "Maximum length of storage file names"
50+ default 64
51+ help
52+ Maximum length of file names used by the storage module
53+ in the LittleFS backend.
54+
55+ endif # APP_STORAGE_BACKEND_LITTLEFS
56+
2357config APP_STORAGE_MAX_TYPES
2458 int "Maximum number of data types"
2559 default 4
@@ -97,6 +131,7 @@ endchoice
97131config APP_STORAGE_SHELL
98132 bool "Enable storage shell commands"
99133 default y if SHELL
134+ select FILE_SYSTEM_SHELL if APP_STORAGE_BACKEND_LITTLEFS
100135 help
101136 Enable shell commands for interacting with the storage module.
102137 This allows you to manage stored data from the command line.
0 commit comments