This option switches support for multiple volumes on the physical drive. By
default (0), each logical drive number is bound to the same physical drive
number and only a first FAT volume found on the physical drive will be
mounted.
When this function is enabled (1), each logical drive number can be bound
to arbitrary physical drive and partition listed in the VolToPart[].
The VolToPart[] is expected to be provided by Zephyr application.
For example, 2 FAT partition on SD disk ("SD" index 3) in terms of Zephyr:
{3, 1} - mount point "/0:"
{3, 2} - mount point "/1:"
The mount points have to be numbered in this case.
Code example of mounting a second FATFS partition places on SD-card:
static FATFS fat_fs;
static struct fs_mount_t mp = {
.type = FS_FATFS,
.fs_data = &fat_fs,
.mnt_point = "/1:
};
/*
* 2 FAT partition on SD disk
* PARTITION.pd - Physical drive number. "SD" has index 3 in terms of
* Zephyr (see FF_VOLUME_STRS)
* PARTITION.pt - Partition (0:Auto detect, 1-4:Forced partition). So 1 for
* the first FATFS partition and 2 - for second.
*/
PARTITION VolToPart[FF_VOLUMES] = {
[0] = {3, 1}, /* "0:" ==> 1st partition on the pd#0 */
[1] = {3, 2}, /* "1:" ==> 2nd partition on the pd#0 */
[2] = {0, -1}, /* "2:" ==> 3rd partition on the pd#0 */
[3] = {0, -1},
[4] = {0, -1},
[5] = {0, -1},
[6] = {0, -1},
[7] = {0, -1},
};
fs_mount(&mp);
Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
The Kconfig option enables support for 64-bit LBA, which also allows
to enable GUID Partition Table (GPT) support.
Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>
Make call to de-initialize disk in fatfs_unmount(). This will permit the
disk to be reinitialized when it is mounted with fatfs_mount().
Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
Adds a missing include to avoid these warnings :
- zephyr/modules/fatfs/zfs_ffsystem.c:19:16: warning: implicit declaration
of function 'k_malloc'; did you mean 'ff_memalloc'?
[-Wimplicit-function-declaration]
- zephyr/modules/fatfs/zfs_ffsystem.c:19:16: warning: returning 'int' from
a function with return type 'void *' makes pointer from integer without a
cast [-Wint-conversion]
- zephyr/modules/fatfs/zfs_ffsystem.c:25:9: warning: implicit declaration
of function 'k_free' [-Wimplicit-function-declaration]
Signed-off-by: Johan Lafon <johan.lafon@syslinbit.com>
This commit enables zephyr to configure the FatFs FF_FS_REENTRANT
option and support fs actions from multiple threads.
CONFIG_FS_FATFS_REENTRANT enables the option and provides zephyr
mutex wrappers.
Signed-off-by: Nicola Ochsenbein <Nicola.Ochsenbein@husqvarnagroup.com>
Commit add hidden Kconfig option CONFIG_FS_FATFS_FF_USE_LFN
that is passed to ELM FAT to define FF_USE_LFN configuration.
The FF_USE_LFN still depends, indirectly, on choice
CONFIG_FS_FATFS_LFN_MODE config options
CONFIG_FS_FATFS_LFN_MODE_BSS, FS_FATFS_LFN_MODE_STACK and
FS_FATFS_LFN_MODE_HEAP, but the logic has been moved out of
zephyr_fatfs_config.h into Kconfig file.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The commit applies small changes in ELM FAT driver support code,
required by the driver update to version 0.15.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The Kconfig option allows to set minimum expected sector size
to be supported by FAT fs driver.
When this value differs from CONFIG_FS_FATFS_MAX_SS the driver
will query device for actual sector size, expecting different
sector sizes for different device. When CONFIG_FS_FATFS_MIN_SS
and CONFIG_FS_FATFS_MAX_SS are the same, then there is slight
reduction if FAT driver size, as the query logic is removed
and CONFIG_FS_FATFS_MAX_SS is used for all devices.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
The code moves Zephyr specific code and CMakeLists.txt
under modules/fatfs/.
The commit also adds zephyr_fatfs_config.h header file, that
is now used to override FF_ options of ffconf.h file within
fatfs repository.
Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>