Hi
I am looking at this information:
https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/subsys/fs/fs_sample/README.html#fs
I created the sample application, built it for SDK 2.9.0 / nRF52840DK, but I get build errors - see below.
I re-built for 3.0.2 SDK, built get similar errors.
The Zephyr version I have on my pc is: v4.0.99-ncs1-2
I have attached the 2.9.0 build error output.
Thank you
Building fs_sample_03 C:\Windows\system32\cmd.exe /d /s /c "west build --build-dir c:/_delete/fs_sample_03/build c:/_delete/fs_sample_03" [8/81] 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\b620d30767\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DNRF52840_XXAA -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -IC:/_delete/fs_sample_03/build/fs_sample_03/zephyr/include/generated/zephyr -IC:/ncs/v2.9.0/zephyr/include -IC:/_delete/fs_sample_03/build/fs_sample_03/zephyr/include/generated -IC:/ncs/v2.9.0/zephyr/soc/nordic -IC:/ncs/v2.9.0/zephyr/soc/nordic/nrf52/. -IC:/ncs/v2.9.0/zephyr/soc/nordic/common/. -IC:/ncs/v2.9.0/nrf/include -IC:/ncs/v2.9.0/nrf/tests/include -IC:/ncs/v2.9.0/modules/mic24045/drivers -IC:/ncs/v2.9.0/modules/hal/cmsis/CMSIS/Core/Include -IC:/ncs/v2.9.0/zephyr/modules/cmsis/. -IC:/ncs/v2.9.0/modules/hal/nordic/nrfx -IC:/ncs/v2.9.0/modules/hal/nordic/nrfx/drivers/include -IC:/ncs/v2.9.0/modules/hal/nordic/nrfx/mdk -IC:/ncs/v2.9.0/zephyr/modules/hal_nordic/nrfx/. -IC:/ncs/v2.9.0/modules/debug/segger/SEGGER -IC:/ncs/v2.9.0/modules/debug/segger/Config -isystem C:/ncs/v2.9.0/zephyr/lib/libc/common/include -isystem C:/ncs/v2.9.0/nrfxlib/crypto/nrf_cc310_platform/include -Os -DNDEBUG -Wshadow -fno-strict-aliasing -Os -imacros C:/_delete/fs_sample_03/build/fs_sample_03/zephyr/include/generated/zephyr/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=C:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi -imacros C:/ncs/v2.9.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:/_delete/fs_sample_03=CMAKE_SOURCE_DIR -fmacro-prefix-map=C:/ncs/v2.9.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=C:/ncs/v2.9.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.9.0/zephyr/drivers/disk/flashdisk.c C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:533:1: error: return type defaults to 'int' [-Werror=implicit-int] 533 | PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c: In function 'PM_FOREACH_AFFILIATED_TO_disk': C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:572:30: error: storage class specified for parameter 'flash_disks' 572 | static struct flashdisk_data flash_disks[] = { | ^~~~~~~~~~~ C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:572:15: error: parameter 'flash_disks' is initialized 572 | static struct flashdisk_data flash_disks[] = { | ^~~~~~~~~~~~~~ C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:573:39: error: 'DEFINE_FLASHDISKS_DEVICE' undeclared (first use in this function) 573 | PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_DEVICE) | ^~~~~~~~~~~~~~~~~~~~~~~~ C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:573:39: note: each undeclared identifier is reported only once for each function it appears in C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:582:1: error: expected declaration specifiers before 'PM_FOREACH_AFFILIATED_TO_disk' 582 | PM_FOREACH_AFFILIATED_TO_disk(VERIFY_CACHE_SIZE_IS_NOT_ZERO_IF_NOT_READ_ONLY) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from C:/ncs/v2.9.0/zephyr/include/zephyr/toolchain/gcc.h:98, from C:/ncs/v2.9.0/zephyr/include/zephyr/toolchain.h:50, from C:/ncs/v2.9.0/zephyr/include/zephyr/sys/__assert.h:11, from C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:10: C:/ncs/v2.9.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.9.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.9.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.9.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.9.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.9.0/zephyr/drivers/disk/flashdisk.c:612:1: note: in expansion of macro 'SYS_INIT' 612 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); | ^~~~~~~~ C:/ncs/v2.9.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.9.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.9.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.9.0/zephyr/drivers/disk/flashdisk.c:612:1: note: in expansion of macro 'SYS_INIT' 612 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); | ^~~~~~~~ C:/ncs/v2.9.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.9.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.9.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.9.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.9.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.9.0/zephyr/drivers/disk/flashdisk.c:612:1: note: in expansion of macro 'SYS_INIT' 612 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); | ^~~~~~~~ C:/ncs/v2.9.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.9.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.9.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.9.0/zephyr/drivers/disk/flashdisk.c:612:1: note: in expansion of macro 'SYS_INIT' 612 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); | ^~~~~~~~ C:/ncs/v2.9.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.9.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.9.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.9.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.9.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.9.0/zephyr/drivers/disk/flashdisk.c:612:1: note: in expansion of macro 'SYS_INIT' 612 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); | ^~~~~~~~ In file included from C:/ncs/v2.9.0/zephyr/include/zephyr/device.h:13, from C:/ncs/v2.9.0/zephyr/include/zephyr/sw_isr_table.h:18, from C:/ncs/v2.9.0/zephyr/include/zephyr/arch/arm/irq.h:19, from C:/ncs/v2.9.0/zephyr/include/zephyr/arch/arm/arch.h:24, from C:/ncs/v2.9.0/zephyr/include/zephyr/arch/cpu.h:19, from C:/ncs/v2.9.0/zephyr/include/zephyr/kernel_includes.h:36, from C:/ncs/v2.9.0/zephyr/include/zephyr/kernel.h:17, from C:/ncs/v2.9.0/zephyr/include/zephyr/drivers/disk.h:30, from C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:12: C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:612:10: error: 'disk_flash_init' undeclared (first use in this function) 612 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); | ^~~~~~~~~~~~~~~ C:/ncs/v2.9.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.9.0/zephyr/drivers/disk/flashdisk.c:612:1: note: in expansion of macro 'SYS_INIT' 612 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); | ^~~~~~~~ C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:533:1: error: type of 'DEFINE_FLASHDISKS_CACHE' defaults to 'int' [-Werror=implicit-int] 533 | PM_FOREACH_AFFILIATED_TO_disk(DEFINE_FLASHDISKS_CACHE) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:/ncs/v2.9.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.9.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.9.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.9.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.9.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.9.0/zephyr/drivers/disk/flashdisk.c:612:1: note: in expansion of macro 'SYS_INIT' 612 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT); | ^~~~~~~~ C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:572:30: error: declaration for parameter 'flash_disks' but no such parameter 572 | static struct flashdisk_data flash_disks[] = { | ^~~~~~~~~~~ C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:614: error: expected '{' at end of input C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:614: warning: control reaches end of non-void function [-Wreturn-type] C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c: At top level: C:/ncs/v2.9.0/zephyr/drivers/disk/flashdisk.c:464:37: warning: 'flash_disk_ops' defined but not used [-Wunused-const-variable=] 464 | static const struct disk_operations flash_disk_ops = { | ^~~~~~~~~~~~~~ cc1.exe: some warnings being treated as errors [25/81] Building C object zephyr/drivers/serial/CMakeFiles/drivers__serial.dir/uart_nrfx_uarte.c.obj ninja: build stopped: subcommand failed. FAILED: _sysbuild/sysbuild/images/fs_sample_03-prefix/src/fs_sample_03-stamp/fs_sample_03-build C:/_delete/fs_sample_03/build/_sysbuild/sysbuild/images/fs_sample_03-prefix/src/fs_sample_03-stamp/fs_sample_03-build cmd.exe /C "cd /D C:\_delete\fs_sample_03\build\fs_sample_03 && C:\ncs\toolchains\b620d30767\opt\bin\cmake.exe --build ." ninja: build stopped: subcommand failed. FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' --build C:/_delete/fs_sample_03/build * The terminal process terminated with exit code: 1. * Terminal will be reused by tasks, press any key to close it.