zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.82k stars 6.59k forks source link

doc: Documentation issue in 'samples/subsys/fs/fs_sample/README' #71582

Closed ConnorRigby closed 6 months ago

ConnorRigby commented 6 months ago

Describe the bug

Running the commands exactly as they are described in the fs_sample guide, i get a compiler error:

FAILED: CMakeFiles/app.dir/src/main.c.obj 
ccache /home/connorrigby/zephyr-sdk-0.16.5-1/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DNRF52840_XXAA -DPICOLIBC_LONG_LONG_PRINTF_SCANF -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/include -I/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/build/zephyr/include/generated -I/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/soc/nordic -I/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/soc/nordic/nrf52/. -I/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/soc/nordic/common/. -I/home/connorrigby/workspace/connorrigby/my-workspace/example-application/include -I/home/connorrigby/workspace/connorrigby/my-workspace/modules/hal/cmsis/CMSIS/Core/Include -I/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/modules/cmsis/. -I/home/connorrigby/workspace/connorrigby/my-workspace/modules/hal/nordic/nrfx -I/home/connorrigby/workspace/connorrigby/my-workspace/modules/hal/nordic/nrfx/drivers/include -I/home/connorrigby/workspace/connorrigby/my-workspace/modules/hal/nordic/nrfx/mdk -I/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/modules/hal_nordic/nrfx/. -isystem /home/connorrigby/workspace/connorrigby/my-workspace/zephyr/lib/libc/common/include -fno-strict-aliasing -Os -imacros /home/connorrigby/workspace/connorrigby/my-workspace/zephyr/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m4 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=/home/connorrigby/zephyr-sdk-0.16.5-1/arm-zephyr-eabi/arm-zephyr-eabi -imacros /home/connorrigby/workspace/connorrigby/my-workspace/zephyr/include/zephyr/toolchain/zephyr_stdint.h -Wall -Wformat -Wformat-security -Wno-format-zero-length -Wdouble-promotion -Wno-pointer-sign -Wpointer-arith -Wexpansion-to-defined -Wno-unused-but-set-variable -Werror=implicit-int -fno-pic -fno-pie -fno-asynchronous-unwind-tables -ftls-model=local-exec -fno-reorder-functions --param=min-pagesize=0 -fno-defer-pop -fmacro-prefix-map=/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/samples/subsys/fs/fs_sample=CMAKE_SOURCE_DIR -fmacro-prefix-map=/home/connorrigby/workspace/connorrigby/my-workspace/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/home/connorrigby/workspace/connorrigby/my-workspace=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -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 /home/connorrigby/workspace/connorrigby/my-workspace/zephyr/samples/subsys/fs/fs_sample/src/main.c
/home/connorrigby/workspace/connorrigby/my-workspace/zephyr/samples/subsys/fs/fs_sample/src/main.c:19:10: fatal error: ff.h: No such file or directory
   19 | #include <ff.h>

Environment

nordicjm commented 6 months ago

You didn't though, because the documentation for zephyr clearly states to use west init on https://docs.zephyrproject.org/latest/develop/getting_started/index.html#get-zephyr-and-install-python-dependencies so if you don't have the fatfs module then you did not follow these instructions

ConnorRigby commented 6 months ago

image image

the fatfs module is listed in both the root of zephyr/modules and in my workspace's modules folder

nordicjm commented 6 months ago

image image

the fatfs module is listed in both the root of zephyr/modules and in my workspace's modules folder

If you've added then it would be, it is not in the default allow list for example application https://github.com/zephyrproject-rtos/example-application/blob/main/west.yml example application is exactly as the name implies, it demonstrates how to make a workspace-based zephyr project with out of tree boards and drivers, it is not meant nor should it be used to run samples inside the zephyr directory, as all the modules and most of the hals are not in the allow list.

aescolar commented 6 months ago

@ConnorRigby this seems like a duplicate of https://github.com/zephyrproject-rtos/zephyr/discussions/71826 , so I will close it as such. Please reopen if you disagree.

AndreyDodonov-EH commented 2 months ago

I had the same issue, maybe somebody finds this helpful: if you are working with different samples (and may be your own app, too), make sure that your west update works with the right YAML where - fatfs is included. Or update the one being used.

E.g. I added it to my app explicitly and THEN ran west update

  projects:
    - name: zephyr
      path: zephyr
      remote: zephyrproject-rtos
      revision: v3.7.0
      # explicitly add Zephyr-specific West extensions
      west-commands: scripts/west-commands.yml
      import:
        name-allowlist:
          - fatfs