fs/fat: Improve help of Kconfig options for FAT

The commit fixes usage of old identifiers, from ELM FAT module,
and adds additional information on how certain options affect
FAT operation in Zephyr.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
Dominik Ermel 2022-11-17 12:34:35 +00:00 committed by Carles Cufí
commit 5f4664dabe

View file

@ -17,21 +17,18 @@ menu "ELM FAT file system settings"
config FS_FATFS_READ_ONLY config FS_FATFS_READ_ONLY
bool "Read-only support for all volumes" bool "Read-only support for all volumes"
help help
The option excludes write code from ELM FAT file system driver; Excludes write code from ELM FAT file system driver.
when selected, it no longer will be possible to write data on Select this when using FAT for read-only access to slightly
the FAT FS. reduce code size.
If write support is not needed, enabling this flag will slightly This option affects FF_FS_READONLY defined in ffconf.h, inside
reduce application size. ELM FAT module.
This option translates to _FS_READONLY within ELM FAT file system
driver; it enables exclusion, from compilation, of write supporting
code.
config FS_FATFS_MKFS config FS_FATFS_MKFS
bool bool
help help
This option translates to _USE_MKFS within ELM FAT file system Adds code for creating disks with FAT file system.
driver; it enables additional code that is required for formatting This option affects FF_USE_MKFS defined in ffconf.h, inside
volumes to ELM FAT. ELM FAT module.
config FS_FATFS_MOUNT_MKFS config FS_FATFS_MOUNT_MKFS
bool "Allow formatting volume when mounting fails" bool "Allow formatting volume when mounting fails"
@ -42,6 +39,13 @@ config FS_FATFS_MOUNT_MKFS
a volume if no file system is found. a volume if no file system is found.
If formatting is not needed, disabling this flag will slightly If formatting is not needed, disabling this flag will slightly
reduce application size. reduce application size.
Note: This option is destructive to data and will automatically
destroy your disk, if mount attempt fails. In case when your
disk can be detached from a device and recovered using other
system, it may be worth disabling this option.
When this option is disabled, disk needs to be FAT formatted
prior to connecting to a device, otherwise it will not be
mountable.
if FS_FATFS_MOUNT_MKFS if FS_FATFS_MOUNT_MKFS
@ -65,10 +69,22 @@ config FS_FATFS_EXFAT
config FS_FATFS_NUM_FILES config FS_FATFS_NUM_FILES
int "Maximum number of opened files" int "Maximum number of opened files"
default 4 default 4
help
Affects how many file objects area available for parallel
use by FAT driver. Each object is of size sizeof(FIL), where
FIL is defined in ff.h of ELM FAT driver, and is pre-allocated
at compile-time.
This affects use of fs_open on FAT type mounted file systems.
config FS_FATFS_NUM_DIRS config FS_FATFS_NUM_DIRS
int "Maximum number of opened directories" int "Maximum number of opened directories"
default 4 default 4
help
Affects how many directory objects area available for parallel
use by FAT driver. Each object is of size sizeof(DIR), where
DIR is defined in ff.h of ELM FAT driver, and is pre-allocated
at compile-time.
This affects use of fs_opendir on FAT type mounted file systems.
config FS_FATFS_LFN config FS_FATFS_LFN
bool "Long filenames (LFN)" bool "Long filenames (LFN)"
@ -86,16 +102,23 @@ config FS_FATFS_LFN_MODE_BSS
bool "Static buffer" bool "Static buffer"
help help
Enable LFN with static working buffer on the BSS. Always NOT thread-safe. Enable LFN with static working buffer on the BSS. Always NOT thread-safe.
This option affects FF_USE_LFN defined in ffconf.h, inside
ELM FAT module, by setting its value to 1.
config FS_FATFS_LFN_MODE_STACK config FS_FATFS_LFN_MODE_STACK
bool "Stack buffer" bool "Stack buffer"
help help
Enable LFN with dynamic working buffer on the STACK. Enable LFN with dynamic working buffer on the STACK.
This option affects FF_USE_LFN defined in ffconf.h, inside
ELM FAT module, by setting its value to 2.
config FS_FATFS_LFN_MODE_HEAP config FS_FATFS_LFN_MODE_HEAP
bool "Heap buffer" bool "Heap buffer"
depends on HEAP_MEM_POOL_SIZE > 0
help help
Enable LFN with dynamic working buffer on the HEAP. Enable LFN with dynamic working buffer on the HEAP.
This option affects FF_USE_LFN defined in ffconf.h, inside
ELM FAT module, by setting its value to 3.
endchoice endchoice
@ -136,11 +159,30 @@ config FS_FATFS_CODEPAGE
936 - Simplified Chinese (DBCS) 936 - Simplified Chinese (DBCS)
949 - Korean (DBCS) 949 - Korean (DBCS)
950 - Traditional Chinese (DBCS) 950 - Traditional Chinese (DBCS)
0 - Include all supported code pages
This option affects FF_CODE_PAGE defined in ffconf.h, inside
ELM FAT module.
config FS_FATFS_MAX_SS config FS_FATFS_MAX_SS
int "Maximum supported sector size" int "Maximum supported sector size"
range 512 4096 range 512 4096
default 512 default 512
help
Value set here will be used as maximum supported read/write
sector size, with 512 being minimum value.
Option affects write/read granularity and will increase
size of buffers used by FAT driver, which in practice affects
how much RAM each FATFS object, used with FAT mount point,
requires, which is this value plus some constant amount,
independent from this setting.
This will affect your compile time RAM allocation, when
mount point is defined as static/global life time variable,
or stack.
When this value is set to 512, all mount points will use
512 as sector size, all other values will cause FAT driver
to query device for sector size on mount.
This option affects FF_MAX_SS defined in ffconf.h, inside
ELM FAT module.
config FS_FATFS_MIN_SS config FS_FATFS_MIN_SS
int "Minimum expected sector size" int "Minimum expected sector size"
@ -153,8 +195,8 @@ config FS_FATFS_MIN_SS
sector size, to have slight reduction in code in FAT FS driver. sector size, to have slight reduction in code in FAT FS driver.
The reduction comes from the fact that FAT FS does not have to The reduction comes from the fact that FAT FS does not have to
query every connected device for sector size. query every connected device for sector size.
This option affects FF_MAX_SS defined in ffconf.h, inside This option affects FF_MIN_SS defined in ffconf.h, inside
ELM FAT module ELM FAT module.
config FS_FATFS_WINDOW_ALIGNMENT config FS_FATFS_WINDOW_ALIGNMENT
int "Memory alignment for the member \"win\" in FATFS" int "Memory alignment for the member \"win\" in FATFS"
@ -167,7 +209,7 @@ config FS_FATFS_WINDOW_ALIGNMENT
provided here is used as such alignment. Note that the window provided here is used as such alignment. Note that the window
buffer is internal element of FATFS structure, which means buffer is internal element of FATFS structure, which means
that, in worst scenario, value provided here may cause FATFS that, in worst scenario, value provided here may cause FATFS
structure to have size of twice the value structure to have size of twice the value.
endmenu endmenu