fatal error: lfs.h: No such file or directory

Greetings,

We are planning to integrate the use of the internal storage of our nRF52840 MCU using LittleFS so we tried starting out by just opening the sample zephyr/samples/subsys/fs/littlefs and after adding the nrf52840dk_nrf52840 board in the build configuration and building the project the build was not successful and the following error was shown at the output terminal:

[79/173] Building C object CMakeFiles/app.dir/src/main.c.obj
FAILED: CMakeFiles/app.dir/src/main.c.obj 
C:\ncs\toolchains\v2.1.0\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DNRF52840_XXAA -DUSE_PARTITION_MANAGER=0 -D_FORTIFY_SOURCE=2 -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.1.0/zephyr/include/zephyr -IC:/ncs/v2.1.0/zephyr/include -Izephyr/include/generated -IC:/ncs/v2.1.0/zephyr/soc/arm/nordic_nrf/nrf52 -IC:/ncs/v2.1.0/zephyr/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.1.0/nrf/include -IC:/ncs/v2.1.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.1.0/modules/hal/nordic/nrfx -IC:/ncs/v2.1.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.1.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.1.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.1.0/modules/debug/segger/SEGGER -IC:/ncs/v2.1.0/modules/debug/segger/Config -IC:/ncs/v2.1.0/zephyr/modules/segger/. -isystem C:/ncs/v2.1.0/zephyr/lib/libc/minimal/include -isystem c:/ncs/toolchains/v2.1.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include -isystem c:/ncs/toolchains/v2.1.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/10.3.0/include-fixed -isystem C:/ncs/v2.1.0/nrfxlib/crypto/nrf_cc310_platform/include -Os -imacros C:/ncs/feel_v2_fw/littlefs/build/zephyr/include/generated/autoconf.h -ffreestanding -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee --sysroot=C:/ncs/toolchains/v2.1.0/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.1.0/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wno-main -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-asynchronous-unwind-tables -fno-pie -fno-pic -fno-reorder-functions -fno-defer-pop -fmacro-prefix-map=C:/ncs/feel_v2_fw/littlefs=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.1.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.1.0=WEST_TOPDIR -ffunction-sections -fdata-sections -std=c99 -nostdinc -MD -MT CMakeFiles/app.dir/src/main.c.obj -MF CMakeFiles\app.dir\src\main.c.obj.d -o CMakeFiles/app.dir/src/main.c.obj -c ../src/main.c
In file included from c:\ncs\feel_v2_fw\littlefs\src\main.c:15:
C:\ncs\v2.1.0\zephyr\include\zephyr\fs\littlefs.h:14:10: fatal error: lfs.h: No such file or directory
   14 | #include <lfs.h>
      |          ^~~~~~~
compilation terminated.

What could be causing this? We just build a sample as it was in the SDK (no changes just created a new application with the sample as the 'Application template', selected the nrf52840dk_nrf52840 board in the build configuration and pressed build).

Thank you!

Best regards,

Stavros

Related