Settings FILE subsystem is not working with SD card with FAT filesystem #72741
Labels
area: Settings
Settings subsystem
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Describe the bug
Settings FILE subsystem is not working with SD card with FAT filesystem, providing file directory with
/SD:/
prefix results in fail to load or create settings file.I'm testing on nRF9160DK with external SD Card module.
When settings file subsystem is trying to create directory for file, it checks directories if they exist one by one.
Because mount point is first directory in path,
fs_stat
returns-ENOENT
after thatfs_mkdir
is called which returns-EEXIST
https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/settings/src/settings_file.c#L524
For workaround, i tested substitiuting expression in https://github.com/zephyrproject-rtos/zephyr/blob/main/subsys/settings/src/settings_file.c#L548 to
err && err != -EEXIST
After that code is working, but it does not seem like a final solution
To Reproduce
Take a board with SD Card, enable Filesystem backend for setting
Expected behavior
Settings file backend works correctly
Impact
Settings file backend is useless without additional zephyr patch kept separately
Logs and console output
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: