zephyr/subsys
Grygorii Strashko e638602b6a fs: fatfs: Add CONFIG_FS_MULTI_PARTITION
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>
2024-09-03 14:39:18 +01:00
..
bindesc everywhere: replace #if IS_ENABLED() as per docs 2024-06-28 07:20:32 -04:00
bluetooth Bluetooth: CAP: Add check for streaming state when starting unicast 2024-09-03 10:43:59 +02:00
canbus net: buf: remove use of special putter and getter functions 2024-08-16 09:55:11 +02:00
console
dap kconfig: replace known integer constants with variables 2024-07-27 20:49:15 +03:00
debug debug: thread_analyzer: display privileged stack usage 2024-08-28 06:50:30 -04:00
demand_paging kernel: mmu: support for on-demand mappings 2024-08-26 17:25:41 -04:00
dfu
disk disk: disk_access: changed mutex for a spinlock 2024-08-26 17:26:36 -04:00
dsp
emul emul: Support UART device emulation 2024-07-30 18:28:17 +01:00
fb fb: cfb: Fix CID 394240 2024-07-05 18:39:22 +02:00
fs fs: fatfs: Add CONFIG_FS_MULTI_PARTITION 2024-09-03 14:39:18 +01:00
input input: double tap 2024-08-19 09:56:26 -04:00
ipc ipc: icmsg: configure PBUF RX rx_buffer using kconfig 2024-08-30 11:45:38 -04:00
jwt jwt: add missing documentation 2024-08-23 15:49:05 +01:00
llext llext: add dependencies 2024-09-02 12:31:52 -04:00
logging llext: export a symbol needed for immediate logging 2024-09-02 12:31:52 -04:00
lorawan everywhere: replace double words 2024-06-25 06:05:35 -04:00
mem_mgmt
mgmt mgmt: mcumgr: grp: Add names to groups when Kconfig is enabled 2024-08-26 17:05:27 +02:00
modbus
modem modem: ubx: fix incoming byte processing 2024-08-02 03:29:18 -04:00
net net: lib: http_server: prevent falsely matching HTTP headers 2024-09-02 12:33:03 -04:00
pm pm: refactor pm_device_driver_init 2024-08-02 03:31:17 -04:00
portability kconfig: replace known integer constants with variables 2024-07-27 20:49:15 +03:00
profiling subsys/profiling: fix extra frame in the traces 2024-08-20 14:45:23 +02:00
random everywhere: replace double words 2024-06-25 06:05:35 -04:00
retention
rtio rtio: Split the rx and tx buffer unions 2024-08-17 08:55:01 -04:00
sd sd: resend CMD0 before each CMD8 2024-08-27 15:14:23 -04:00
sensing
settings kconfig: replace known integer constants with variables 2024-07-27 20:49:15 +03:00
shell shell: modules: kernel: fix typo in cmd_kernel_uptime() 2024-08-28 14:01:55 -04:00
sip_svc
stats
storage everywhere: replace #if IS_ENABLED() as per docs 2024-06-28 07:20:32 -04:00
task_wdt
testsuite tests: kernel: add missing test call argument 2024-08-24 07:17:15 -04:00
timing
tracing style: subsys: comply with MISRA C:2012 Rule 15.6 2024-08-20 10:33:51 +02:00
usb usb: fix wrong capacity report for USB mass storage device 2024-08-26 17:26:36 -04:00
zbus net: buf: remove use of special putter and getter functions 2024-08-16 09:55:11 +02:00
CMakeLists.txt profiling: Add perf tool 2024-08-13 18:28:44 -04:00
Kconfig profiling: Add perf tool 2024-08-13 18:28:44 -04:00