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

Conversation

jfischer-no
Copy link
Collaborator

@jfischer-no jfischer-no commented Sep 5, 2023

Fakefat disk emulates a disk formatted with the FAT file system.
The driver supports FAT16 and FAT32 emulation and multiple instances.
A backend can register at least 15 emulated files on a disk instance.
The file structure contain read and write callbacks that are called
when the filesystem driver accesses the volume. A backend can have
multiple files with read callbacks, but usually only one or zero with
write callbacks.

Fakefat disk can be used for testing or to map services such as
firmware updates to a file on the emulated disk.
Complementary to #53798

TODO:

  • sample README.rst
  • documentation
  • tests

@jfischer-no jfischer-no added area: Drivers area: USB Universal Serial Bus area: Disk Access Experimental Experimental features not enabled by default labels Sep 5, 2023
@github-actions github-actions bot added the Stale label Nov 5, 2023
@jfischer-no jfischer-no removed the Stale label Nov 8, 2023
@zephyrproject-rtos zephyrproject-rtos deleted a comment from github-actions bot Nov 8, 2023
@github-actions github-actions bot added the Stale label Jan 8, 2024
@zephyrproject-rtos zephyrproject-rtos deleted a comment from github-actions bot Jan 9, 2024
@jfischer-no jfischer-no removed the Stale label Jan 9, 2024
@jfischer-no
Copy link
Collaborator Author

@petejohanson You might find it useful for your fancy stuff.

@petejohanson
Copy link
Contributor

@petejohanson You might find it useful for your fancy stuff.

Interesting.. possibly useful for some of our testing scenarios or development with the posix targets.

@jfischer-no jfischer-no requested review from de-nordic and removed request for galak October 21, 2024 16:19
Fakefat disk emulates a disk formatted with the FAT file system.
The driver supports FAT16 and FAT32 emulation and multiple instances.
A backend can register at least 15 emulated files on a disk instance.
The file structure contain read and write callbacks that are called
when the filesystem driver accesses the volume. A backend can have
multiple files with read callbacks, but usually only one or zero with
write callbacks.

Fakefat disk can be used for testing or to map services such as
firmware updates to a file on the emulated disk.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Add FAT16 and FAT32 tests for the FFAT disk using ELM FAT file system
support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This sample has two volumes, FAT16 and FAT32, exported via
new USB device MSC support.

Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
@tmon-nordic
Copy link
Collaborator

What exactly do you not expect to work? Or what is not working for you?

When the host reorders the files, e.g. deletes a file and then creates a new one things will break.

Why would I use ridiculously long names?

Code is written for humans. It is annoying when something that can be mistaken as a typo has some very special meaning behind it. In my opinion longer names are generally better because such names avoid ambiguity and are especially helpful for newcomers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Devicetree area: Disk Access area: Drivers area: Samples Samples area: Storage Storage subsystem area: USB Universal Serial Bus Experimental Experimental features not enabled by default
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants