Kconfig 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. menu "LittleFS"
  2. config LITTLEFS_SDMMC_SUPPORT
  3. bool "SDMMC support (requires ESP-IDF v5+)"
  4. default n
  5. help
  6. Toggle SD card support
  7. This requires IDF v5+ as older ESP-IDF do not support SD card erase.
  8. config LITTLEFS_MAX_PARTITIONS
  9. int "Maximum Number of Partitions"
  10. default 3
  11. range 1 10
  12. help
  13. Define maximum number of partitions that can be mounted.
  14. config LITTLEFS_PAGE_SIZE
  15. int "LITTLEFS logical page size"
  16. default 256
  17. range 256 1024
  18. help
  19. Logical page size of LITTLEFS partition, in bytes. Must be multiple
  20. of flash page size (which is usually 256 bytes).
  21. Larger page sizes reduce overhead when storing large files, and
  22. improve filesystem performance when reading large files.
  23. Smaller page sizes reduce overhead when storing small (< page size)
  24. files.
  25. config LITTLEFS_OBJ_NAME_LEN
  26. int "Maximum object name length including NULL terminator."
  27. default 64
  28. range 16 1022
  29. help
  30. Includes NULL-terminator. If flashing a prebuilt filesystem image,
  31. rebuild the filesystem image if this value changes.
  32. mklittlefs, the tool that generates the image will automatically be rebuilt.
  33. If downloading a pre-built release of mklittlefs, it was most-likely
  34. built with LFS_NAME_MAX=32 and should not be used.
  35. config LITTLEFS_READ_SIZE
  36. int "Minimum size of a block read."
  37. default 128
  38. help
  39. Minimum size of a block read. All read operations will be a
  40. multiple of this value.
  41. config LITTLEFS_WRITE_SIZE
  42. int "Minimum size of a block write."
  43. default 128
  44. help
  45. Minimum size of a block program. All write operations will be a
  46. multiple of this value.
  47. config LITTLEFS_LOOKAHEAD_SIZE
  48. int "Look ahead size."
  49. default 128
  50. help
  51. Look ahead size. Must be a multiple of 8.
  52. config LITTLEFS_CACHE_SIZE
  53. int "Cache Size"
  54. default 512
  55. help
  56. Size of block caches. Each cache buffers a portion of a block in RAM.
  57. The littlefs needs a read cache, a program cache, and one additional
  58. cache per file. Larger caches can improve performance by storing more
  59. data and reducing the number of disk accesses. Must be a multiple of
  60. the read and program sizes, and a factor of the block size (4096).
  61. config LITTLEFS_BLOCK_CYCLES
  62. int "LittleFS wear-leveling block cycles"
  63. default 512
  64. range -1 1024
  65. help
  66. Number of erase cycles before littlefs evicts metadata logs and moves
  67. the metadata to another block. Suggested values are in the
  68. range 100-1000, with large values having better performance at the cost
  69. of less consistent wear distribution.
  70. Set to -1 to disable block-level wear-leveling.
  71. config LITTLEFS_USE_MTIME
  72. bool "Save file modification time"
  73. default "y"
  74. help
  75. Saves timestamp on modification. Uses an additional 4bytes.
  76. config LITTLEFS_USE_ONLY_HASH
  77. bool "Don't store filepath in the file descriptor"
  78. default "n"
  79. help
  80. Records the filepath only as a 32-bit hash in the file descriptor instead
  81. of the entire filepath. Saves approximately `sizeof(filepath)` bytes
  82. per file descriptor.
  83. If enabled, functionality (like fstat) that requires the file path
  84. from the file descriptor will not work.
  85. In rare cases, may cause unlinking or renaming issues (unlikely) if
  86. there's a hash collision between an open filepath and a filepath
  87. to be modified.
  88. config LITTLEFS_HUMAN_READABLE
  89. bool "Make errno human-readable"
  90. default "n"
  91. help
  92. Converts LittleFS error codes into human readable strings.
  93. May increase binary size depending on logging level.
  94. choice LITTLEFS_MTIME
  95. prompt "mtime attribute options"
  96. depends on LITTLEFS_USE_MTIME
  97. default LITTLEFS_MTIME_USE_SECONDS
  98. help
  99. Save an additional 4-byte attribute. Options listed below.
  100. config LITTLEFS_MTIME_USE_SECONDS
  101. bool "Use Seconds"
  102. help
  103. Saves timestamp on modification.
  104. config LITTLEFS_MTIME_USE_NONCE
  105. bool "Use Nonce"
  106. help
  107. Saves nonce on modification; intended for detecting filechanges
  108. on systems without access to a RTC.
  109. A file who's nonce is the same as it was at a previous time has
  110. high probability of not having been modified.
  111. Upon file modification, the nonce is incremented by one. Upon file
  112. creation, a random nonce is assigned.
  113. There is a very slim chance that a file will have the same nonce if
  114. it is deleted and created again (approx 1 in 4 billion).
  115. endchoice
  116. config LITTLEFS_SPIFFS_COMPAT
  117. bool "Improve SPIFFS drop-in compatability"
  118. default "n"
  119. help
  120. Enabling this feature allows for greater drop-in compatability
  121. when replacing SPIFFS. Since SPIFFS doesn't have folders, and
  122. folders are just considered as part of a file name, enabling this
  123. will automatically create folders as necessary to create a file
  124. instead of throwing an error. Similarly, upon the deletion of the
  125. last file in a folder, the folder will be deleted. It is recommended
  126. to only enable this flag as a stop-gap solution.
  127. config LITTLEFS_FLUSH_FILE_EVERY_WRITE
  128. bool "Flush file to flash after each write operation"
  129. default "n"
  130. help
  131. Enabling this feature extends SPIFFS capability.
  132. In SPIFFS data is written immediately to the flash storage when fflush() function called.
  133. In LittleFS flush() does not write data to the flash, and fsync() call needed after.
  134. With this feature fflush() will write data to the storage.
  135. config LITTLEFS_OPEN_DIR
  136. bool "Support opening directory"
  137. default "n"
  138. depends on !LITTLEFS_USE_ONLY_HASH && LITTLEFS_SPIFFS_COMPAT
  139. help
  140. Support opening directory by following APIs:
  141. int fd = open("my_directory", O_DIRECTORY);
  142. config LITTLEFS_FCNTL_GET_PATH
  143. bool "Support get file or directory path"
  144. default "n"
  145. depends on !LITTLEFS_USE_ONLY_HASH
  146. help
  147. Support getting directory by following APIs:
  148. char buffer[MAXPATHLEN];
  149. int fd = open("my_file", flags);
  150. fcntl(fd, F_GETPATH, buffer);
  151. config LITTLEFS_FCNTL_F_GETPATH_VALUE
  152. int "Value of command F_GETPATH"
  153. default 20
  154. depends on LITTLEFS_FCNTL_GET_PATH
  155. help
  156. ESP-IDF's header file "fcntl.h" doesn't support macro "F_GETPATH",
  157. so we should define this macro here.
  158. config LITTLEFS_MULTIVERSION
  159. bool "Support selecting the LittleFS minor version to write to disk"
  160. default "n"
  161. help
  162. LittleFS 2.6 bumps the on-disk minor version of littlefs from lfs2.0 -> lfs2.1.
  163. This change is backwards-compatible, but after the first write with the new version,
  164. the image on disk will no longer be mountable by older versions of littlefs.
  165. Enabling LITTLEFS_MULTIVERSION allows to select the On-disk version
  166. to use when writing in the form of 16-bit major version
  167. + 16-bit minor version. This limiting metadata to what is supported by
  168. older minor versions. Note that some features will be lost. Defaults to
  169. to the most recent minor version when zero.
  170. choice LITTLEFS_DISK_VERSION
  171. prompt "LITTLEFS_DISK_VERSION"
  172. depends on LITTLEFS_MULTIVERSION
  173. default LITTLEFS_DISK_VERSION_MOST_RECENT
  174. help
  175. See LITTLEFS_MULTIVERSION for details.
  176. config LITTLEFS_DISK_VERSION_MOST_RECENT
  177. bool "Write the most recent LittleFS version"
  178. config LITTLEFS_DISK_VERSION_2_1
  179. bool "Write LittleFS 2.1"
  180. config LITTLEFS_DISK_VERSION_2_0
  181. bool "Write LittleFS 2.0 (no forward-looking erase-state CRCs)"
  182. endchoice
  183. choice LITTLEFS_MALLOC_STRATEGY
  184. prompt "Buffer allocation strategy"
  185. default LITTLEFS_MALLOC_STRATEGY_DEFAULT
  186. help
  187. Maps lfs_malloc to ESP-IDF capabilities-based memory allocator or
  188. disables dynamic allocation in favour of user-provided static buffers.
  189. config LITTLEFS_MALLOC_STRATEGY_DISABLE
  190. bool "Static buffers only"
  191. help
  192. Disallow dynamic allocation, static buffers must be provided by the calling application.
  193. config LITTLEFS_MALLOC_STRATEGY_DEFAULT
  194. bool "Default heap selection"
  195. help
  196. Uses an automatic allocation strategy. On systems with heap in SPIRAM, if
  197. the allocation size does not exceed SPIRAM_MALLOC_ALWAYSINTERNAL then internal
  198. heap allocation if preferred, otherwise allocation will be attempted from SPIRAM
  199. heap.
  200. config LITTLEFS_MALLOC_STRATEGY_INTERNAL
  201. bool "Internal heap"
  202. help
  203. Uses ESP-IDF heap_caps_malloc to allocate from internal heap.
  204. config LITTLEFS_MALLOC_STRATEGY_SPIRAM
  205. bool "SPIRAM heap"
  206. depends on SPIRAM_USE_MALLOC && ESP32_SPIRAM_SUPPORT
  207. help
  208. Uses ESP-IDF heap_caps_malloc to allocate from SPIRAM heap.
  209. endchoice
  210. config LITTLEFS_ASSERTS
  211. bool "Enable asserts"
  212. default "y"
  213. help
  214. Selects whether littlefs performs runtime assert checks.
  215. endmenu