nRF52833 SPI3 + W25Q01JV NOR Flash + USB MSC Build Issues - Device Tree Overlay Help Needed

I want to connect a W25Q01JVZEIM (128MB) NOR Flash ROM to SPI3 of the nRF52833 and implement USB MSC functionality. However, the build fails. It seems the overlay description is incorrect, but I cannot identify what's wrong.

Could you please advise how to fix this?

If there are any sample projects for similar systems, please provide the links.

Hardware Configuration:

Target: nRF52833DK
External Flash: W25Q01JVZEIM (128MB NOR Flash)
SPI Pins:
SCK: P0.16
MOSI: P0.19
MISO: P0.26
CS: P0.27
Current Device Tree Overlay:

&pinctrl {
    spim3_default: spim3_default {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
            <NRF_PSEL(SPIM_MOSI, 0, 19)>,
            <NRF_PSEL(SPIM_MISO, 0, 26)>;
        };
    };

    spim3_sleep: spim3_sleep {
        group1 {
            psels = <NRF_PSEL(SPIM_SCK, 0, 16)>,
            <NRF_PSEL(SPIM_MOSI, 0, 19)>,
            <NRF_PSEL(SPIM_MISO, 0, 26)>;
            low-power-enable;
        };
    };
};

&spi3 {
    compatible = "nordic,nrf-spim";
    status = "okay";
    pinctrl-0 = <&spim3_default>;
    pinctrl-1 = <&spim3_sleep>;
    pinctrl-names = "default", "sleep";
    cs-gpios = <&gpio0 27 GPIO_ACTIVE_LOW>;

    w25q01jv: w25q01jv@0 {
        compatible = "jedec,spi-nor";
        reg = <0>;
        spi-max-frequency = <8000000>;
        size = <134217728>; /* 128MB in bytes */
        jedec-id = [ef 40 21];

        partitions {
            compatible = "fixed-partitions";
            #address-cells = <1>;
            #size-cells = <1>;

            storage_partition: partition@0 {
                label = "storage";
                reg = <0x00000000 0x08000000>; /* 128MB in hex */
            };
        };
    };
};

Build Environment:

  • nRF Connect SDK: v3.1.0
  • Toolchain: b8b84efebd
  • Build System: west + CMake

Build Error: The build process fails during Kconfig parsing phase when flash-related configuration options are included.

Expected Functionality:

  • SPI NOR flash detection and initialization
  • FATFS filesystem on external flash
  • USB MSC (Mass Storage Class) to expose the filesystem via USB

Any guidance on the correct device tree configuration or references to working examples would be greatly appreciated.

Thank you for your assistance.

Parents
  • Hi!

    Build Error: The build process fails during Kconfig parsing phase when flash-related configuration options are included.

    Can you post the build error that you get?

  • Thank you for your response!

    Here is the detailed build error I'm encountering:



    ****************************
    * Running CMake for blinky *
    ****************************

    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v3.1.0/blinky
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/b8b84efebd/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v3.1.0/zephyr/.cache
    -- Zephyr version: 4.1.99 (C:/ncs/v3.1.0/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52833dk, qualifiers: nrf52833
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found host-tools: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (C:/ncs/toolchains/b8b84efebd/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/b8b84efebd/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v3.1.0/zephyr/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts
    -- Found devicetree overlay: C:/ncs/v3.1.0/blinky/nrf52833dk_nrf52833.overlay
    devicetree error: Label 'storage_partition' appears on /soc/flash-controller@4001e000/flash@0/partitions/partition@7a000 and on /soc/spi@4002f000/w25q01jv@0/partitions/partition@0
    CMake Error at C:/ncs/v3.1.0/zephyr/cmake/modules/dts.cmake:306 (execute_process):
    execute_process failed command indexes:

    1: "Child return code: 1"

    Call Stack (most recent call first):
    C:/ncs/v3.1.0/zephyr/cmake/modules/zephyr_default.cmake:131 (include)
    C:/ncs/v3.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
    C:/ncs/v3.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    CMakeLists.txt:8 (find_package)


    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:530 (message):
    CMake configure failed for Zephyr project: blinky

    Location: C:/ncs/v3.1.0/blinky
    Call Stack (most recent call first):
    cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
    cmake/modules/sysbuild_default.cmake:21 (include)
    C:/ncs/v3.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
    C:/ncs/v3.1.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
    C:/ncs/v3.1.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
    template/CMakeLists.txt:10 (find_package)


    -- Configuring incomplete, errors occurred!
    See also "C:/ncs/v3.1.0/blinky/build310/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b8b84efebd\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/b8b84efebd/opt/bin/python.exe '-BC:\ncs\v3.1.0\blinky\build310' -GNinja -DBOARD=nrf52833dk/nrf52833 -DCONF_FILE=prj_step3_minimal .conf '-SC:\ncs\v3.1.0\zephyr\share\sysbuild' '-DAPP_DIR:PATH=C:\ncs\v3.1.0\bli inky'

    PS C:\ncs\v3.1.0\blinky> ^C

  • You seem to have several storage partition nodes. Try adding this to the overlay, to delete the first one.

    /delete-node/ &storage_partition;

Reply Children
Related