This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

lfs.h can't be found asset tracker project

I'm using the asset tracker project and I want to add in the ability to store information on the board. However when you include the littlefs file system you get a build error from the littlefs.h file

So the compiler can find the include for littlefs but can't find the lfs.h file in the zephyr/modules/fs/littlefs folder.

Any got any ideas on what i need to modify to get these files included when building? I've tried modifying the emproject files but can't find anything obvious.

Thanks

  • Try to do the following:

    • Add these lines to ncs\v1.3.0\nrf\applications\asset_tracker\src\main.c

    #include <fs/fs.h>
    #include <fs/littlefs.h>

    • Add these configurations to ncs\v1.3.0\nrf\applications\asset_tracker\prj.conf

    CONFIG_FILE_SYSTEM=y
    CONFIG_FILE_SYSTEM_LITTLEFS=y


    There might be more you have to do in order to use littlefs. If you face any more problems, take a look at the sample ncs\v1.3.0\zephyr\samples\subsys\fs\littlefs, which can be used as a guidance on how to implement the file system.

    Best regards,

    Simon

Related