USB mass storage for the NRF7002DK development board using on board chip

Hello everyone,

As the title suggests, we're trying to get the on board flash (mx25r64 as far as I can tell) of the nrf7002dk devboard working as a USB mass storage device (should be visible when connecting to Windows and MacOS).

Doing a bit of googling, I've found that a good starting point is the sample from:

/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/

I started from there and tried various bits and pieces from different posts in the Nordic DevZone to try and get it working. Sadly it doesn't wanna yield and the most common error is either the partition manager not recognising the label put in the overlay or something else related to the partition manager not accepting/ initialising the disk.

Latest build log:

root@Tudors-MacBook mass # west build -b nrf7002dk/nrf5340/cpuapp/ns --pristine
-- west build: making build dir /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build pristine
-- west build: generating a build system
Loading Zephyr module(s) (Zephyr base): sysbuild_default
-- Found Python3: /opt/homebrew/opt/[email protected]/bin/python3.13 (found suitable version "3.13.3", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /Users/tudor/Library/Caches/zephyr
-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
-- Board: nrf7002dk, qualifiers: nrf5340/cpuapp/ns
Parsing /opt/nordic/ncs/v3.0.0/zephyr/share/sysbuild/Kconfig
Loaded configuration '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild/empty.conf'
Merged configuration '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/sysbuild.conf'
Configuration saved to '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/zephyr/.config'
Kconfig header saved to '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild/autoconf.h'
--
   **************************
   * Running CMake for mass *
   **************************

Loading Zephyr default modules (Zephyr base).
-- Application: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass
-- CMake version: 4.0.2
-- Found Python3: /opt/homebrew/bin/python3 (found suitable version "3.13.3", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /Users/tudor/Library/Caches/zephyr
-- Zephyr version: 4.0.99 (/opt/nordic/ncs/v3.0.0/zephyr)
-- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
-- Board: nrf7002dk, qualifiers: nrf5340/cpuapp/ns
-- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
-- Found host-tools: zephyr 0.17.0 (/Users/tudor/zephyr-sdk-0.17.0)
-- Found toolchain: zephyr 0.17.0 (/Users/tudor/zephyr-sdk-0.17.0)
-- Could NOT find Dtc (missing: DTC) (Required is at least version "1.4.6")
Hint: The project() command has not yet been called.  It sets up system-specific search paths.
-- Found BOARD.dts: /opt/nordic/ncs/v3.0.0/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts
-- Found devicetree overlay: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/boards/nrf7002dk_nrf5340_cpuapp_ns.overlay
-- Generated zephyr.dts: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/zephyr.dts
-- Generated pickled edt: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/edt.pickle
-- Generated zephyr.dts: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/zephyr.dts
-- Generated devicetree_generated.h: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr/devicetree_generated.h
-- Including generated dts.cmake file: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/dts.cmake

warning: DISK_DRIVER_SDMMC (defined at
boards/shields/adafruit_2_8_tft_touch_v2/Kconfig.defconfig:37, drivers/disk/Kconfig.sdmmc:7) was
assigned the value 'y' but got the value 'n'. Check these unsatisfied dependencies: ((DISK_DRIVERS
&& (SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2 || SHIELD_ADAFRUIT_2_8_TFT_TOUCH_V2_NANO)) ||
((DT_HAS_ZEPHYR_SDMMC_DISK_ENABLED || DT_HAS_ST_STM32_SDMMC_ENABLED) && DISK_DRIVERS)) (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_DISK_DRIVER_SDMMC and/or look up
DISK_DRIVER_SDMMC in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: NORDIC_QSPI_NOR (defined at /opt/nordic/ncs/v3.0.0/nrf/Kconfig.nrf:95,
drivers/flash/Kconfig.nordic_qspi_nor:4) was assigned the value 'y' but got the value 'n'. See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NORDIC_QSPI_NOR and/or look up
NORDIC_QSPI_NOR in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.


warning: SDMMC_STM32_HWFC (defined at drivers/disk/Kconfig.sdmmc:47) was assigned the value 'y' but
got the value 'n'. Check these unsatisfied dependencies: SDMMC_STM32 (=n), (SOC_SERIES_STM32H5X ||
SOC_SERIES_STM32H7X || SOC_SERIES_STM32F7X || SOC_SERIES_STM32L4X || SOC_SERIES_STM32L5X) (=n),
DISK_DRIVER_SDMMC (=n). See
http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_SDMMC_STM32_HWFC and/or look up
SDMMC_STM32_HWFC in the menuconfig/guiconfig interface. The Application Development Primer, Setting
Configuration Values, and Kconfig - Tips and Best Practices sections of the manual might be helpful
too.

Parsing /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/Kconfig
Loaded configuration '/opt/nordic/ncs/v3.0.0/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig'
Merged configuration '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/prj.conf'
Merged configuration '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/boards/nrf7002dk_nrf5340_cpuapp_ns.conf'
Merged configuration '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/.config.sysbuild'
Configuration saved to '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/.config'
Kconfig header saved to '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr/autoconf.h'
-- Found GnuLd: /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
CMake Warning at /opt/nordic/ncs/v3.0.0/zephyr/subsys/usb/device/CMakeLists.txt:22 (message):
  CONFIG_USB_DEVICE_VID has default value 0x2FE3.

  This value is only for testing and MUST be configured for USB products.


=========== Generating psa_crypto_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: False
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: False
=========== End psa_crypto_config ===============
=========== Generating psa_crypto_library_config ===============
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Backup: CONFIG_MBEDTLS_THREADING: False
Backup: CONFIG_MBEDTLS_THREADING_ALT: False
=========== Checkpoint: backup ===============
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
Restore: CONFIG_MBEDTLS_THREADING: False
Restore: CONFIG_MBEDTLS_THREADING_ALT: False
=========== End psa_crypto_library_config ===============
-- Using ccache: /opt/homebrew/bin/ccache
-- Configuring done (5.7s)
-- Generating done (0.4s)
-- Build files have been written to: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass
-- Found partition manager static configuration : /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/pm_static.yml
-- Configuring done (9.1s)
-- Generating done (0.0s)
-- Build files have been written to: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build
-- west build: building application
[5/10] Performing build step for 'mass'
[1/278] Preparing syscall dependency handling

[6/278] Generating include/generated/zephyr/version.h
-- Zephyr version: 4.0.99 (/opt/nordic/ncs/v3.0.0/zephyr), build: v4.0.99-ncs1
[8/278] Generating ../../tfm/CMakeCache.txt
-- Found Git: /usr/bin/git (found version "2.39.5 (Apple Git-154)")
-- The C compiler identification is GNU 12.2.0
-- The CXX compiler identification is GNU 12.2.0
-- The ASM compiler identification is GNU
-- Found assembler: /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
-- Found Python3: /opt/homebrew/bin/python3 (found version "3.13.3") found components: Interpreter
-- Found Python3: /opt/homebrew/bin/python3 (found suitable version "3.13.3", minimum required is "3.10") found components: Interpreter
-- Cache files will be written to: /Users/tudor/Library/Caches/zephyr
CMake Warning (dev) at /opt/nordic/ncs/v3.0.0/nrf/modules/trusted-firmware-m/tfm_boards/nrf5340_cpuapp/CMakeLists.txt:21 (install):
  Policy CMP0177 is not set: install() DESTINATION paths are normalized.  Run
  "cmake --help-policy CMP0177" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done (0.9s)
-- Generating done (0.1s)
-- Build files have been written to: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/tfm
[17/278] Performing build step for 'tfm'
[135/139] Linking C executable bin/tfm_s.axf
Memory region         Used Size  Region Size  %age Used
           FLASH:       32100 B        32 KB     97.96%
             RAM:       10404 B        32 KB     31.75%
[139/139] Linking C static library secure_fw/libtfm_s_veneers.a
[19/278] Performing install step for 'tfm'
-- Install configuration: "MinSizeRel"
----- Installing platform NS -----
[89/278] Building C object CMakeFiles/app.dir/src/main.c.obj
In file included from /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/src/main.c:29:
/opt/nordic/ncs/v3.0.0/nrf/include/flash_map_pm.h:37:17: warning: 'littlefs_storage' defined but not used [-Wunused-variable]
   37 | #define storage littlefs_storage
      |                 ^~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/fs/littlefs.h:91:35: note: in definition of macro 'FS_LITTLEFS_DECLARE_CUSTOM_CONFIG'
   91 |         static struct fs_littlefs name = {                                                \
      |                                   ^~~~
/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/src/main.c:30:1: note: in expansion of macro 'FS_LITTLEFS_DECLARE_DEFAULT_CONFIG'
   30 | FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(storage);
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/src/main.c:30:36: note: in expansion of macro 'storage'
   30 | FS_LITTLEFS_DECLARE_DEFAULT_CONFIG(storage);
      |                                    ^~~~~~~
[159/278] Building C object zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj
FAILED: zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj
ccache /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr -I/opt/nordic/ncs/v3.0.0/zephyr/include -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic/nrf53/. -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic/common/. -I/opt/nordic/ncs/v3.0.0/zephyr/subsys/usb/device -I/opt/nordic/ncs/v3.0.0/zephyr/drivers/usb/common/nrf_usbd_common/. -I/opt/nordic/ncs/v3.0.0/nrf/include -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/tfm/api_ns/interface/include -I/opt/nordic/ncs/v3.0.0/nrf/modules/trusted-firmware-m/. -I/opt/nordic/ncs/v3.0.0/nrf/include/tfm -I/opt/nordic/ncs/v3.0.0/nrf/tests/include -I/opt/nordic/ncs/v3.0.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v3.0.0/zephyr/modules/cmsis/. -I/opt/nordic/ncs/v3.0.0/nrf/modules/hal_nordic/. -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v3.0.0/zephyr/modules/hal_nordic/nrfx/. -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/generated/interface_nrf_security_psa -I/opt/nordic/ncs/v3.0.0/nrf/subsys/nrf_security/include -I/opt/nordic/ncs/v3.0.0/modules/crypto/oberon-psa-crypto/include -I/opt/nordic/ncs/v3.0.0/nrf/subsys/nrf_security/src/utils -I/opt/nordic/ncs/v3.0.0/modules/crypto/oberon-psa-crypto/library -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/library -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/include -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/include/library -I/opt/nordic/ncs/v3.0.0/nrfxlib/crypto/nrf_oberon/include -I/opt/nordic/ncs/v3.0.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -isystem /opt/nordic/ncs/v3.0.0/zephyr/lib/libc/common/include -Wshadow -fno-strict-aliasing -Os -imacros /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr/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=/Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v3.0.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=/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v3.0.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v3.0.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 /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c
/opt/nordic/ncs/v3.0.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)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c: In function 'PM_FOREACH_AFFILIATED_TO_disk':
/opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:572:30: error: storage class specified for parameter 'flash_disks'
  572 | static struct flashdisk_data flash_disks[] = {
      |                              ^~~~~~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:572:15: error: parameter 'flash_disks' is initialized
  572 | static struct flashdisk_data flash_disks[] = {
      |               ^~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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)
      |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:573:39: note: each undeclared identifier is reported only once for each function it appears in
/opt/nordic/ncs/v3.0.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 /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/gcc.h:98,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain.h:50,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/sys/__assert.h:11,
                 from /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:10:
/opt/nordic/ncs/v3.0.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)
      |                                            ^~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
  137 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/opt/nordic/ncs/v3.0.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)
      |                                    ^~~~~~~
/opt/nordic/ncs/v3.0.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_)},                \
      |                 ^~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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)
      |         ^~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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);
      | ^~~~~~~~
/opt/nordic/ncs/v3.0.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)                                      \
      |                                          ^~~~~~~~~~
/opt/nordic/ncs/v3.0.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
      |                                                       ^~~~
/opt/nordic/ncs/v3.0.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)
      |         ^~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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);
      | ^~~~~~~~
/opt/nordic/ncs/v3.0.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)
      |                                            ^~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
  137 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/opt/nordic/ncs/v3.0.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)
      |                                    ^~~~~~~
/opt/nordic/ncs/v3.0.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_)},                \
      |                 ^~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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)
      |         ^~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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);
      | ^~~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/init.h:239:42: warning: 'used' attribute ignored [-Wattributes]
  239 |         static const Z_DECL_ALIGN(struct init_entry)                                      \
      |                                          ^~~~~~~~~~
/opt/nordic/ncs/v3.0.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
      |                                                       ^~~~
/opt/nordic/ncs/v3.0.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)
      |         ^~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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);
      | ^~~~~~~~
/opt/nordic/ncs/v3.0.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)
      |                                            ^~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
  137 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/opt/nordic/ncs/v3.0.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)
      |                                    ^~~~~~~
/opt/nordic/ncs/v3.0.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_)},                \
      |                 ^~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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)
      |         ^~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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 /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/device.h:13,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/sw_isr_table.h:18,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/irq.h:19,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/arch.h:24,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/cpu.h:19,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/kernel_includes.h:36,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/kernel.h:17,
                 from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/drivers/disk.h:30,
                 from /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:12:
/opt/nordic/ncs/v3.0.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);
      |          ^~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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_)},                \
      |                                                                ^~~~~~~~
/opt/nordic/ncs/v3.0.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);
      | ^~~~~~~~
/opt/nordic/ncs/v3.0.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)
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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)
      |                                            ^~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
  137 | #define _DO_CONCAT(x, y) x ## y
      |                          ^
/opt/nordic/ncs/v3.0.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)
      |                                    ^~~~~~~
/opt/nordic/ncs/v3.0.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_)},                \
      |                 ^~~~~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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)
      |         ^~~~~~~~~~~~~~
/opt/nordic/ncs/v3.0.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);
      | ^~~~~~~~
/opt/nordic/ncs/v3.0.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[] = {
      |                              ^~~~~~~~~~~
/opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613: error: expected '{' at end of input
/opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613: warning: control reaches end of non-void function [-Wreturn-type]
/opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c: At top level:
/opt/nordic/ncs/v3.0.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: some warnings being treated as errors
[168/278] Building C object zephyr/drivers/usb/device/CMakeFiles/drivers__usb__device.dir/usb_dc_nrfx.c.obj
ninja: build stopped: subcommand failed.
FAILED: _sysbuild/sysbuild/images/mass-prefix/src/mass-stamp/mass-build /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild/sysbuild/images/mass-prefix/src/mass-stamp/mass-build
cd /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass && /opt/homebrew/bin/cmake --build .
ninja: build stopped: subcommand failed.
FATAL ERROR: command exited with status 1: /opt/homebrew/bin/cmake --build /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build

The whole sample project folder: 

8686.mass.zip

Any and all help is gladly welcome! :)

Parents
  • Hey Tudor Slight smile

    Like all zephyr samples this might not work immediately on an nRF, but typically does after some configuration. Could you have a look at this previous case about it?

    Regards,

    Elfving

  • Finished trying it; didn't work.

    Whole folder with the changes from that ticket:

     2260.mass.zip

    Logs when trying to build it:

    root@admins-MacBook-Air-2 mass #
    root@admins-MacBook-Air-2 mass #
    root@admins-MacBook-Air-2 mass #
    root@admins-MacBook-Air-2 mass # west build -b nrf7002dk/nrf5340/cpuapp/ns --pristine
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /opt/homebrew/opt/[email protected]/bin/python3.13 (found suitable version "3.13.3", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /Users/tudor/Library/Caches/zephyr
    -- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
    -- Board: nrf7002dk, qualifiers: nrf5340/cpuapp/ns
    Parsing /opt/nordic/ncs/v3.0.0/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/zephyr/.config'
    No change to configuration in '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/zephyr/.config'
    No change to Kconfig header in '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild/autoconf.h'
    --
       **************************
       * Running CMake for mass *
       **************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass
    -- CMake version: 4.0.2
    -- Found Python3: /opt/homebrew/bin/python3 (found suitable version "3.13.3", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /Users/tudor/Library/Caches/zephyr
    -- Zephyr version: 4.0.99 (/opt/nordic/ncs/v3.0.0/zephyr)
    -- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
    -- Board: nrf7002dk, qualifiers: nrf5340/cpuapp/ns
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found host-tools: zephyr 0.17.0 (/Users/tudor/zephyr-sdk-0.17.0)
    -- Found toolchain: zephyr 0.17.0 (/Users/tudor/zephyr-sdk-0.17.0)
    -- Could NOT find Dtc (missing: DTC) (Required is at least version "1.4.6")
    Hint: The project() command has not yet been called.  It sets up system-specific search paths.
    -- Found BOARD.dts: /opt/nordic/ncs/v3.0.0/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns.dts
    -- Generated zephyr.dts: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/zephyr.dts
    -- Generated pickled edt: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/edt.pickle
    -- Generated zephyr.dts: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/dts.cmake
    Parsing /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/Kconfig
    Loaded configuration '/opt/nordic/ncs/v3.0.0/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp_ns_defconfig'
    Merged configuration '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/prj.conf'
    Merged configuration '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/.config.sysbuild'
    Configuration saved to '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/.config'
    Kconfig header saved to '/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    CMake Warning at /opt/nordic/ncs/v3.0.0/zephyr/subsys/usb/device/CMakeLists.txt:22 (message):
      CONFIG_USB_DEVICE_VID has default value 0x2FE3.
    
      This value is only for testing and MUST be configured for USB products.
    
    
    =========== Generating psa_crypto_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: False
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PLATFORM_SETUP_TEARDOWN_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: False
    =========== End psa_crypto_config ===============
    =========== Generating psa_crypto_library_config ===============
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Backup: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Backup: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Backup: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Backup: CONFIG_MBEDTLS_THREADING: False
    Backup: CONFIG_MBEDTLS_THREADING_ALT: False
    =========== Checkpoint: backup ===============
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_C: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER: False
    Restore: CONFIG_MBEDTLS_PSA_CRYPTO_SPM: False
    Restore: CONFIG_MBEDTLS_USE_PSA_CRYPTO: True
    Restore: CONFIG_MBEDTLS_PLATFORM_PRINTF_ALT: False
    Restore: CONFIG_MBEDTLS_THREADING: False
    Restore: CONFIG_MBEDTLS_THREADING_ALT: False
    =========== End psa_crypto_library_config ===============
    -- Using ccache: /opt/homebrew/bin/ccache
    CMake Warning at /opt/nordic/ncs/v3.0.0/zephyr/CMakeLists.txt:1002 (message):
      No SOURCES given to Zephyr library: drivers__disk
    
      Excluding target from build.
    
    
    -- Configuring done (4.0s)
    -- Generating done (0.2s)
    -- Build files have been written to: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass
    Dropping partition 'nonsecure_storage' since it is empty.
    -- Configuring done (5.8s)
    -- Generating done (0.0s)
    -- Build files have been written to: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build
    -- west build: building application
    [5/10] Performing build step for 'mass'
    [1/258] Preparing syscall dependency handling
    
    [6/258] Generating include/generated/zephyr/version.h
    -- Zephyr version: 4.0.99 (/opt/nordic/ncs/v3.0.0/zephyr), build: v4.0.99-ncs1
    [7/258] Generating ../../tfm/CMakeCache.txt
    -- Found Git: /usr/bin/git (found version "2.39.5 (Apple Git-154)")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Found Python3: /opt/homebrew/bin/python3 (found version "3.13.3") found components: Interpreter
    -- Found Python3: /opt/homebrew/bin/python3 (found suitable version "3.13.3", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /Users/tudor/Library/Caches/zephyr
    CMake Warning (dev) at /opt/nordic/ncs/v3.0.0/nrf/modules/trusted-firmware-m/tfm_boards/nrf5340_cpuapp/CMakeLists.txt:21 (install):
      Policy CMP0177 is not set: install() DESTINATION paths are normalized.  Run
      "cmake --help-policy CMP0177" for policy details.  Use the cmake_policy
      command to set the policy and suppress this warning.
    This warning is for project developers.  Use -Wno-dev to suppress it.
    
    -- Configuring done (0.6s)
    -- Generating done (0.0s)
    -- Build files have been written to: /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/tfm
    [12/258] Performing build step for 'tfm'
    [135/139] Linking C executable bin/tfm_s.axf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       32100 B        32 KB     97.96%
                 RAM:       10404 B        32 KB     31.75%
    [139/139] Linking C static library secure_fw/libtfm_s_veneers.a
    [19/258] Performing install step for 'tfm'
    -- Install configuration: "MinSizeRel"
    ----- Installing platform NS -----
    [88/258] Building C object CMakeFiles/app.dir/src/main.c.obj
    FAILED: CMakeFiles/app.dir/src/main.c.obj
    ccache /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DTFM_PSA_API -DUSE_PARTITION_MANAGER=1 -DZEPHYR_CONFIG_OVERRIDE=zephyr_fatfs_config.h -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR__=1 -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/common -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/tfm/api_ns/interface/include -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr -I/opt/nordic/ncs/v3.0.0/zephyr/include -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic/nrf53/. -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic/common/. -I/opt/nordic/ncs/v3.0.0/zephyr/subsys/usb/device -I/opt/nordic/ncs/v3.0.0/zephyr/drivers/usb/common/nrf_usbd_common/. -I/opt/nordic/ncs/v3.0.0/nrf/include -I/opt/nordic/ncs/v3.0.0/nrf/modules/trusted-firmware-m/. -I/opt/nordic/ncs/v3.0.0/nrf/include/tfm -I/opt/nordic/ncs/v3.0.0/nrf/tests/include -I/opt/nordic/ncs/v3.0.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v3.0.0/zephyr/modules/cmsis/. -I/opt/nordic/ncs/v3.0.0/nrf/modules/hal_nordic/. -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v3.0.0/zephyr/modules/hal_nordic/nrfx/. -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/generated/interface_nrf_security_psa -I/opt/nordic/ncs/v3.0.0/nrf/subsys/nrf_security/include -I/opt/nordic/ncs/v3.0.0/modules/crypto/oberon-psa-crypto/include -I/opt/nordic/ncs/v3.0.0/nrf/subsys/nrf_security/src/utils -I/opt/nordic/ncs/v3.0.0/modules/crypto/oberon-psa-crypto/library -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/library -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/include -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/include/library -I/opt/nordic/ncs/v3.0.0/nrfxlib/crypto/nrf_oberon/include -I/opt/nordic/ncs/v3.0.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -I/opt/nordic/ncs/v3.0.0/zephyr/modules/fatfs -I/opt/nordic/ncs/v3.0.0/modules/fs/fatfs/include -isystem /opt/nordic/ncs/v3.0.0/zephyr/lib/libc/common/include -fno-strict-aliasing -Os -imacros /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr/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=/Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v3.0.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=/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v3.0.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v3.0.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 /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/src/main.c
    /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/src/main.c:36:2: error: #error No supported disk driver enabled
       36 | #error No supported disk driver enabled
          |  ^~~~~
    [99/258] Building C object zephyr/CMakeFiles/zephyr.dir/subsys/logging/log_core.c.obj
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/mass-prefix/src/mass-stamp/mass-build /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild/sysbuild/images/mass-prefix/src/mass-stamp/mass-build
    cd /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass && /opt/homebrew/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /opt/homebrew/bin/cmake --build /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build
    root@admins-MacBook-Air-2 mass #
    root@admins-MacBook-Air-2 mass #
    root@admins-MacBook-Air-2 mass #

  • I got it partially working:

    So the storage is presented as an USB Mass Storage device and has ~ the correct size: 8.4MB.

    Current state of project here:

    5582.mass.zip

    The key changes that enabled things:

    I added a "pm_static.yml" file to the root folder of the sample (in the "mass") directory. Contents of pm_static.yml:

    storage_partition:
      address: 0x0
      end_address: 0x800000
      region: external_flash
      size: 0x800000
      affiliation: disk
      extra_params:
        disk_name: "ZEPHYR"
        disk_cache_size: 4096
        disk_sector_size: 512
        disk_read_only: 0
      placement:
        before:
          - end

    Note: it's EXTREMELY important to name the file EXACTLY "pm_static.yml". I've spent around a day wondering why the Partition Manager wasn't detecting my file. The reason was that I copied a file named "partitions.yaml" from the /build directory and started editing it and somehow when I changed its name, it was "pm_static.yml " (an extra space at the end).

    Other notable changes were:
    - the overlay exposes the same disk name as pm_static.yml:

    / {
    	msc_disk0 {
    		compatible = "zephyr,flash-disk";
    		partition = <&storage_partition>;
    		disk-name = "ZEPHYR";
    		cache-size = <4096>;
            sector-size = <512>;
    	};
    };

    - I'm not sure if this truly matters or not, but the board's *.conf file also has the same name:

    CONFIG_MASS_STORAGE_DISK_NAME="ZEPHYR"

    Edit: forgot to add: things aren't completely solved since this volume is not formattable or usable in any way. The board's boot logs show that the file system is now somehow linked back to internal flash:

    [00:00:00.269,561] <inf> spi_nor: mx25r6435f@0: 8 MiBy flash
    *** Booting nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-a0e545cb437a ***
    [00:00:00.271,942] <inf> flashdisk: Initialize device ZEPHYR
    [00:00:00.271,942] <inf> flashdisk: offset 0, sector size 512, page size 4096, volume size 8388608
    Area 8 at 0xfc000 on flash-controller@39000 for 8192 bytes
    [00:00:00.275,573] <inf> littlefs: LittleFS version 2.9, disk version 2.1
    [00:00:00.275,756] <inf> littlefs: FS at flash-controller@39000:0xfc000 is 2 0x1000-byte blocks with 512 cycle
    [00:00:00.275,756] <inf> littlefs: partition sizes: rd 16 ; pr 16 ; ca 64 ; la 32
    Mount /lfs: 0
    /lfs: bsize = 16 ; frsize = 4096 ; blocks = 2 ; bfree = 0
    Files before write:
    /lfs opendir: 0
      F 9 test.txt
    End of files
    Read from file: 'hello1234'
    [00:00:00.329,681] <inf> main: The device is put in USB mass storage mode.
    

    Also, based on my understanding, LittleFS can run both a FS and the USB Mass Storage simultaneously, right? If that's so, would they coexist on the same partition or do they require separate partitions? Thinking

  • Hello Elfving,

    Are you still on the case? You haven't said anything in 14 days...

  • Hi Tudor, and I am deeply sorry about the delay on this case.

    First of all, in order to build the mass sample for the nRF7002DK you have to make some changes to the dts. This can be done by adding eg. this to an nrf7002dk_nrf5340_cpuapp.overlay file.

    /delete-node/ &storage_partition;
    
    &mx25r64 {
    	partitions {
    		compatible = "fixed-partitions";
    		#address-cells = <1>;
    		#size-cells = <1>;
    
    		storage_partition: partition@0 {
    			label = "storage";
    			reg = <0x00000000 0x00020000>;
    		};
    	};
    };
    
    / {
    	msc_disk0 {
    		compatible = "zephyr,flash-disk";
    		partition = <&storage_partition>;
    		disk-name = "NAND";
    		cache-size = <4096>;
    	};
    };

    And remember not to build with sysbuild, which I believe is the default option with NCS>=3 (ie. implied when you select default instead of sysbuild), as this zephyr sample wasn't made with multi-core in mind. 

    Tudor B. said:

    Finished trying it; didn't work.

    I believe that was what you were lacking in your first comment here, though I'm not sure.

    Tudor B. said:

    I found the "LittleFS Example" section and that is exactly what we want since we'd like the LittleFS file system also. Although I don't have an nrf52840dk on hand, I decided to build for it since it had an *.overlay already set up in the sample folder, so it should work.

    I got the impression that littleFS wouldn't be recognized by Windows and Mac, and that is the end goal right? So I guess FATfs is better. I guess that is what you've figured out here, though I am surprised to see that you did get it to work with. I would rather recommend FATfs, and there is configs for that here. Though if you've gotten littleFS working I guess that is fine. 

    Tudor B. said:
    Also, based on my understanding, LittleFS can run both a FS and the USB Mass Storage simultaneously, right? If that's so, would they coexist on the same partition or do they require separate partitions?

    I am not sure, though do you have a use-case for you needing both here?

    Regards,

    Elfving

  • Currently our architect and CEO are pushing for LittleFS for both File System and USB Mass Storage since it's more reliable and has error correction (theoretically). There's something called LittleFS FUSE that helps OSes recognise disks that have the LittleFS File System. I've played with it a bit but at this point I'm not sure if LFS FUSE ain't working correctly or if my config of the sample project is erroneous so LFS FUSE won't read the disk correctly.

    That aside, if you have a proposal that combats LFS for both FS and USB Mass Storage, then I can present your argument to my superiors and maybe we can switch to something that's much easier to set up and just as good. WinkGrin

  • Hey Elfving,

    Today our architect convened that we try the FATFS route. Sadly that didn't work.

    Initially I tried following the example from the link that you gave and adapt it to my board (empty the *.conf file, leave just the suggested changes in the *.overlay file). -> failed since no disk was exposed towards the partition manager:

    [88/206] Building C object zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj
    FAILED: zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj
    ccache /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr -I/opt/nordic/ncs/v3.0.0/zephyr/include -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic/nrf53/. -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic/common/. -I/opt/nordic/ncs/v3.0.0/zephyr/subsys/usb/device -I/opt/nordic/ncs/v3.0.0/zephyr/subsys/settings/include -I/opt/nordic/ncs/v3.0.0/zephyr/drivers/usb/common/nrf_usbd_common/. -I/opt/nordic/ncs/v3.0.0/nrf/include -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/tfm/api_ns/interface/include -I/opt/nordic/ncs/v3.0.0/nrf/subsys/settings/include -I/opt/nordic/ncs/v3.0.0/nrf/modules/trusted-firmware-m/. -I/opt/nordic/ncs/v3.0.0/nrf/include/tfm -I/opt/nordic/ncs/v3.0.0/nrf/tests/include -I/opt/nordic/ncs/v3.0.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v3.0.0/zephyr/modules/cmsis/. -I/opt/nordic/ncs/v3.0.0/nrf/modules/hal_nordic/. -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v3.0.0/zephyr/modules/hal_nordic/nrfx/. -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/input_files -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/generated/interface_nrf_security_psa -I/opt/nordic/ncs/v3.0.0/nrf/subsys/nrf_security/include -I/opt/nordic/ncs/v3.0.0/modules/crypto/oberon-psa-crypto/include -I/opt/nordic/ncs/v3.0.0/nrf/subsys/nrf_security/src/utils -I/opt/nordic/ncs/v3.0.0/modules/crypto/oberon-psa-crypto/library -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/library -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/include -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/include/library -I/opt/nordic/ncs/v3.0.0/nrfxlib/crypto/nrf_oberon/include -I/opt/nordic/ncs/v3.0.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -isystem /opt/nordic/ncs/v3.0.0/zephyr/lib/libc/common/include -Wshadow -fno-strict-aliasing -Os -imacros /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr/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=/Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v3.0.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=/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v3.0.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v3.0.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 /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c
    /opt/nordic/ncs/v3.0.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)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c: In function 'PM_FOREACH_AFFILIATED_TO_disk':
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:572:30: error: storage class specified for parameter 'flash_disks'
      572 | static struct flashdisk_data flash_disks[] = {
          |                              ^~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:572:15: error: parameter 'flash_disks' is initialized
      572 | static struct flashdisk_data flash_disks[] = {
          |               ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:573:39: note: each undeclared identifier is reported only once for each function it appears in
    /opt/nordic/ncs/v3.0.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 /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/gcc.h:98,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain.h:50,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/sys/__assert.h:11,
                     from /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:10:
    /opt/nordic/ncs/v3.0.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)
          |                                            ^~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v3.0.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)
          |                                    ^~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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)                                      \
          |                                          ^~~~~~~~~~
    /opt/nordic/ncs/v3.0.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
          |                                                       ^~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |                                            ^~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v3.0.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)
          |                                    ^~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/init.h:239:42: warning: 'used' attribute ignored [-Wattributes]
      239 |         static const Z_DECL_ALIGN(struct init_entry)                                      \
          |                                          ^~~~~~~~~~
    /opt/nordic/ncs/v3.0.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
          |                                                       ^~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |                                            ^~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v3.0.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)
          |                                    ^~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    In file included from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/device.h:13,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/sw_isr_table.h:18,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/irq.h:19,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/arch.h:24,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/cpu.h:19,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/kernel_includes.h:36,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/kernel.h:17,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/drivers/disk.h:30,
                     from /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:12:
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:10: error: 'disk_flash_init' undeclared (first use in this function)
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          |          ^~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                                                                ^~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |                                            ^~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v3.0.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)
          |                                    ^~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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[] = {
          |                              ^~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:614: error: expected '{' at end of input
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:614: warning: control reaches end of non-void function [-Wreturn-type]
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c: At top level:
    /opt/nordic/ncs/v3.0.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: some warnings being treated as errors
    [99/206] Building C object zephyr/drivers/usb/device/CMakeFiles/drivers__usb__device.dir/usb_dc_nrfx.c.obj
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/mass-prefix/src/mass-stamp/mass-build /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild/sysbuild/images/mass-prefix/src/mass-stamp/mass-build
    cd /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass && /opt/homebrew/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: re-build in /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build failed (no --build-dir given)

    I then enabled my pm_static.yml:

    storage_partition:
      address: 0x0
      end_address: 0x800000
      device: MX25R64
      region: external_flash
      size: 0x800000
      affiliation: disk
      extra_params:
        disk_name: "ZEPHYR"
        disk_cache_size: 4096
        disk_sector_size: 512
        disk_read_only: 0
      placement:
        before:
          - end

    But still that generated no positive result:

    [00:00:00.439,331] <inf> spi_nor: mx25r6435f@0: 8 MiBy flash
    *** Booting nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-a0e545cb437a ***
    [00:00:00.441,711] <inf> flashdisk: Initialize device ZEPHYR
    [00:00:00.441,711] <inf> flashdisk: offset 0, sector size 512, page size 4096, volume size 8388608
    Area 6 at 0xfc000 on flash-controller@39000 for 8192 bytes
    [00:00:00.445,343] <err> fs: fs mount error (-5)
    [00:00:00.445,343] <err> main: Failed to mount filesystem
    [00:00:00.445,587] <inf> main: The device is put in USB mass storage mode.

    The disk exposed towards MacOS is just like the disk created with LittleFS: disk is 8Mb, visible, inaccessible, unformattable, and Zephyr is still pointing towards the internal memory.

    In the meantime, I discovered the command:

    west build -t partition_manager_report

    Which yields some interesting information:

    root@admins-MacBook-Air-2 mass # west build -t partition_manager_report
    -- west build: running target partition_manager_report
    [1/1] cd /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild && /opt/homebrew/opt/py...n_manager_report.py --input /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/partitions.yml
      external_flash (0x800000 - 8192kB):
    +--------------------------------------------+
    | 0x0: storage_partition (0x800000 - 8192kB) |
    | 0x800000: external_flash (0x0 - 0B)        |
    +--------------------------------------------+
    
      flash_primary (0x100000 - 1024kB):
    +---------------------------------------------+
    +---0x0: tfm_secure (0x8000 - 32kB)-----------+
    | 0x0: tfm (0x8000 - 32kB)                    |
    +---0x8000: tfm_nonsecure (0xf4000 - 976kB)---+
    | 0x8000: app (0xf4000 - 976kB)               |
    +---0xfc000: nonsecure_storage (0x2000 - 8kB)-+
    | 0xfc000: settings_storage (0x2000 - 8kB)    |
    +---------------------------------------------+
    | 0xfe000: EMPTY_0 (0x2000 - 8kB)             |
    +---------------------------------------------+
    
      otp (0x2fc - 764B):
    +------------------------------+
    | 0xff8100: otp (0x2fc - 764B) |
    +------------------------------+
    
      sram_primary (0x80000 - 512kB):
    +------------------------------------------------+
    +---0x20000000: sram_secure (0x8000 - 32kB)------+
    | 0x20000000: tfm_sram (0x8000 - 32kB)           |
    +---0x20008000: sram_nonsecure (0x78000 - 480kB)-+
    | 0x20008000: sram_primary (0x68000 - 416kB)     |
    | 0x20070000: rpmsg_nrf53_sram (0x10000 - 64kB)  |
    +------------------------------------------------+

    Based on the partition_manager_report and the board's bootup log, the area allocated as the external storage is:

    +---0xfc000: nonsecure_storage (0x2000 - 8kB)-+
    | 0xfc000: settings_storage (0x2000 - 8kB)    |

    Which is very strange and completely out of sync with the mx25r64.

    I then decided that probably I did something wrong, so I went 100% with the example and built for the adafruit_feather_nrf52840_sense. Sadly, the results were even worse:

    root@admins-MacBook-Air-2 mass # west build -b adafruit_feather_nrf52840_sense -- -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /opt/homebrew/opt/[email protected]/bin/python3.13 (found suitable version "3.13.3", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /Users/tudor/Library/Caches/zephyr
    -- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
    No board named 'adafruit_feather_nrf52840_sense' found.
    
    Please choose one of the following boards:
    
    thingy91
    nrf7120pdk
    nrf52kbd
    thingy91x
    nrf52833dongle
    nrf52840gmouse
    nrf54lm20apdk
    nrf54lv10apdk
    nrf52820dongle
    nrf52dmouse
    samr34_xpro
    samc21n_xpro
    same54_xpro
    saml21_xpro
    samd21_xpro
    samd20_xpro
    samr21_xpro
    sam_e70_xplained
    sam_v71_xult
    sam4l_ek
    sam4s_xplained
    sam4e_xpro
    wio_terminal
    lora_e5_mini
    xiao_esp32c3
    lora_e5_dev_board
    xiao_ble
    xiao_rp2040
    xiao_esp32c6
    xiao_esp32s3
    seeeduino_xiao
    mercury_xu
    cc26x2r1_launchxl
    cc3220sf_launchxl
    cc1352p1_launchxl
    cc1352p7_lp
    msp_exp432p401r_launchxl
    sk_am62
    cc3235sf_launchxl
    cc1352r1_launchxl
    cc1352r_sensortag
    robokit1
    acrn
    acrn_ehl_crb
    gr716a_mini
    generic_leon3
    rpi_5
    rpi_4b
    rpi_pico
    rpi_pico2
    pan1770_evb
    pan1783_evb
    pan1783a_evb
    pan1783a_pa_evb
    pan1781_evb
    pan1780_evb
    pan1782_evb
    rv32m1_vega
    esp32_ethernet_kit
    esp32_devkitc_wrover
    esp8684_devkitm
    esp32c3_devkitm
    esp32c3_devkitc
    esp_wrover_kit
    esp32c3_rust
    esp32s2_saola
    esp32s3_devkitc
    esp32c6_devkitc
    esp32s3_devkitm
    esp32_devkitc_wroom
    esp32s2_devkitc
    esp32s3_eye
    contextualelectronics_abc
    odroid_go
    da1469x_dk_pro
    ek_ra4w1
    rcar_salvator_xs
    rcar_h3ulcb
    rcar_spider_s4
    ek_ra6e2
    ek_ra6m1
    ek_ra4m2
    ek_ra8d1
    ek_ra8m1
    fpb_ra6e2
    ek_ra4m3
    da14695_dk_usb
    ek_ra4e2
    rzg3s_smarc
    rzt2m_starter_kit
    ek_ra6m5
    ek_ra6m2
    mck_ra8t1
    ek_ra2a1
    ek_ra6m3
    ek_ra6m4
    fpb_ra6e1
    rcar_salvator_x
    particle_xenon
    nrf52_blenano2
    particle_argon
    nrf51_blenano
    particle_boron
    esp32c3_luatos_core
    esp32s3_luatos_core
    tlsr9518adk80d
    az3166_iotdevkit
    it8xxx2_evb
    it82xx2_evb
    pinetime_devkit0
    weact_stm32g431_core
    mini_stm32h743
    usb2canfdv1
    blackpill_f401cc
    blackpill_f401ce
    blackpill_f411ce
    weact_stm32f405_core
    mini_stm32h7b0
    bcm958402m2
    bcm958401m2
    esp32s2_lolin_mini
    slstk3401a
    slstk3402a
    slstk3701a
    slstk3400a
    efm32wg_stk3800
    xg24_ek2703a
    xg24_dk2601b
    sltb004a
    sltb009a
    sltb010a
    xg27_dk2602a
    sim3u1xx_dk
    xg23_rb4210a
    slwrb4161a
    slwrb4104a
    slwrb4170a
    slwrb4321a
    xg24_rb4187c
    slwrb4255a
    slwrb4250b
    slwrb4180a
    v2m_beetle
    fvp_base_revc_2xaemv8a
    v2m_musca_b1
    v2m_musca_s1
    fvp_baser_aemv8r
    mps3
    mps2
    acn52832
    ucan
    cyw920829m2evk_02
    xmc45_relax_kit
    cy8cproto_063_ble
    cy8ckit_062s2_ai
    cy8cproto_062_4343w
    xmc47_relax_kit
    cy8ckit_062s4
    cortex_r8_virtual
    riscv32_virtual
    adafruit_itsybitsy
    adafruit_feather_m0_basic_proto
    adafruit_feather_m4_express
    adafruit_feather_m0_lora
    adafruit_trinket_m0
    adafruit_kb2040
    adafruit_feather_nrf52840
    nrf52_adafruit_feather
    adafruit_itsybitsy_m4_express
    adafruit_qt_py_rp2040
    adafruit_qt_py_esp32s3
    adafruit_grand_central_m4_express
    adafruit_feather_stm32f405
    sgrm
    nrf52_sparkfun
    sparkfun_thing_plus_matter_mgm240p
    micromod
    sparkfun_thing_plus
    sparkfun_red_v_things_plus
    sparkfun_pro_micro_rp2040
    gd32vf103v_eval
    gd32vf103c_starter
    gd32e507v_start
    gd32e103v_eval
    gd32a503v_eval
    gd32f403z_eval
    gd32f450i_eval
    gd32f470i_eval
    gd32f407v_start
    gd32e507z_eval
    gd32f450z_eval
    gd32f350r_eval
    gd32l233r_eval
    gd32f450v_start
    ast1030_evb
    ip_k66f
    segger_trb_stm32f407
    altera_max10
    blueclover_plt_demo_v2
    nrf52840_blip
    nrf52840_papyr
    w5500_evb_pico
    npcx7m6fb_evb
    npcm400_evb
    numaker_pfm_m467
    npcx9m6f_evb
    numaker_m2l31ki
    npcx4m8f_evb
    numaker_pfm_m487
    nrf51_vbluno51
    nrf52_vbluno52
    up_squared
    up_squared_pro_7000
    qemu_kvm_arm64
    qemu_riscv64
    qemu_riscv32_xip
    qemu_xtensa
    qemu_cortex_m3
    qemu_cortex_a9
    qemu_riscv32e
    qemu_cortex_r5
    qemu_cortex_a53
    qemu_riscv32
    qemu_x86
    qemu_x86_lakemont
    qemu_x86_64
    qemu_x86_tiny
    qemu_cortex_m0
    qemu_leon3
    qemu_malta
    qemu_arc
    qemu_nios2
    waveshare_open103z
    nrf51_ble400
    rp2040_zero
    esp32s3_touch_lcd_1_28
    dragino_nbsn95
    dragino_lsn50
    teensy40
    teensy41
    mec172xevb_assy6906
    mpfs_icicle
    m2gl025_miv
    mec1501modular_assy6885
    mec172xmodular_assy6930
    mec15xxevb_assy6853
    ev11l78a
    kb1200_evb
    apollo3_evb
    apollo4p_blue_kxr_evb
    apollo4p_evb
    apollo3p_evb
    m5stack_atoms3_lite
    m5stack_atoms3
    m5stack_core2
    m5stack_cores3
    m5stack_atom_lite
    m5stack_stamps3
    stamp_c3
    m5stickc_plus
    ganymed_bob
    udoo_neo_full
    pico_pi
    arduino_nicla_sense_me
    arduino_nicla_vision
    arduino_portenta_h7
    arduino_due
    arduino_nano_33_ble
    arduino_zero
    arduino_opta
    arduino_giga_r1
    arduino_mkrzero
    arduino_nano_33_iot
    arduino_uno_r4_minima
    arduino_uno_r4_wifi
    ruuvi_ruuvitag
    esp32s2_franzininho
    acp_6_0_adsp
    kv260_r5
    mm_feather
    mm_swiftio
    mks_canable_v20
    nucleo_l4r5zi
    nucleo_f031k6
    nucleo_f030r8
    nucleo_f334r8
    stm32l496g_disco
    nucleo_l011k4
    b_g474e_dpow1
    stm32f413h_disco
    stm32f7508_dk
    nucleo_f091rc
    stm32u083c_dk
    nucleo_l073rz
    stm32f746g_disco
    stm32f072_eval
    nucleo_f103rb
    nucleo_h533re
    stm32h573i_dk
    stm32f072b_disco
    nucleo_f446ze
    stm32f769i_disco
    stm32wb5mm_dk
    nucleo_l4a6zg
    nucleo_g031k8
    nucleo_f303re
    stm32f412g_disco
    stm32f429i_disc1
    nucleo_l031k6
    nucleo_g431rb
    nucleo_f413zh
    nucleo_wb09ke
    sensortile_box
    stm32mp157c_dk2
    nucleo_c031c6
    stm32c0116_dk
    nucleo_wb05kz
    steval_stwinbx1
    nucleo_l496zg
    nucleo_f207zg
    sensortile_box_pro
    stm32f723e_disco
    nucleo_l552ze_q
    nucleo_g071rb
    stm32wb5mmg
    nucleo_h7a3zi_q
    stm32373c_eval
    nucleo_f410rb
    nucleo_h563zi
    nucleo_f303k8
    nucleo_h723zg
    nucleo_f302r8
    nucleo_l433rc_p
    nucleo_l412rb_p
    nucleo_h7s3l8
    nucleo_g431kb
    nucleo_l152re
    nucleo_u575zi_q
    stm32l476g_disco
    stm32f469i_disco
    stm32g0316_disco
    stm32h745i_disco
    stm32f411e_disco
    nucleo_g474re
    nucleo_f756zg
    nucleo_h753zi
    stm32h7s78_dk
    nucleo_f412zg
    nucleo_f070rb
    nucleo_h745zi_q
    st25dv_mb1283_disco
    nucleo_f401re
    stm32h750b_dk
    nucleo_u031r8
    nucleo_l432kc
    nucleo_f411re
    nucleo_wb55rg
    nucleo_h755zi_q
    nucleo_f767zi
    nucleo_g070rb
    steval_fcu001v1
    stm32f3_disco
    nucleo_l452re
    nucleo_g0b1re
    nucleo_f429zi
    nucleo_f042k6
    disco_l475_iot1
    stm32h747i_disco
    nucleo_f746zg
    nucleo_wba52cg
    nucleo_h743zi
    stm32f4_disco
    stm32l4r9i_disco
    nucleo_h503rb
    stm32g071b_disco
    stm32u5a9j_dk
    nucleo_l053r8
    b_l072z_lrwan1
    stm32vl_disco
    stm3210c_eval
    nucleo_f446re
    nucleo_l476rg
    nucleo_u5a5zj_q
    stm32h7b3i_dk
    nucleo_wba55cg
    b_u585i_iot02a
    stm32l562e_dk
    stm32l1_disco
    stm32l152c_disco
    nucleo_u083rc
    stm32h735g_disco
    nucleo_c071rb
    stm32f0_disco
    b_l4s5i_iot01a
    nucleo_wl55jc
    nucleo_f722ze
    stm32g081b_eval
    khadas_edgev
    quick_feather
    qomu
    heltec_wireless_stick_lite_v3
    heltec_wifi_lora32_v2
    legend
    faze
    walter
    we_proteus2ev
    we_ophelia1ev
    we_orthosie1ev
    we_proteus3ev
    mt8195
    mt8186
    mt8188
    mt8196
    adp_xc7k
    beaglebone_ai64
    beaglev_fire
    beagleconnect_freedom
    beagleplay
    promicro_nrf52840
    candlelightfd
    stm32f103_mini
    stm32f030_demo
    candlelight
    stm32f401_mini
    icev_wireless
    stm32_min_dev
    esp32c3_supermini
    neorv32
    serpente
    black_f407zg_pro
    black_f407ve
    nrf52840_mdk_usb_dongle
    nrf52840_mdk
    nrf52832_mdk
    circuitdojo_feather
    visionfive2
    raytac_mdbt50q_db_33
    raytac_mdbt53v_db_40
    raytac_mdbt53_db_40
    raytac_mdbt50q_db_40
    litex_vexriscv
    croxel_cx1825
    pandora_stm32l475
    fk7b0m1_vbt6
    fk750m1_vbt6
    96b_meerkat96
    96b_neonkey
    96b_carbon
    96b_argonkey
    96b_nitrogen
    96b_aerocore2
    96b_stm32_sensor_mez
    96b_wistrio
    96b_avenger96
    ctcc
    titanium_ti60_f225
    warp7
    rak11720
    rak5010
    rak4631
    ch32v003evt
    mikroe_stm32_m4_clicker
    mikroe_mini_m4_for_stm32
    mikroe_clicker_ra4m1
    mikroe_clicker_2
    verdin_imx8mp
    verdin_imx8mm
    colibri_imx7d
    swan_r5
    google_twinkie_v2
    google_icetower
    google_dragonclaw
    bytesensi_l
    bbc_microbit
    bbc_microbit_v2
    ubx_bmd360eval
    ubx_evkannab1
    ubx_bmd300eval
    ubx_evkninab4
    ubx_evkninab3
    ubx_bmd330eval
    ubx_bmd380eval
    ubx_bmd340eval
    ubx_evkninab1
    ubx_bmd345eval
    opentitan_earlgrey
    ronoth_lodev
    ttgo_t8c3
    ttgo_t7v1_5
    ttgo_t8s3
    ttgo_lora32
    innblue21
    innblue22
    mg100
    bt610
    bl654_usb
    bt510
    bl653_dvk
    bl652_dvk
    bl5340_dvk
    bl654_dvk
    rm1xx_dvk
    pinnacle_100_dvk
    bl654_sensor_board
    actinius_icarus
    actinius_icarus_som_dk
    actinius_icarus_bee
    actinius_icarus_som
    hifive1
    hifive_unmatched
    hifive_unleashed
    native_sim
    native_posix
    nrf52_bsim
    nrf5340bsim
    nrf54l15bsim
    xt-sim
    holyiot_yj16019
    zybo
    arty_a7
    cy8ckit_062_wifi_bt
    cy8ckit_062_ble
    yd_stm32h750vb
    yd_esp32
    longan_nano
    imx8mm_evk
    mimxrt1020_evk
    ucans32k1sic
    frdm_k22f
    lpcxpresso51u68
    frdm_k82f
    lpcxpresso55s36
    mimxrt1180_evk
    vmu_rt1170
    imx8mn_evk
    twr_ke18f
    lpcxpresso55s06
    frdm_kl25z
    frdm_kw41z
    frdm_ke17z
    frdm_mcxc444
    lpcxpresso11u68
    mimxrt1024_evk
    imx95_evk
    rddrone_fmuk66
    twr_kv58f220m
    lpcxpresso54114
    frdm_mcxa156
    usb_kw24d512
    mimxrt1040_evk
    frdm_mcxn947
    frdm_ke17z512
    imx93_evk
    mimxrt1050_evk
    mimxrt1062_fmurt6
    frdm_k64f
    s32z2xxdc2
    mimxrt1060_evk
    mimxrt595_evk
    lpcxpresso55s69
    imx8qxp_mek
    mimxrt1064_evk
    frdm_mcxc242
    frdm_rw612
    mimxrt1015_evk
    mimxrt1160_evk
    frdm_ke15z
    imx8mp_evk
    imx8mq_evk
    ls1046ardb
    frdm_mcxw71
    hexiwear
    mr_canhubk3
    rd_rw612_bga
    lpcxpresso55s16
    frdm_mcxn236
    mimxrt685_evk
    imx8ulp_evk
    mimxrt1170_evk
    mimxrt1010_evk
    imx8qm_mek
    lpcxpresso55s28
    reel_board
    phyboard_pollux
    phyboard_polis
    phyboard_electra
    phyboard_nash
    phyboard_lyra
    kincony_kc868_a32
    linum
    apard32690
    max32672fthr
    max32666fthr
    max32672evkit
    max32690evkit
    max32662evkit
    max32655evkit
    max32680evkit
    max32675evkit
    max78002evkit
    adi_eval_adin2111ebz
    max32690fthr
    adi_eval_adin1110ebz
    max32666evkit
    adi_sdp_k1
    max32670evkit
    max32655fthr
    olimex_stm32_h103
    olimexino_stm32
    olimex_stm32_h407
    olimex_lora_stm32wl_devkit
    olimex_esp32_evb
    olimex_stm32_h405
    olimex_stm32_p405
    olimex_stm32_e407
    hsdk
    hsdk4xd
    emsdp
    iotdk
    em_starterkit
    nsim
    nsim_arc_v
    scobc_module1
    octopus_io_board
    octopus_som
    degu_evk
    stm32f3_seco_d23
    xenvm
    ebyte_e73_tbb
    thingy52
    nrf52833dk
    nrf54l15dk
    nrf54h20dk
    thingy53
    nrf5340_audio_dk
    nrf52dk
    nrf9151dk
    nrf54l20pdk
    nrf9160dk
    nrf51dk
    nrf9131ek
    nrf9161dk
    nrf52840dk
    nrf5340dk
    nrf52840dongle
    nrf21540dk
    nrf51dongle
    nrf9280pdk
    nrf54l09pdk
    nrf7002dk
    intel_ehl_crb
    intel_ish_5_4_1
    intel_ish_5_6_0
    intel_ish_5_8_0
    niosv_m
    intel_adl_crb
    intel_adl_rvp
    niosv_g
    intel_adsp
    intel_rpl_p_crb
    intel_rpl_s_crb
    cyclonev_socdk
    intel_socfpga_agilex_socdk
    intel_socfpga_agilex5_socdk
    decawave_dwm1001_dev
    decawave_dwm3001cdk
    roc_rk3568_pc
    rts5912_evb
    esp32c3_042_oled
    CMake Error at /opt/nordic/ncs/v3.0.0/zephyr/cmake/modules/boards.cmake:228 (message):
      Invalid BOARD; see above.
    Call Stack (most recent call first):
      cmake/modules/sysbuild_default.cmake:15 (include)
      /opt/nordic/ncs/v3.0.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /opt/nordic/ncs/v3.0.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /opt/nordic/ncs/v3.0.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: /opt/homebrew/bin/cmake -DWEST_PYTHON=/opt/homebrew/opt/[email protected]/bin/python3.13 -B/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build -GNinja -DBOARD=adafruit_feather_nrf52840_sense -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y -S/opt/nordic/ncs/v3.0.0/zephyr/share/sysbuild -DAPP_DIR:PATH=/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass
    which I suspect is because there's no *.dts for that board configuration.

    My main suspicion is that both the How To from the link and the mass storage sample itself are simply outdated. Main reason for this conclusion is the huge discrepancy between the Zephyr OS reported in the sample (*** Booting Zephyr OS build zephyr-v2.3.0-1991-g4c8d1496eafb ***) and the Zephyr OS reported when I flash the board (*** Using Zephyr OS v4.0.99-a0e545cb437a ***).

    Could you please prepare a working usb mass storage sample code for the nrf7002dk board that works out of the box for ncs v3.0.0 sdk and add it here as an archive?

    In parallel I'll keep tinkering with it. I think the partition_manager_report will be the key to finding a solution!

Reply
  • Hey Elfving,

    Today our architect convened that we try the FATFS route. Sadly that didn't work.

    Initially I tried following the example from the link that you gave and adapt it to my board (empty the *.conf file, leave just the suggested changes in the *.overlay file). -> failed since no disk was exposed towards the partition manager:

    [88/206] Building C object zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj
    FAILED: zephyr/drivers/disk/CMakeFiles/drivers__disk.dir/flashdisk.c.obj
    ccache /Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -DKERNEL -DK_HEAP_MEM_POOL_SIZE=0 -DMBEDTLS_CONFIG_FILE=\"nrf-config.h\" -DMBEDTLS_PSA_CRYPTO_CONFIG_FILE=\"nrf-psa-crypto-config.h\" -DNRF5340_XXAA_APPLICATION -DNRF_SKIP_FICR_NS_COPY_TO_RAM -DNRF_TRUSTZONE_NONSECURE -DPICOLIBC_LONG_LONG_PRINTF_SCANF -DUSE_PARTITION_MANAGER=1 -D__LINUX_ERRNO_EXTENSIONS__ -D__PROGRAM_START -D__ZEPHYR_SUPERVISOR__ -D__ZEPHYR__=1 -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr -I/opt/nordic/ncs/v3.0.0/zephyr/include -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic/nrf53/. -I/opt/nordic/ncs/v3.0.0/zephyr/soc/nordic/common/. -I/opt/nordic/ncs/v3.0.0/zephyr/subsys/usb/device -I/opt/nordic/ncs/v3.0.0/zephyr/subsys/settings/include -I/opt/nordic/ncs/v3.0.0/zephyr/drivers/usb/common/nrf_usbd_common/. -I/opt/nordic/ncs/v3.0.0/nrf/include -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/tfm/api_ns/interface/include -I/opt/nordic/ncs/v3.0.0/nrf/subsys/settings/include -I/opt/nordic/ncs/v3.0.0/nrf/modules/trusted-firmware-m/. -I/opt/nordic/ncs/v3.0.0/nrf/include/tfm -I/opt/nordic/ncs/v3.0.0/nrf/tests/include -I/opt/nordic/ncs/v3.0.0/modules/hal/cmsis/CMSIS/Core/Include -I/opt/nordic/ncs/v3.0.0/zephyr/modules/cmsis/. -I/opt/nordic/ncs/v3.0.0/nrf/modules/hal_nordic/. -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx/drivers/include -I/opt/nordic/ncs/v3.0.0/modules/hal/nordic/nrfx/mdk -I/opt/nordic/ncs/v3.0.0/zephyr/modules/hal_nordic/nrfx/. -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/input_files -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass -I/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/generated/interface_nrf_security_psa -I/opt/nordic/ncs/v3.0.0/nrf/subsys/nrf_security/include -I/opt/nordic/ncs/v3.0.0/modules/crypto/oberon-psa-crypto/include -I/opt/nordic/ncs/v3.0.0/nrf/subsys/nrf_security/src/utils -I/opt/nordic/ncs/v3.0.0/modules/crypto/oberon-psa-crypto/library -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/library -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/include -I/opt/nordic/ncs/v3.0.0/modules/crypto/mbedtls/include/library -I/opt/nordic/ncs/v3.0.0/nrfxlib/crypto/nrf_oberon/include -I/opt/nordic/ncs/v3.0.0/nrfxlib/crypto/nrf_oberon/include/mbedtls -isystem /opt/nordic/ncs/v3.0.0/zephyr/lib/libc/common/include -Wshadow -fno-strict-aliasing -Os -imacros /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass/zephyr/include/generated/zephyr/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=/Users/tudor/zephyr-sdk-0.17.0/arm-zephyr-eabi/arm-zephyr-eabi -imacros /opt/nordic/ncs/v3.0.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=/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass=CMAKE_SOURCE_DIR -fmacro-prefix-map=/opt/nordic/ncs/v3.0.0/zephyr=ZEPHYR_BASE -fmacro-prefix-map=/opt/nordic/ncs/v3.0.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 /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c
    /opt/nordic/ncs/v3.0.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)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c: In function 'PM_FOREACH_AFFILIATED_TO_disk':
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:572:30: error: storage class specified for parameter 'flash_disks'
      572 | static struct flashdisk_data flash_disks[] = {
          |                              ^~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:572:15: error: parameter 'flash_disks' is initialized
      572 | static struct flashdisk_data flash_disks[] = {
          |               ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |                                       ^~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:573:39: note: each undeclared identifier is reported only once for each function it appears in
    /opt/nordic/ncs/v3.0.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 /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/gcc.h:98,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain.h:50,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/sys/__assert.h:11,
                     from /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:10:
    /opt/nordic/ncs/v3.0.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)
          |                                            ^~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v3.0.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)
          |                                    ^~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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)                                      \
          |                                          ^~~~~~~~~~
    /opt/nordic/ncs/v3.0.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
          |                                                       ^~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |                                            ^~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v3.0.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)
          |                                    ^~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/init.h:239:42: warning: 'used' attribute ignored [-Wattributes]
      239 |         static const Z_DECL_ALIGN(struct init_entry)                                      \
          |                                          ^~~~~~~~~~
    /opt/nordic/ncs/v3.0.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
          |                                                       ^~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |                                            ^~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v3.0.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)
          |                                    ^~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    In file included from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/device.h:13,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/sw_isr_table.h:18,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/irq.h:19,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/arm/arch.h:24,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/arch/cpu.h:19,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/kernel_includes.h:36,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/kernel.h:17,
                     from /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/drivers/disk.h:30,
                     from /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:12:
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:10: error: 'disk_flash_init' undeclared (first use in this function)
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          |          ^~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                                                                ^~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |                                            ^~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/include/zephyr/toolchain/common.h:137:26: note: in definition of macro '_DO_CONCAT'
      137 | #define _DO_CONCAT(x, y) x ## y
          |                          ^
    /opt/nordic/ncs/v3.0.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)
          |                                    ^~~~~~~
    /opt/nordic/ncs/v3.0.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_)},                \
          |                 ^~~~~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.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)
          |         ^~~~~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:613:1: note: in expansion of macro 'SYS_INIT'
      613 | SYS_INIT(disk_flash_init, POST_KERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT);
          | ^~~~~~~~
    /opt/nordic/ncs/v3.0.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[] = {
          |                              ^~~~~~~~~~~
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:614: error: expected '{' at end of input
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c:614: warning: control reaches end of non-void function [-Wreturn-type]
    /opt/nordic/ncs/v3.0.0/zephyr/drivers/disk/flashdisk.c: At top level:
    /opt/nordic/ncs/v3.0.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: some warnings being treated as errors
    [99/206] Building C object zephyr/drivers/usb/device/CMakeFiles/drivers__usb__device.dir/usb_dc_nrfx.c.obj
    ninja: build stopped: subcommand failed.
    FAILED: _sysbuild/sysbuild/images/mass-prefix/src/mass-stamp/mass-build /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild/sysbuild/images/mass-prefix/src/mass-stamp/mass-build
    cd /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/mass && /opt/homebrew/bin/cmake --build .
    ninja: build stopped: subcommand failed.
    FATAL ERROR: re-build in /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build failed (no --build-dir given)

    I then enabled my pm_static.yml:

    storage_partition:
      address: 0x0
      end_address: 0x800000
      device: MX25R64
      region: external_flash
      size: 0x800000
      affiliation: disk
      extra_params:
        disk_name: "ZEPHYR"
        disk_cache_size: 4096
        disk_sector_size: 512
        disk_read_only: 0
      placement:
        before:
          - end

    But still that generated no positive result:

    [00:00:00.439,331] <inf> spi_nor: mx25r6435f@0: 8 MiBy flash
    *** Booting nRF Connect SDK v3.0.0-3bfc46578e42 ***
    *** Using Zephyr OS v4.0.99-a0e545cb437a ***
    [00:00:00.441,711] <inf> flashdisk: Initialize device ZEPHYR
    [00:00:00.441,711] <inf> flashdisk: offset 0, sector size 512, page size 4096, volume size 8388608
    Area 6 at 0xfc000 on flash-controller@39000 for 8192 bytes
    [00:00:00.445,343] <err> fs: fs mount error (-5)
    [00:00:00.445,343] <err> main: Failed to mount filesystem
    [00:00:00.445,587] <inf> main: The device is put in USB mass storage mode.

    The disk exposed towards MacOS is just like the disk created with LittleFS: disk is 8Mb, visible, inaccessible, unformattable, and Zephyr is still pointing towards the internal memory.

    In the meantime, I discovered the command:

    west build -t partition_manager_report

    Which yields some interesting information:

    root@admins-MacBook-Air-2 mass # west build -t partition_manager_report
    -- west build: running target partition_manager_report
    [1/1] cd /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/_sysbuild && /opt/homebrew/opt/py...n_manager_report.py --input /opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build/partitions.yml
      external_flash (0x800000 - 8192kB):
    +--------------------------------------------+
    | 0x0: storage_partition (0x800000 - 8192kB) |
    | 0x800000: external_flash (0x0 - 0B)        |
    +--------------------------------------------+
    
      flash_primary (0x100000 - 1024kB):
    +---------------------------------------------+
    +---0x0: tfm_secure (0x8000 - 32kB)-----------+
    | 0x0: tfm (0x8000 - 32kB)                    |
    +---0x8000: tfm_nonsecure (0xf4000 - 976kB)---+
    | 0x8000: app (0xf4000 - 976kB)               |
    +---0xfc000: nonsecure_storage (0x2000 - 8kB)-+
    | 0xfc000: settings_storage (0x2000 - 8kB)    |
    +---------------------------------------------+
    | 0xfe000: EMPTY_0 (0x2000 - 8kB)             |
    +---------------------------------------------+
    
      otp (0x2fc - 764B):
    +------------------------------+
    | 0xff8100: otp (0x2fc - 764B) |
    +------------------------------+
    
      sram_primary (0x80000 - 512kB):
    +------------------------------------------------+
    +---0x20000000: sram_secure (0x8000 - 32kB)------+
    | 0x20000000: tfm_sram (0x8000 - 32kB)           |
    +---0x20008000: sram_nonsecure (0x78000 - 480kB)-+
    | 0x20008000: sram_primary (0x68000 - 416kB)     |
    | 0x20070000: rpmsg_nrf53_sram (0x10000 - 64kB)  |
    +------------------------------------------------+

    Based on the partition_manager_report and the board's bootup log, the area allocated as the external storage is:

    +---0xfc000: nonsecure_storage (0x2000 - 8kB)-+
    | 0xfc000: settings_storage (0x2000 - 8kB)    |

    Which is very strange and completely out of sync with the mx25r64.

    I then decided that probably I did something wrong, so I went 100% with the example and built for the adafruit_feather_nrf52840_sense. Sadly, the results were even worse:

    root@admins-MacBook-Air-2 mass # west build -b adafruit_feather_nrf52840_sense -- -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /opt/homebrew/opt/[email protected]/bin/python3.13 (found suitable version "3.13.3", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /Users/tudor/Library/Caches/zephyr
    -- Found west (found suitable version "1.3.0", minimum required is "0.14.0")
    No board named 'adafruit_feather_nrf52840_sense' found.
    
    Please choose one of the following boards:
    
    thingy91
    nrf7120pdk
    nrf52kbd
    thingy91x
    nrf52833dongle
    nrf52840gmouse
    nrf54lm20apdk
    nrf54lv10apdk
    nrf52820dongle
    nrf52dmouse
    samr34_xpro
    samc21n_xpro
    same54_xpro
    saml21_xpro
    samd21_xpro
    samd20_xpro
    samr21_xpro
    sam_e70_xplained
    sam_v71_xult
    sam4l_ek
    sam4s_xplained
    sam4e_xpro
    wio_terminal
    lora_e5_mini
    xiao_esp32c3
    lora_e5_dev_board
    xiao_ble
    xiao_rp2040
    xiao_esp32c6
    xiao_esp32s3
    seeeduino_xiao
    mercury_xu
    cc26x2r1_launchxl
    cc3220sf_launchxl
    cc1352p1_launchxl
    cc1352p7_lp
    msp_exp432p401r_launchxl
    sk_am62
    cc3235sf_launchxl
    cc1352r1_launchxl
    cc1352r_sensortag
    robokit1
    acrn
    acrn_ehl_crb
    gr716a_mini
    generic_leon3
    rpi_5
    rpi_4b
    rpi_pico
    rpi_pico2
    pan1770_evb
    pan1783_evb
    pan1783a_evb
    pan1783a_pa_evb
    pan1781_evb
    pan1780_evb
    pan1782_evb
    rv32m1_vega
    esp32_ethernet_kit
    esp32_devkitc_wrover
    esp8684_devkitm
    esp32c3_devkitm
    esp32c3_devkitc
    esp_wrover_kit
    esp32c3_rust
    esp32s2_saola
    esp32s3_devkitc
    esp32c6_devkitc
    esp32s3_devkitm
    esp32_devkitc_wroom
    esp32s2_devkitc
    esp32s3_eye
    contextualelectronics_abc
    odroid_go
    da1469x_dk_pro
    ek_ra4w1
    rcar_salvator_xs
    rcar_h3ulcb
    rcar_spider_s4
    ek_ra6e2
    ek_ra6m1
    ek_ra4m2
    ek_ra8d1
    ek_ra8m1
    fpb_ra6e2
    ek_ra4m3
    da14695_dk_usb
    ek_ra4e2
    rzg3s_smarc
    rzt2m_starter_kit
    ek_ra6m5
    ek_ra6m2
    mck_ra8t1
    ek_ra2a1
    ek_ra6m3
    ek_ra6m4
    fpb_ra6e1
    rcar_salvator_x
    particle_xenon
    nrf52_blenano2
    particle_argon
    nrf51_blenano
    particle_boron
    esp32c3_luatos_core
    esp32s3_luatos_core
    tlsr9518adk80d
    az3166_iotdevkit
    it8xxx2_evb
    it82xx2_evb
    pinetime_devkit0
    weact_stm32g431_core
    mini_stm32h743
    usb2canfdv1
    blackpill_f401cc
    blackpill_f401ce
    blackpill_f411ce
    weact_stm32f405_core
    mini_stm32h7b0
    bcm958402m2
    bcm958401m2
    esp32s2_lolin_mini
    slstk3401a
    slstk3402a
    slstk3701a
    slstk3400a
    efm32wg_stk3800
    xg24_ek2703a
    xg24_dk2601b
    sltb004a
    sltb009a
    sltb010a
    xg27_dk2602a
    sim3u1xx_dk
    xg23_rb4210a
    slwrb4161a
    slwrb4104a
    slwrb4170a
    slwrb4321a
    xg24_rb4187c
    slwrb4255a
    slwrb4250b
    slwrb4180a
    v2m_beetle
    fvp_base_revc_2xaemv8a
    v2m_musca_b1
    v2m_musca_s1
    fvp_baser_aemv8r
    mps3
    mps2
    acn52832
    ucan
    cyw920829m2evk_02
    xmc45_relax_kit
    cy8cproto_063_ble
    cy8ckit_062s2_ai
    cy8cproto_062_4343w
    xmc47_relax_kit
    cy8ckit_062s4
    cortex_r8_virtual
    riscv32_virtual
    adafruit_itsybitsy
    adafruit_feather_m0_basic_proto
    adafruit_feather_m4_express
    adafruit_feather_m0_lora
    adafruit_trinket_m0
    adafruit_kb2040
    adafruit_feather_nrf52840
    nrf52_adafruit_feather
    adafruit_itsybitsy_m4_express
    adafruit_qt_py_rp2040
    adafruit_qt_py_esp32s3
    adafruit_grand_central_m4_express
    adafruit_feather_stm32f405
    sgrm
    nrf52_sparkfun
    sparkfun_thing_plus_matter_mgm240p
    micromod
    sparkfun_thing_plus
    sparkfun_red_v_things_plus
    sparkfun_pro_micro_rp2040
    gd32vf103v_eval
    gd32vf103c_starter
    gd32e507v_start
    gd32e103v_eval
    gd32a503v_eval
    gd32f403z_eval
    gd32f450i_eval
    gd32f470i_eval
    gd32f407v_start
    gd32e507z_eval
    gd32f450z_eval
    gd32f350r_eval
    gd32l233r_eval
    gd32f450v_start
    ast1030_evb
    ip_k66f
    segger_trb_stm32f407
    altera_max10
    blueclover_plt_demo_v2
    nrf52840_blip
    nrf52840_papyr
    w5500_evb_pico
    npcx7m6fb_evb
    npcm400_evb
    numaker_pfm_m467
    npcx9m6f_evb
    numaker_m2l31ki
    npcx4m8f_evb
    numaker_pfm_m487
    nrf51_vbluno51
    nrf52_vbluno52
    up_squared
    up_squared_pro_7000
    qemu_kvm_arm64
    qemu_riscv64
    qemu_riscv32_xip
    qemu_xtensa
    qemu_cortex_m3
    qemu_cortex_a9
    qemu_riscv32e
    qemu_cortex_r5
    qemu_cortex_a53
    qemu_riscv32
    qemu_x86
    qemu_x86_lakemont
    qemu_x86_64
    qemu_x86_tiny
    qemu_cortex_m0
    qemu_leon3
    qemu_malta
    qemu_arc
    qemu_nios2
    waveshare_open103z
    nrf51_ble400
    rp2040_zero
    esp32s3_touch_lcd_1_28
    dragino_nbsn95
    dragino_lsn50
    teensy40
    teensy41
    mec172xevb_assy6906
    mpfs_icicle
    m2gl025_miv
    mec1501modular_assy6885
    mec172xmodular_assy6930
    mec15xxevb_assy6853
    ev11l78a
    kb1200_evb
    apollo3_evb
    apollo4p_blue_kxr_evb
    apollo4p_evb
    apollo3p_evb
    m5stack_atoms3_lite
    m5stack_atoms3
    m5stack_core2
    m5stack_cores3
    m5stack_atom_lite
    m5stack_stamps3
    stamp_c3
    m5stickc_plus
    ganymed_bob
    udoo_neo_full
    pico_pi
    arduino_nicla_sense_me
    arduino_nicla_vision
    arduino_portenta_h7
    arduino_due
    arduino_nano_33_ble
    arduino_zero
    arduino_opta
    arduino_giga_r1
    arduino_mkrzero
    arduino_nano_33_iot
    arduino_uno_r4_minima
    arduino_uno_r4_wifi
    ruuvi_ruuvitag
    esp32s2_franzininho
    acp_6_0_adsp
    kv260_r5
    mm_feather
    mm_swiftio
    mks_canable_v20
    nucleo_l4r5zi
    nucleo_f031k6
    nucleo_f030r8
    nucleo_f334r8
    stm32l496g_disco
    nucleo_l011k4
    b_g474e_dpow1
    stm32f413h_disco
    stm32f7508_dk
    nucleo_f091rc
    stm32u083c_dk
    nucleo_l073rz
    stm32f746g_disco
    stm32f072_eval
    nucleo_f103rb
    nucleo_h533re
    stm32h573i_dk
    stm32f072b_disco
    nucleo_f446ze
    stm32f769i_disco
    stm32wb5mm_dk
    nucleo_l4a6zg
    nucleo_g031k8
    nucleo_f303re
    stm32f412g_disco
    stm32f429i_disc1
    nucleo_l031k6
    nucleo_g431rb
    nucleo_f413zh
    nucleo_wb09ke
    sensortile_box
    stm32mp157c_dk2
    nucleo_c031c6
    stm32c0116_dk
    nucleo_wb05kz
    steval_stwinbx1
    nucleo_l496zg
    nucleo_f207zg
    sensortile_box_pro
    stm32f723e_disco
    nucleo_l552ze_q
    nucleo_g071rb
    stm32wb5mmg
    nucleo_h7a3zi_q
    stm32373c_eval
    nucleo_f410rb
    nucleo_h563zi
    nucleo_f303k8
    nucleo_h723zg
    nucleo_f302r8
    nucleo_l433rc_p
    nucleo_l412rb_p
    nucleo_h7s3l8
    nucleo_g431kb
    nucleo_l152re
    nucleo_u575zi_q
    stm32l476g_disco
    stm32f469i_disco
    stm32g0316_disco
    stm32h745i_disco
    stm32f411e_disco
    nucleo_g474re
    nucleo_f756zg
    nucleo_h753zi
    stm32h7s78_dk
    nucleo_f412zg
    nucleo_f070rb
    nucleo_h745zi_q
    st25dv_mb1283_disco
    nucleo_f401re
    stm32h750b_dk
    nucleo_u031r8
    nucleo_l432kc
    nucleo_f411re
    nucleo_wb55rg
    nucleo_h755zi_q
    nucleo_f767zi
    nucleo_g070rb
    steval_fcu001v1
    stm32f3_disco
    nucleo_l452re
    nucleo_g0b1re
    nucleo_f429zi
    nucleo_f042k6
    disco_l475_iot1
    stm32h747i_disco
    nucleo_f746zg
    nucleo_wba52cg
    nucleo_h743zi
    stm32f4_disco
    stm32l4r9i_disco
    nucleo_h503rb
    stm32g071b_disco
    stm32u5a9j_dk
    nucleo_l053r8
    b_l072z_lrwan1
    stm32vl_disco
    stm3210c_eval
    nucleo_f446re
    nucleo_l476rg
    nucleo_u5a5zj_q
    stm32h7b3i_dk
    nucleo_wba55cg
    b_u585i_iot02a
    stm32l562e_dk
    stm32l1_disco
    stm32l152c_disco
    nucleo_u083rc
    stm32h735g_disco
    nucleo_c071rb
    stm32f0_disco
    b_l4s5i_iot01a
    nucleo_wl55jc
    nucleo_f722ze
    stm32g081b_eval
    khadas_edgev
    quick_feather
    qomu
    heltec_wireless_stick_lite_v3
    heltec_wifi_lora32_v2
    legend
    faze
    walter
    we_proteus2ev
    we_ophelia1ev
    we_orthosie1ev
    we_proteus3ev
    mt8195
    mt8186
    mt8188
    mt8196
    adp_xc7k
    beaglebone_ai64
    beaglev_fire
    beagleconnect_freedom
    beagleplay
    promicro_nrf52840
    candlelightfd
    stm32f103_mini
    stm32f030_demo
    candlelight
    stm32f401_mini
    icev_wireless
    stm32_min_dev
    esp32c3_supermini
    neorv32
    serpente
    black_f407zg_pro
    black_f407ve
    nrf52840_mdk_usb_dongle
    nrf52840_mdk
    nrf52832_mdk
    circuitdojo_feather
    visionfive2
    raytac_mdbt50q_db_33
    raytac_mdbt53v_db_40
    raytac_mdbt53_db_40
    raytac_mdbt50q_db_40
    litex_vexriscv
    croxel_cx1825
    pandora_stm32l475
    fk7b0m1_vbt6
    fk750m1_vbt6
    96b_meerkat96
    96b_neonkey
    96b_carbon
    96b_argonkey
    96b_nitrogen
    96b_aerocore2
    96b_stm32_sensor_mez
    96b_wistrio
    96b_avenger96
    ctcc
    titanium_ti60_f225
    warp7
    rak11720
    rak5010
    rak4631
    ch32v003evt
    mikroe_stm32_m4_clicker
    mikroe_mini_m4_for_stm32
    mikroe_clicker_ra4m1
    mikroe_clicker_2
    verdin_imx8mp
    verdin_imx8mm
    colibri_imx7d
    swan_r5
    google_twinkie_v2
    google_icetower
    google_dragonclaw
    bytesensi_l
    bbc_microbit
    bbc_microbit_v2
    ubx_bmd360eval
    ubx_evkannab1
    ubx_bmd300eval
    ubx_evkninab4
    ubx_evkninab3
    ubx_bmd330eval
    ubx_bmd380eval
    ubx_bmd340eval
    ubx_evkninab1
    ubx_bmd345eval
    opentitan_earlgrey
    ronoth_lodev
    ttgo_t8c3
    ttgo_t7v1_5
    ttgo_t8s3
    ttgo_lora32
    innblue21
    innblue22
    mg100
    bt610
    bl654_usb
    bt510
    bl653_dvk
    bl652_dvk
    bl5340_dvk
    bl654_dvk
    rm1xx_dvk
    pinnacle_100_dvk
    bl654_sensor_board
    actinius_icarus
    actinius_icarus_som_dk
    actinius_icarus_bee
    actinius_icarus_som
    hifive1
    hifive_unmatched
    hifive_unleashed
    native_sim
    native_posix
    nrf52_bsim
    nrf5340bsim
    nrf54l15bsim
    xt-sim
    holyiot_yj16019
    zybo
    arty_a7
    cy8ckit_062_wifi_bt
    cy8ckit_062_ble
    yd_stm32h750vb
    yd_esp32
    longan_nano
    imx8mm_evk
    mimxrt1020_evk
    ucans32k1sic
    frdm_k22f
    lpcxpresso51u68
    frdm_k82f
    lpcxpresso55s36
    mimxrt1180_evk
    vmu_rt1170
    imx8mn_evk
    twr_ke18f
    lpcxpresso55s06
    frdm_kl25z
    frdm_kw41z
    frdm_ke17z
    frdm_mcxc444
    lpcxpresso11u68
    mimxrt1024_evk
    imx95_evk
    rddrone_fmuk66
    twr_kv58f220m
    lpcxpresso54114
    frdm_mcxa156
    usb_kw24d512
    mimxrt1040_evk
    frdm_mcxn947
    frdm_ke17z512
    imx93_evk
    mimxrt1050_evk
    mimxrt1062_fmurt6
    frdm_k64f
    s32z2xxdc2
    mimxrt1060_evk
    mimxrt595_evk
    lpcxpresso55s69
    imx8qxp_mek
    mimxrt1064_evk
    frdm_mcxc242
    frdm_rw612
    mimxrt1015_evk
    mimxrt1160_evk
    frdm_ke15z
    imx8mp_evk
    imx8mq_evk
    ls1046ardb
    frdm_mcxw71
    hexiwear
    mr_canhubk3
    rd_rw612_bga
    lpcxpresso55s16
    frdm_mcxn236
    mimxrt685_evk
    imx8ulp_evk
    mimxrt1170_evk
    mimxrt1010_evk
    imx8qm_mek
    lpcxpresso55s28
    reel_board
    phyboard_pollux
    phyboard_polis
    phyboard_electra
    phyboard_nash
    phyboard_lyra
    kincony_kc868_a32
    linum
    apard32690
    max32672fthr
    max32666fthr
    max32672evkit
    max32690evkit
    max32662evkit
    max32655evkit
    max32680evkit
    max32675evkit
    max78002evkit
    adi_eval_adin2111ebz
    max32690fthr
    adi_eval_adin1110ebz
    max32666evkit
    adi_sdp_k1
    max32670evkit
    max32655fthr
    olimex_stm32_h103
    olimexino_stm32
    olimex_stm32_h407
    olimex_lora_stm32wl_devkit
    olimex_esp32_evb
    olimex_stm32_h405
    olimex_stm32_p405
    olimex_stm32_e407
    hsdk
    hsdk4xd
    emsdp
    iotdk
    em_starterkit
    nsim
    nsim_arc_v
    scobc_module1
    octopus_io_board
    octopus_som
    degu_evk
    stm32f3_seco_d23
    xenvm
    ebyte_e73_tbb
    thingy52
    nrf52833dk
    nrf54l15dk
    nrf54h20dk
    thingy53
    nrf5340_audio_dk
    nrf52dk
    nrf9151dk
    nrf54l20pdk
    nrf9160dk
    nrf51dk
    nrf9131ek
    nrf9161dk
    nrf52840dk
    nrf5340dk
    nrf52840dongle
    nrf21540dk
    nrf51dongle
    nrf9280pdk
    nrf54l09pdk
    nrf7002dk
    intel_ehl_crb
    intel_ish_5_4_1
    intel_ish_5_6_0
    intel_ish_5_8_0
    niosv_m
    intel_adl_crb
    intel_adl_rvp
    niosv_g
    intel_adsp
    intel_rpl_p_crb
    intel_rpl_s_crb
    cyclonev_socdk
    intel_socfpga_agilex_socdk
    intel_socfpga_agilex5_socdk
    decawave_dwm1001_dev
    decawave_dwm3001cdk
    roc_rk3568_pc
    rts5912_evb
    esp32c3_042_oled
    CMake Error at /opt/nordic/ncs/v3.0.0/zephyr/cmake/modules/boards.cmake:228 (message):
      Invalid BOARD; see above.
    Call Stack (most recent call first):
      cmake/modules/sysbuild_default.cmake:15 (include)
      /opt/nordic/ncs/v3.0.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /opt/nordic/ncs/v3.0.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /opt/nordic/ncs/v3.0.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    FATAL ERROR: command exited with status 1: /opt/homebrew/bin/cmake -DWEST_PYTHON=/opt/homebrew/opt/[email protected]/bin/python3.13 -B/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass/build -GNinja -DBOARD=adafruit_feather_nrf52840_sense -DCONFIG_APP_MSC_STORAGE_FLASH_FATFS=y -S/opt/nordic/ncs/v3.0.0/zephyr/share/sysbuild -DAPP_DIR:PATH=/opt/nordic/ncs/v3.0.0/zephyr/samples/subsys/usb/mass
    which I suspect is because there's no *.dts for that board configuration.

    My main suspicion is that both the How To from the link and the mass storage sample itself are simply outdated. Main reason for this conclusion is the huge discrepancy between the Zephyr OS reported in the sample (*** Booting Zephyr OS build zephyr-v2.3.0-1991-g4c8d1496eafb ***) and the Zephyr OS reported when I flash the board (*** Using Zephyr OS v4.0.99-a0e545cb437a ***).

    Could you please prepare a working usb mass storage sample code for the nrf7002dk board that works out of the box for ncs v3.0.0 sdk and add it here as an archive?

    In parallel I'll keep tinkering with it. I think the partition_manager_report will be the key to finding a solution!

Children
No Data
Related