How to use M95P32 to replace the current external flash

Hi,

We're going to use external SPI EEPROM, but which is working on the DK board's MX25R64

How to configure MCUboot&OTA using external SPI EEPROM memory?

I expect to get all the configuration processes and files that must be modified, such as overlay and conf modification methods,Thanks!

OS: windows 10
Hardware used: nrf5340 dk
example:C:\ncs\v2.4.1\nrf\samples\matter\lock

Parents
  • Hi,

    First to check: It is possible to use external flash with either QSPI or SPI.
    And you want SPI, right?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd

    The compiler will report an error when I modify the "child image"

     *  Executing task: nRF Connect: Build: DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build (active) 
    
    Building DL02_S2MB_KPD_Small
    west build --build-dir c:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build c:/nordic/DL02_S2MB_KPD_Small
    
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/nordic/DL02_S2MB_KPD_Small
    -- CMake version: 3.20.5
    -- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found suitable version "3.8.2", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: c:/nordic/DL02_S2MB_KPD_Small/boards/nrf5340dk_nrf5340_cpuapp.overlay
    node '/soc/peripheral@50000000/i2c@9000/outside@5B' compatible 'sunion,outside' has unknown vendor prefix 'sunion'
    node '/soc/peripheral@50000000/i2c@9000/store@50' compatible 'sunion,eeprom' has unknown vendor prefix 'sunion'
    node '/soc/peripheral@50000000/i2c@9000/timer@32' compatible 'sunion,rtc' has unknown vendor prefix 'sunion'
    -- Generated zephyr.dts: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/zephyr/dts.cmake
    Parsing C:/nordic/DL02_S2MB_KPD_Small/Kconfig
    Loaded configuration 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/zephyr/.config'
    No change to configuration in 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/zephyr/.config'
    No change to Kconfig header in 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/zephyr/include/generated/autoconf.h'
    
    warning: Deprecated symbol IEEE802154_2015 is enabled.
    
    
    warning: Deprecated symbol CPLUSPLUS is enabled.
    
    
    warning: Deprecated symbol LIB_CPLUSPLUS is enabled.
    
    
    === child image multiprotocol_rpmsg - CPUNET begin ===
    loading initial cache file C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/ncs/v2.5.0/nrf/samples/nrf5340/multiprotocol_rpmsg
    -- CMake version: 3.20.5
    -- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf5340dk_nrf5340_cpunet
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
    -- Generated zephyr.dts: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/zephyr/dts.cmake
    Parsing C:/ncs/v2.5.0/modules/lib/matter/config/nrfconnect/chip-module/Kconfig.multiprotocol_rpmsg.root
    Loaded configuration 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/zephyr/.config'
    No change to configuration in 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/zephyr/.config'
    No change to Kconfig header in 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/zephyr/include/generated/autoconf.h'
    
    === child image b0n - CPUNET (inherited) begin ===
    loading initial cache file C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/b0n/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/ncs/v2.5.0/nrf/samples/nrf5340/netboot
    -- CMake version: 3.20.5
    -- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf5340dk_nrf5340_cpunet
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpunet.dts
    -- Generated zephyr.dts: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/b0n/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/b0n/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/b0n/zephyr/dts.cmake
    Parsing C:/ncs/v2.5.0/nrf/samples/nrf5340/netboot/Kconfig
    Loaded configuration 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/b0n/zephyr/.config'
    No change to configuration in 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/b0n/zephyr/.config'
    No change to Kconfig header in 'C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/b0n/zephyr/include/generated/autoconf.h'
    CMake Warning at C:/ncs/v2.5.0/zephyr/CMakeLists.txt:1958 (message):
      __ASSERT() statements are globally ENABLED
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg/b0n
    === child image b0n - CPUNET (inherited) end ===
    
    CMake Warning at ../../../subsys/bootloader/cmake/debug_keys.cmake:36 (message):
      
    
          --------------------------------------------------------------
          --- WARNING: Using generated NSIB public/private key-pair. ---
          --- It should not be used for production.                  ---
          --- See CONFIG_SB_SIGNING_KEY_FILE                         ---
          --------------------------------------------------------------
          
    
    Call Stack (most recent call first):
      ../../../subsys/bootloader/cmake/provision_hex.cmake:47 (include)
      ../../../subsys/CMakeLists.txt:20 (include)
    
    
    -- libmetal version: 1.4.0 (C:/ncs/v2.5.0/nrf/samples/nrf5340/multiprotocol_rpmsg)
    -- Build type:  
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- open-amp version: 1.4.0 (C:/ncs/v2.5.0/modules/lib/open-amp/open-amp)
    -- Host:    Windows/AMD64
    -- Target:  Generic/arm
    -- Machine: arm
    -- C_FLAGS :  -Wall -Wextra
    CMake Warning at C:/ncs/v2.5.0/zephyr/CMakeLists.txt:893 (message):
      No SOURCES given to Zephyr library: drivers__console
    
      Excluding target from build.
    
    
    CMake Warning at C:/ncs/v2.5.0/zephyr/CMakeLists.txt:1958 (message):
      __ASSERT() statements are globally ENABLED
    
    
    CMake Warning at C:/ncs/v2.5.0/nrf/cmake/partition_manager.cmake:79 (message):
      
    
              ---------------------------------------------------------------------
              --- WARNING: Using a bootloader without pm_static.yml.            ---
              --- There are cases where a deployed product can consist of       ---
              --- multiple images, and only a subset of these images can be     ---
              --- upgraded through a firmware update mechanism. In such cases,  ---
              --- the upgradable images must have partitions that are static    ---
              --- and are matching the partition map used by the bootloader     ---
              --- programmed onto the device.                                   ---
              ---------------------------------------------------------------------
              
    
    Call Stack (most recent call first):
      C:/ncs/v2.5.0/zephyr/cmake/modules/kernel.cmake:247 (include)
      C:/ncs/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:138 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/multiprotocol_rpmsg
    === child image multiprotocol_rpmsg - CPUNET end ===
    
    -- Found Python3: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe (found version "3.8.2") found components: Interpreter 
    
    === child image mcuboot -  begin ===
    loading initial cache file C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: C:/ncs/v2.5.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.20.5
    -- Cache files will be written to: C:/ncs/v2.5.0/zephyr/.cache
    -- Zephyr version: 3.4.99 (C:/ncs/v2.5.0/zephyr)
    -- Found west (found suitable version "1.1.0", minimum required is "0.14.0")
    -- Board: nrf5340dk_nrf5340_cpuapp
    -- Found host-tools: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.1 (C:/ncs/toolchains/c57af46cb7/opt/zephyr-sdk)
    -- Found BOARD.dts: C:/ncs/v2.5.0/zephyr/boards/arm/nrf5340dk_nrf5340/nrf5340dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: C:/ncs/v2.5.0/nrf/modules/mcuboot/flash_sim.overlay
    -- Found devicetree overlay: C:/nordic/DL02_S2MB_KPD_Small/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay
    devicetree error: /chosen: undefined node label 'eeprom_m95p32'
    CMake Error at C:/ncs/v2.5.0/zephyr/cmake/modules/dts.cmake:279 (message):
    -- In: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr, command: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe;C:/ncs/v2.5.0/zephyr/scripts/dts/gen_defines.py;--dts;C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;C:/ncs/v2.5.0/nrf/dts/bindings;C:/ncs/v2.5.0/zephyr/dts/bindings;--header-out;C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr/include/generated/devicetree_generated.h.new;--dts-out;C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr/zephyr.dts.new;--edt-pickle-out;C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr/edt.pickle;--vendor-prefixes;C:/ncs/v2.5.0/nrf/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;C:/ncs/v2.5.0/zephyr/dts/bindings/vendor-prefixes.txt
      gen_defines.py failed with return code: 1
    Call Stack (most recent call first):
      C:/ncs/v2.5.0/zephyr/cmake/modules/zephyr_default.cmake:129 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.5.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:97 (include_boilerplate)
      CMakeLists.txt:31 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/CMakeFiles/CMakeOutput.log".
    See also "C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/CMakeFiles/CMakeError.log".
    CMake Error at C:/ncs/v2.5.0/nrf/cmake/multi_image.cmake:449 (message):
      CMake generation for mcuboot failed, aborting.  Command: 1
    Call Stack (most recent call first):
      C:/ncs/v2.5.0/nrf/cmake/multi_image.cmake:178 (add_child_image_from_source)
      C:/ncs/v2.5.0/nrf/modules/mcuboot/CMakeLists.txt:268 (add_child_image)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/CMakeFiles/CMakeOutput.log".
    See also "C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/CMakeFiles/CMakeError.log".
    FAILED: build.ninja 
    C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.exe --regenerate-during-build -SC:\nordic\DL02_S2MB_KPD_Small -BC:\nordic\DL02_S2MB_KPD_Small\DL02_S2MB_KPD_Small_build
    ninja: error: rebuilding 'build.ninja': subcommand failed
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' --build 'c:\nordic\DL02_S2MB_KPD_Small\DL02_S2MB_KPD_Small_build'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 

  • The error is "devicetree error: /chosen: undefined node label 'eeprom_m95p32'"

    Can you share the file where you define the dts for eeprom_m95p32?

    If you build without the "chosen" part for DTS, can you share build/zephyr/zephyr.dts for that build?

  • Hi Sigurd

    I only modified "overlay", is there any additional operation required?

    nrf5340dk_nrf5340_cpuapp.7z

  • I tried to add your configurations to the hello world example, and I do not get the error. Am I missing anything?

    tmp.zip

  • Hi Sigurd

    At present, my APP code has been roughly completed.

    But our products need to use external EEPROM for OTA.

    Can you test it with the "v2.5.2\nrf\samples\matter\lock" to confirm whether there are build errors?

Reply Children
  • SunHuang said:
    Can you test it with the "v2.5.2\nrf\samples\matter\lock" to confirm whether there are build errors?

    Since it is 25 days since last time I looked at this ticket:
    Could you upload what I should test with the lock sample again?
    That way we are sure we avoid misunderstandings.

  • Hi Sigurd

    The information you have requested is attached below. Please accept my apologies for the delayed response.

    -- In: C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr, command: C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe;C:/ncs/v2.5.0/zephyr/scripts/dts/gen_defines.py;--dts;C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr/zephyr.dts.pre;--dtc-flags;'-Wno-unique_unit_address_if_enabled';--bindings-dirs;C:/ncs/v2.5.0/nrf/dts/bindings;C:/ncs/v2.5.0/zephyr/dts/bindings;--header-out;C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr/include/generated/devicetree_generated.h.new;--dts-out;C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr/zephyr.dts.new;--edt-pickle-out;C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/mcuboot/zephyr/edt.pickle;--vendor-prefixes;C:/ncs/v2.5.0/nrf/dts/bindings/vendor-prefixes.txt;--vendor-prefixes;C:/ncs/v2.5.0/zephyr/dts/bindings/vendor-prefixes.txt
    -- Configuring incomplete, errors occurred!
    CMake Error at C:/ncs/v2.5.0/nrf/cmake/multi_image.cmake:449 (message):
      CMake generation for mcuboot failed, aborting.  Command: 1
    Call Stack (most recent call first):
      C:/ncs/v2.5.0/nrf/cmake/multi_image.cmake:178 (add_child_image_from_source)
      C:/ncs/v2.5.0/nrf/modules/mcuboot/CMakeLists.txt:268 (add_child_image)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/CMakeFiles/CMakeOutput.log".
    See also "C:/nordic/DL02_S2MB_KPD_Small/DL02_S2MB_KPD_Small_build/CMakeFiles/CMakeError.log".
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\c57af46cb7\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/c57af46cb7/opt/bin/python.exe '-Bc:\nordic\DL02_S2MB_KPD_Small\DL02_S2MB_KPD_Small_build' -GNinja -DBOARD=nrf5340dk_nrf5340_cpuapp -DNCS_TOOLCHAIN_VERSION=NONE '-DBOARD_ROOT=c:/nordic/dl02_s2mb_kpd_small;.' -DCONF_FILE=c:/nordic/DL02_S2MB_KPD_Small/prj.conf -DDTC_OVERLAY_FILE=c:/nordic/DL02_S2MB_KPD_Small/boards/nrf5340dk_nrf5340_cpuapp.overlay '-Sc:\nordic\DL02_S2MB_KPD_Small'
    
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it. 

    config.7z

  • the error message is

    "
    -- Found devicetree overlay: /home/sihe/ncs/nrf/samples/matter/lock/child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay
    You must include the configuration of eeprom_m95p32
    "

    I guess that you are missing some configurations related to eeprom_m95p32 from child_image/mcuboot/boards/nrf5340dk_nrf5340_cpuapp.overlay.

  • Hi Sigurd

    I changed "child_image\mcuboot\prj.conf "and "child_image\mcuboot\boards\nrf5340dk_nrf5340_cpuapp.overlay" but other errors occurred

    config & error message.7z

Related