Skip to content

USB mass sample not working for FAT FS #51720

@spoerk

Description

@spoerk

Describe the bug
The USB mass sample does not work for the FAT filesystem.

I want the USB mass sample with the FAT FS configuration as a basis for a new project on the Nordic nRF52840 DK. However, when I configure the sample to use FAT, the FS cannot be mounted.

To Reproduce
Compile the USB mass sample for the nRF52840 DK platform using the following prj.conf:

CONFIG_STDOUT_CONSOLE=y

#USB related configs
CONFIG_USB_DEVICE_STACK=y
CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample"
CONFIG_LOG=y
CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
CONFIG_USB_MASS_STORAGE=y
CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y

CONFIG_MAIN_STACK_SIZE=1536

CONFIG_APP_MSC_STORAGE_FLASH_FATFS=y

Expected behavior
The sample should show a successful empty FAT FS over RTT and USB log.

Impact
Was showstopper, now fixed due to great help at Nordic Devzone.

Logs and console output
RTT log output:

[00:00:00.254,333] <err> usb_msc: Storage init ERROR !!!! - Aborting USB init
[00:00:00.258,514] <err> fs: fs mount error (-5)
[00:00:00.258,544] <err> main: Failed to mount filesystem
[00:00:00.258,728] <inf> main: The device is put in USB mass storage mode.

Environment (please complete the following information):

  • OS: Windows 11
  • Toolchain: Zephyr SDK v2.1.0
  • Commit SHA or Version used

Additional context
Simon over at the Nordic Devzone has already solved the problem. His fix should be added to the repo.

Metadata

Metadata

Labels

Stalearea: StorageStorage subsystemarea: USBUniversal Serial BusbugThe issue is a bug, or the PR is fixing a bugplatform: nRFNordic nRFxpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions