Skip to content

drivers: disk: add fakefat disk driver #62286

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions drivers/disk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if(CONFIG_DISK_DRIVERS)

zephyr_library()

zephyr_library_sources_ifdef(CONFIG_DISK_DRIVER_FFAT ffatdisk.c)
zephyr_library_sources_ifdef(CONFIG_DISK_DRIVER_FLASH flashdisk.c)
zephyr_library_sources_ifdef(CONFIG_DISK_DRIVER_RAM ramdisk.c)
zephyr_library_sources_ifdef(CONFIG_DISK_DRIVER_LOOPBACK loopback_disk.c)
Expand All @@ -15,4 +16,6 @@ zephyr_library_sources_ifdef(CONFIG_MMC_SUBSYS mmc_subsys.c)

add_subdirectory_ifdef(CONFIG_NVME nvme)

zephyr_linker_sources_ifdef(CONFIG_DISK_DRIVER_FFAT DATA_SECTIONS ffatdisk.ld)

endif()
1 change: 1 addition & 0 deletions drivers/disk/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ menuconfig DISK_DRIVERS
if DISK_DRIVERS

source "drivers/disk/Kconfig.ram"
source "drivers/disk/Kconfig.ffat"
source "drivers/disk/Kconfig.flash"
source "drivers/disk/Kconfig.sdmmc"
source "drivers/disk/Kconfig.mmc"
Expand Down
19 changes: 19 additions & 0 deletions drivers/disk/Kconfig.ffat
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config DISK_DRIVER_FFAT
bool "Fake FAT Disk"
default y if DT_HAS_ZEPHYR_FFAT_DISK_ENABLED
help
Fake FAT disk emulates a disk formatted with the FAT file system
and provides very limited functionality. It can be used for testing
or to map services such as firmware updates to a file on
the emulated disk.

if DISK_DRIVER_FFAT

module = FFATDISK
module-str = ffatdisk
source "subsys/logging/Kconfig.template.log_config"

endif # DISK_DRIVER_FFAT
Loading
Loading