ff.h no such file or directory

Hi, 

I am working with nRF5340 and nRF Connect v2.7.0. When I try the mass sample it works fine. When I take the code to my custom project, I have 

ff.h no such file or directory

I have seen other threads that speak of the issue and the fact that there are issue witrh out of tree build, but I didn't found any solution to this. I assume it is because the files containing the code are not sourced to app directly, but linked like this : 

zephyr_link_libraries(MassStorageLib)

The MassStorageLib contain the files mass_storage.c and mass_storage.h that are mostly inspired by the working sample. 

How can I make it work ? As a subsidiary question, is it the recommended way to make a mass storage out of the nRf5340? 

Thank you for your help

  • Hello,

    As a subsidiary question, is it the recommended way to make a mass storage out of the nRf5340?

    If you get it to work with an adequate size of flash, then I don't see why not. 

    Most files are included using the configurations in prj.conf, or whatever .conf file you have included in your application. 

    Compare the prj.conf file of the mass sample with the prj.conf of your project, and also the build command (if you used any special arguments in your build command when building the mass sample). 

    Obviously, there will be some differences, but try to include the relevant configs from the mass sample into your project. Let me know if it still doesn't work.

    Best regards,

    Edvin

  • Hi, thank you for your feedback. At first sight, I don't see any config that is not on the non working project.

    working prj.conf : 

    CONFIG_STDOUT_CONSOLE=y
    
    #USB related configs
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample"
    CONFIG_USB_DEVICE_PID=0x0008
    CONFIG_LOG=y
    CONFIG_USE_SEGGER_RTT=y
    CONFIG_USB_MASS_STORAGE=y
    CONFIG_USB_DRIVER_LOG_LEVEL_ERR=y
    CONFIG_USB_DEVICE_LOG_LEVEL_ERR=y
    CONFIG_USB_MASS_STORAGE_LOG_LEVEL_ERR=y
    CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
    
    CONFIG_DISK_DRIVER_FLASH=y
    CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    
    CONFIG_FAT_FILESYSTEM_ELM=y
    # CONFIG_FILE_SYSTEM_LITTLEFS=y
    CONFIG_FILE_SYSTEM=y
    
    CONFIG_SIZE_OPTIMIZATIONS=n
    
    
    CONFIG_MAIN_STACK_SIZE=1536
    

    Non working prj.conf : 

    # Peripheral drivers
    
    # I2C
    CONFIG_NRFX_TWIM2=y
    
    # Timer
    CONFIG_NRFX_TIMER2=y
    
    # GPIO
    CONFIG_NRFX_GPIOTE0=y
    CONFIG_NRFX_GPIOTE_NUM_OF_EVT_HANDLERS=5
    
    # Flash 
    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y
    
    # Others 
    CONFIG_NRFX_PWM0=y
    CONFIG_NRFX_SPIM4=y
    CONFIG_NRFX_RNG=y
    CONFIG_NRFX_UARTE0=y
    CONFIG_NRFX_NVMC=y
    
    # BLE
    CONFIG_BT=y
    CONFIG_BT_PERIPHERAL=y
    CONFIG_BT_DEVICE_NAME_DYNAMIC=y
    CONFIG_BT_CTLR_CONN_RSSI=y
    CONFIG_BT_CTLR_TX_PWR_DYNAMIC_CONTROL=y
    CONFIG_BT_MAX_CONN=1
    
    # System settings 
    CONFIG_INIT_STACKS=y
    
    # Power management
    CONFIG_POWEROFF=y
    CONFIG_RESET_ON_FATAL_ERROR=n
    
    # Logging
    CONFIG_USE_SEGGER_RTT=y
    
    # Enable printf floating point support beware this take up to 7ko of flash
    CONFIG_CBPRINTF_FP_SUPPORT=y
    
    # Build options
    CONFIG_BUILD_NO_GAP_FILL=y
    CONFIG_MAIN_STACK_SIZE=8192
    CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=2048
    
    CONFIG_USB_DEVICE_STACK=y
    CONFIG_USB_DEVICE_PRODUCT="Zephyr MSC sample"
    CONFIG_USB_DEVICE_PID=0x0008
    CONFIG_USB_MASS_STORAGE=y
    CONFIG_USB_DEVICE_INITIALIZE_AT_BOOT=n
    
    CONFIG_DISK_DRIVER_FLASH=y
    CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
    
    CONFIG_FAT_FILESYSTEM_ELM=y
    
    CONFIG_FILE_SYSTEM=y
    CONFIG_SIZE_OPTIMIZATIONS=n
    
    
    
    

    I tried to remove 

    CONFIG_FLASH=y
    CONFIG_FLASH_PAGE_LAYOUT=y
    CONFIG_MPU_ALLOW_FLASH_WRITE=y 
    Just in case as it was not on the working prj.conf, but it wasn't any better.

    Thank you for your help

    EDIT : I forgot to incude the build commands. Obviously on the working projet, I have 

    -IC:/ncs/v2.7.0/modules/fs/fatfs/include

    I also have -DZEPHYR_CONFIG_OVERRIDE=zephyr_fatfs_config.h that is not on the failing command line.

    I give you both commands in two separate file.

    Thank you for your help

    C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DZEPHYR_CONFIG_OVERRIDE=zephyr_fatfs_config.h -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/ncs/v2.7.0/zephyr/include -IC:/Users/Documents/Project/app/zephyr_poc/mass/build/zephyr/include/generated -IC:/ncs/v2.7.0/zephyr/soc/nordic -IC:/ncs/v2.7.0/zephyr/soc/nordic/nrf53/. -IC:/ncs/v2.7.0/zephyr/soc/nordic/common/. -IC:/ncs/v2.7.0/zephyr/subsys/usb/device -IC:/ncs/v2.7.0/zephyr/drivers/usb/common/nrf_usbd_common/. -IC:/ncs/v2.7.0/nrf/include -IC:/ncs/v2.7.0/nrf/tests/include -IC:/ncs/v2.7.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.7.0/zephyr/modules/cmsis/. -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.7.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.7.0/modules/debug/segger/SEGGER -IC:/ncs/v2.7.0/modules/debug/segger/Config -IC:/ncs/v2.7.0/zephyr/modules/fatfs -IC:/ncs/v2.7.0/modules/fs/fatfs/include -isystem C:/ncs/v2.7.0/zephyr/lib/libc/common/include -isystem C:/ncs/v2.7.0/nrfxlib/crypto/nrf_cc312_platform/include -fno-strict-aliasing -Os -imacros C:/Users/Documents/Project/app/zephyr_poc/mass/build/zephyr/include/generated/autoconf.h -fno-printf-return-value -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.7.0/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=C:/Users/Documents/Project/app/zephyr_poc/mass=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.7.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.7.0=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 C:/Users/Documents/Project/app/zephyr_poc/mass/src/main.c
      
    C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DBOARD_PCA10143=1 -DCONFIG_NRF_WIFI_FW_BIN=C:/ncs/v2.7.0/nrfxlib/nrf_wifi/fw_bins/default/nrf70.bin -DCONFIG_ZEPHYR -DDEBUG=1 -DKERNEL -DK_HEAP_MEM_POOL_SIZE=153000 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-want-config.h\" -DMBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DNRF52_ERRATA_215_ENABLE_WORKAROUND=0 -DNRF5340_XXAA_APPLICATION -DNRF53_ERRATA_159_ENABLE_WORKAROUND=0 -DNRF53_ERRATA_43_ENABLE_WORKAROUND=0 -DNRF_LOG_USES_UART=1 -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DOSBUILD_OEM=0 -DPICOLIBC_DOUBLE_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D_USE_LONG_TIME_T=1 -D__HEAP_SIZE=0 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -IC:/Users/Documents/Project/lib/hal/nRFConnect/wifi -IC:/Users/Documents/Project/lib/hal/nRFConnect -IC:/Users/Documents/Project/lib/hal/nRFConnect/utils -IC:/Users/Documents/Project/lib/hal/nRFConnect/nrf5340 -IC:/Users/Documents/Project/lib/hal -IC:/Users/Documents/Project/lib/components -IC:/Users/Documents/Project/lib/peripherals/hardware -IC:/Users/Documents/Project/lib/peripherals/common -IC:/Users/Documents/Project/lib/peripherals/common/lora -IC:/Users/Documents/Project/lib/peripherals -IC:/Users/Documents/Project/boards -IC:/ncs/v2.7.0/zephyr/include -IC:/Users/Documents/Project/_build/zephyr/include/generated -IC:/ncs/v2.7.0/modules/soc-hwmv1/soc/arm/nordic_nrf/nrf53 -IC:/ncs/v2.7.0/zephyr/include/zephyr/posix -IC:/ncs/v2.7.0/modules/soc-hwmv1/soc/arm/nordic_nrf/nrf53/. -IC:/ncs/v2.7.0/modules/soc-hwmv1/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.7.0/zephyr/subsys/usb/device -IC:/ncs/v2.7.0/zephyr/subsys/bluetooth -IC:/ncs/v2.7.0/zephyr/subsys/net/l2 -IC:/ncs/v2.7.0/zephyr/subsys/net/lib/dns/. -IC:/ncs/v2.7.0/zephyr/subsys/net/ip -IC:/ncs/v2.7.0/zephyr/drivers/usb/common/nrf_usbd_common/. -IC:/ncs/v2.7.0/nrf/include -IC:/ncs/v2.7.0/nrf/modules/hostap/src -IC:/ncs/v2.7.0/nrf/modules/hostap/../../../modules/lib/hostap -IC:/ncs/v2.7.0/nrf/modules/hostap/../../../modules/lib/hostap/wpa_supplicant -IC:/ncs/v2.7.0/nrf/modules/hostap/../../../modules/lib/hostap/src -IC:/ncs/v2.7.0/nrf/drivers/wifi/nrf700x/inc -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/utils/inc -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/os_if/inc -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/bus_if/bus/qspi/inc -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/bus_if/bal/inc -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/fw_if/umac_if/inc -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/fw_load/mips/fw/inc -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/hw_if/hal/inc -IC:/ncs/v2.7.0/nrf/drivers/wifi/nrf700x/src/qspi/inc -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/hw_if/hal/inc/fw -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/fw_if/umac_if/inc/fw -IC:/ncs/v2.7.0/nrfxlib/nrf_wifi/fw_if/umac_if/inc/default -IC:/ncs/v2.7.0/nrf/tests/include -IC:/ncs/v2.7.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.7.0/zephyr/modules/cmsis/. -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.7.0/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/Documents/Project/_build/modules/libmetal/libmetal/lib/include -IC:/ncs/v2.7.0/modules/lib/open-amp/open-amp/lib/include -IC:/ncs/v2.7.0/modules/debug/segger/SEGGER -IC:/ncs/v2.7.0/modules/debug/segger/Config -IC:/ncs/v2.7.0/modules/crypto/tinycrypt/lib/include -IC:/Users/Documents/Project/_build/modules/nrf/subsys/nrf_security/src/include/generated -IC:/ncs/v2.7.0/nrf/subsys/nrf_security/include -IC:/ncs/v2.7.0/modules/crypto/oberon-psa-crypto/include -IC:/ncs/v2.7.0/modules/crypto/oberon-psa-crypto/library -IC:/ncs/v2.7.0/modules/crypto/mbedtls/library -IC:/ncs/v2.7.0/modules/crypto/mbedtls/include -IC:/ncs/v2.7.0/modules/crypto/mbedtls/include/library -IC:/ncs/v2.7.0/nrfxlib/crypto/nrf_oberon/include -IC:/ncs/v2.7.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -IC:/ncs/v2.7.0/modules/crypto/oberon-psa-crypto/oberon/drivers -IC:/ncs/v2.7.0/nrfxlib/softdevice_controller/include -isystem C:/ncs/v2.7.0/zephyr/lib/libc/common/include -isystem C:/ncs/v2.7.0/nrfxlib/crypto/nrf_cc312_platform/include -g -Wno-enum-compare -Wunused-variable -Wunused-but-set-variable -Wno-unused-function -w -fno-strict-aliasing -Og -imacros C:/Users/Documents/Project/_build/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.7.0/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=C:/Users/Documents/BTM=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.7.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.7.0=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -D_POSIX_THREADS -std=c99 -MD -MT lib/hal/CMakeFiles/BTMHalLib.dir/nRFConnect/nrf5340/drv_mass_storage.c.obj -MF lib\hal\CMakeFiles\BTMHalLib.dir\nRFConnect\nrf5340\drv_mass_storage.c.obj.d -o lib/hal/CMakeFiles/BTMHalLib.dir/nRFConnect/nrf5340/drv_mass_storage.c.obj -c C:/Users/Documents/Project/lib/hal/nRFConnect/nrf5340/drv_mass_storage.c
    In file included from C:/Users/Documents/Project/lib/hal/nRFConnect/nrf5340/drv_mass_storage.c:1:
       

  • Hello,

    For debugging purposes, can you please check if the issue is also present in NCS v2.6.x (e.g. 2.6.1)?

    If that doesn't work, can you please upload you application folder, so that I can poke around to see what you would need to include in order for it to add the ff.h file?

    Best regards,

    Edvin

  • Hi, I still have the issue with ncs 2.6.0. I switched back to 2.7.0 and made you a minimal application. Just use the preset in CMakepreset.json. Out of the box, ff.h is not found. Two methods works to make it found, but none of them is clean so it would be great to have another way (I could work with it if it is not the case).

    1st method : in the hal Cmakefile, filter the mass storage files from the hal sources and add them to app directly. 

    [EDIT] : uncomment l12,l13 and l20,l21 of fs_app/lib/hal/nRFConnect/CMakeLists.  [EDIT]

    OR : 

    2nd method: manually add missing paths and add missing flag in main CMakeLists.txt

    [EDIT] : uncomment l28, l29 and add ZEPHYR_CONFIG_OVERRIDE=zephyr_fatfs_config.h to fs_app/CmakeLists.txt l31 [EDIT]

    All required lines are commented, uncomment lines according to the choosen method.

    I now face another issue, I have errors I don't understand (see logs_flashdfisk.txt) I came accross some threads speaking about issues when enablin multi-image build and file system features. I tried to mimic the threads but I thing I miss some info, it would be great to have some help on this also.

    If I take the working sample, and I add BT support, I have the same error so it seems not related to the wierd methods to make ff.h found.

    Thank you very much

     

    [82/256] Building C object zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj
    FAILED: zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj 
    C:\ncs\toolchains\ce3b5ff664\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DK_HEAP_MEM_POOL_SIZE=4096 -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DPICOLIBC_DOUBLE_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/ncs/v2.7.0/zephyr/include -IC:/Users/Documents/fs_app/_build/zephyr/include/generated -IC:/ncs/v2.7.0/modules/soc-hwmv1/soc/arm/nordic_nrf/nrf53 -IC:/ncs/v2.7.0/modules/soc-hwmv1/soc/arm/nordic_nrf/nrf53/. -IC:/ncs/v2.7.0/modules/soc-hwmv1/soc/arm/nordic_nrf/common/. -IC:/ncs/v2.7.0/zephyr/subsys/usb/device -IC:/ncs/v2.7.0/zephyr/subsys/bluetooth -IC:/ncs/v2.7.0/zephyr/drivers/usb/common/nrf_usbd_common/. -IC:/ncs/v2.7.0/nrf/include -IC:/ncs/v2.7.0/nrf/tests/include -IC:/ncs/v2.7.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.7.0/zephyr/modules/cmsis/. -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.7.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.7.0/zephyr/modules/hal_nordic/nrfx/. -IC:/Users/Documents/fs_app/_build/modules/libmetal/libmetal/lib/include -IC:/ncs/v2.7.0/modules/lib/open-amp/open-amp/lib/include -IC:/ncs/v2.7.0/modules/debug/segger/SEGGER -IC:/ncs/v2.7.0/modules/debug/segger/Config -IC:/ncs/v2.7.0/modules/crypto/tinycrypt/lib/include -IC:/ncs/v2.7.0/nrfxlib/softdevice_controller/include -IC:/Users/Documents/fs_app/lib/hal/nRFConnect -IC:/Users/Documents/fs_app/lib/hal/nRFConnect/nrf5340 -IC:/ncs/v2.7.0/zephyr/modules/fatfs -IC:/ncs/v2.7.0/modules/fs/fatfs/include -isystem C:/ncs/v2.7.0/zephyr/lib/libc/common/include -isystem C:/ncs/v2.7.0/nrfxlib/crypto/nrf_cc312_platform/include -g -Wshadow -fno-strict-aliasing -Og -imacros C:/Users/Documents/fs_app/_build/zephyr/include/generated/autoconf.h -fno-common -g -gdwarf-4 -fdiagnostics-color=always -mcpu=cortex-m33 -mthumb -mabi=aapcs -mfp16-format=ieee -mtp=soft --sysroot=C:/ncs/toolchains/ce3b5ff664/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.7.0/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=C:/Users/Documents/fs_app=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.7.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.7.0=WEST_TOPDIR -ffunction-sections -fdata-sections --specs=picolibc.specs -std=c99 -MD -MT zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj -MF zephyr\drivers\disk\CMakeFiles\drivers__disk.dir\flashdisk.c.obj.d -o zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj -c C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:484:1: error: return type defaults to 'int' [-Werror=implicit-int]
      484 | PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c: In function 'PM_FOREACH_AFFILIATED_TO_disk':
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:523:30: error: storage class specified for parameter 'flash_disks'
      523 | static struct flashdisk_data flash_disks[] = {
          |                              ^~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:523:15: error: parameter 'flash_disks' is initialized
      523 | static struct flashdisk_data flash_disks[] = {
          |               ^~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:524:39: error: 'DEFINE_FLASHDISKS_DEVICE' undeclared (first use in this function)
      524 |         PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE)
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:524:39: note: each undeclared identifier is reported only once for each function it appears in
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:533:1: error: expected declaration specifiers before 'PM_FOREACH_AFFILIATED_TO_disk'
      533 | PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    In file included from C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/gcc.h:98,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain.h:50,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/sys/__assert.h:11,
                     from C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:10:
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:141:44: error: storage class specified for parameter '__init_disk_flash_init'
      141 | #define Z_INIT_ENTRY_NAME(init_id) _CONCAT(__init_, init_id)
          |                                            ^~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:141:36: note: in expansion of macro '_CONCAT'
      141 | #define Z_INIT_ENTRY_NAME(init_id) _CONCAT(__init_, init_id)
          |                                    ^~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:241:17: note: in expansion of macro 'Z_INIT_ENTRY_NAME'
      241 |                 Z_INIT_ENTRY_NAME(name) = {.init_fn = {.sys = (init_fn_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:223:9: note: in expansion of macro 'SYS_INIT_NAMED'
      223 |         SYS_INIT_NAMED(init_fn, init_fn, level, prio)
          |         ^~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:563:1: note: in expansion of macro 'SYS_INIT'
      563 | SYS_INIT(disk_flash_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:239:42: error: parameter '__init_disk_flash_init' is initialized
      239 |         static const Z_DECL_ALIGN(struct init_entry)                                      \
          |                                          ^~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/common.h:195:55: note: in definition of macro 'Z_DECL_ALIGN'
      195 | #define Z_DECL_ALIGN(type) __aligned(__alignof(type)) type
          |                                                       ^~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:223:9: note: in expansion of macro 'SYS_INIT_NAMED'
      223 |         SYS_INIT_NAMED(init_fn, init_fn, level, prio)
          |         ^~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:563:1: note: in expansion of macro 'SYS_INIT'
      563 | SYS_INIT(disk_flash_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:141:44: error: section attribute not allowed for '__init_disk_flash_init'
      141 | #define Z_INIT_ENTRY_NAME(init_id) _CONCAT(__init_, init_id)
          |                                            ^~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:141:36: note: in expansion of macro '_CONCAT'
      141 | #define Z_INIT_ENTRY_NAME(init_id) _CONCAT(__init_, init_id)
          |                                    ^~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:241:17: note: in expansion of macro 'Z_INIT_ENTRY_NAME'
      241 |                 Z_INIT_ENTRY_NAME(name) = {.init_fn = {.sys = (init_fn_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:223:9: note: in expansion of macro 'SYS_INIT_NAMED'
      223 |         SYS_INIT_NAMED(init_fn, init_fn, level, prio)
          |         ^~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:563:1: note: in expansion of macro 'SYS_INIT'
      563 | SYS_INIT(disk_flash_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:239:42: warning: 'used' attribute ignored [-Wattributes]
      239 |         static const Z_DECL_ALIGN(struct init_entry)                                      \
          |                                          ^~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/common.h:195:55: note: in definition of macro 'Z_DECL_ALIGN'
      195 | #define Z_DECL_ALIGN(type) __aligned(__alignof(type)) type
          |                                                       ^~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:223:9: note: in expansion of macro 'SYS_INIT_NAMED'
      223 |         SYS_INIT_NAMED(init_fn, init_fn, level, prio)
          |         ^~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:563:1: note: in expansion of macro 'SYS_INIT'
      563 | SYS_INIT(disk_flash_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:141:44: error: alignment may not be specified for '__init_disk_flash_init'
      141 | #define Z_INIT_ENTRY_NAME(init_id) _CONCAT(__init_, init_id)
          |                                            ^~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:141:36: note: in expansion of macro '_CONCAT'
      141 | #define Z_INIT_ENTRY_NAME(init_id) _CONCAT(__init_, init_id)
          |                                    ^~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:241:17: note: in expansion of macro 'Z_INIT_ENTRY_NAME'
      241 |                 Z_INIT_ENTRY_NAME(name) = {.init_fn = {.sys = (init_fn_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:223:9: note: in expansion of macro 'SYS_INIT_NAMED'
      223 |         SYS_INIT_NAMED(init_fn, init_fn, level, prio)
          |         ^~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:563:1: note: in expansion of macro 'SYS_INIT'
      563 | SYS_INIT(disk_flash_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    In file included from C:/ncs/v2.7.0/zephyr/include/zephyr/device.h:13,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/sw_isr_table.h:18,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/arch/arm/irq.h:19,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/arch/arm/arch.h:27,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/arch/cpu.h:19,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/kernel_includes.h:36,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/kernel.h:17,
                     from C:/ncs/v2.7.0/zephyr/include/zephyr/drivers/disk.h:30,
                     from C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:12:
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:563:10: error: 'disk_flash_init' undeclared (first use in this function)
      563 | SYS_INIT(disk_flash_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          |          ^~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:241:64: note: in definition of macro 'SYS_INIT_NAMED'
      241 |                 Z_INIT_ENTRY_NAME(name) = {.init_fn = {.sys = (init_fn_)},                \
          |                                                                ^~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:563:1: note: in expansion of macro 'SYS_INIT'
      563 | SYS_INIT(disk_flash_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:484:1: error: type of 'DEFINE_FLASHDISKS_CACHE' defaults to 'int' [-Werror=implicit-int]
      484 | PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:141:44: error: declaration for parameter '__init_disk_flash_init' but no such parameter
      141 | #define Z_INIT_ENTRY_NAME(init_id) _CONCAT(__init_, init_id)
          |                                            ^~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:141:36: note: in expansion of macro '_CONCAT'
      141 | #define Z_INIT_ENTRY_NAME(init_id) _CONCAT(__init_, init_id)
          |                                    ^~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:241:17: note: in expansion of macro 'Z_INIT_ENTRY_NAME'
      241 |                 Z_INIT_ENTRY_NAME(name) = {.init_fn = {.sys = (init_fn_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/include/zephyr/init.h:223:9: note: in expansion of macro 'SYS_INIT_NAMED'
      223 |         SYS_INIT_NAMED(init_fn, init_fn, level, prio)
          |         ^~~~~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:563:1: note: in expansion of macro 'SYS_INIT'
      563 | SYS_INIT(disk_flash_init, APPLICATION, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:523:30: error: declaration for parameter 'flash_disks' but no such parameter
      523 | static struct flashdisk_data flash_disks[] = {
          |                              ^~~~~~~~~~~
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:565: error: expected '{' at end of input
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:565: warning: control reaches end of non-void function [-Wreturn-type]
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c: At top level:
    C:/ncs/v2.7.0/zephyr/drivers/disk/flashdisk.c:415:37: warning: 'flash_disk_ops' defined but not used [-Wunused-const-variable=]
      415 | static const struct disk_operations flash_disk_ops = {
          |                                     ^~~~~~~~~~~~~~
    cc1.exe: some warnings being treated as errors
    [91/254] Building C object zephyr/drivers/usb/device/CMakeFiles/drivers__usb__device.dir/usb_dc_nrfx.c.obj
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\ce3b5ff664\opt\bin\cmake.EXE' --build 'c:\Users\Documents\fs_app\_build'
    
     *  The terminal process terminated with exit code: 1. 
    4617.fs_app.zip 

  • Hello,

    Sorry for the late reply.

    I struggle with understanding the composition of the attached application, I am sorry. What build command do you use to build (try to build) this application?

    Or if you are using VS Code, can you please show me the build configuration?

    Best regards,

    Edvin

Related