-
Describe the bugff.h file missing when trying to access from an out_of_tree_driver To ReproduceI get t he sample "samples/application_development/out_of_tree_driver" In the main, I called this method init(). Run : "west build ..." Expected behaviorThe project can build properly Screenshots or console outputfatal error: ff.h: No such file or directory The error comes from the include in the driver H file. Source code |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments
-
@nordicjm @de-nordic any hints? |
Beta Was this translation helpful? Give feedback.
-
A driver added to zephyr externally is a driver and is added as an external module, it should have access to the base zephyr features, fat_fs is not a base zephyr feature, it's a module. Because they are both modules, you cannot reference it, and why would a driver expose a fat filesystem? The driver should expose a base device which is then mounted as a filesystem - be it fat or littlefs or any other filesystem, which can then be mounted from application code. The reason for there being a split of modules that can be used and those that can't, from an external module, is because some modules configuration is in the zephyr tree, and some is outside of it. fatfs is outside of it, segger is inside it (which is why you can enable RTT output and it will work from a module) |
Beta Was this translation helpful? Give feedback.
-
The <ff.h> header is not part of zephyr interface unless you enable FAT FS support. zephyr/subsys/fs/CMakeLists.txt Line 19 in 3cef8e6 under condition that CONFIG_FAT_FILESYSTEM_ELM=y If your driver links zephyr_interface then you should enable the FAT FS driver module, to get access to ff.h, but this will also enable default FAT FS driver, so probably cause collision with what you are doing. Anyway: I do not understand why SD card driver requires FAT file system access. SD card driver should provide disk interface that can then be used to mount FAT FS of that interface. |
Beta Was this translation helpful? Give feedback.
-
I allowed myself to remove "bug" label, because this is not a bug. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your answers! I didn't understand it before. I changed the way I solve my problem by using a library to do my work. |
Beta Was this translation helpful? Give feedback.
A driver added to zephyr externally is a driver and is added as an external module, it should have access to the base zephyr features, fat_fs is not a base zephyr feature, it's a module. Because they are both modules, you cannot reference it, and why would a driver expose a fat filesystem? The driver should expose a base device which is then mounted as a filesystem - be it fat or littlefs or any other filesystem, which can then be mounted from application code.
The reason for there being a split of modules that can be used and those that can't, from an external module, is because some modules configuration is in the zephyr tree, and some is outside of it. fatfs is outside of it, segger is…