nRF7002 DK - DFU with External Flash build error

I’m using nRF Connect SDK v2.8.0 and working on BLE OTA (DFU) for the nRF7002 DK. I followed the Nordic “DFU with external flash” exercise and integrated it into the Wi-Fi station example, but I’m encountering the following build error:

C:/ncs/v2.8.0/zephyr/subsys/dfu/img_util/flash_img.c: In function 'flash_img_init':
C:/ncs/v2.8.0/nrf/include/flash_map_pm.h:47:22: error: 'PM_mcuboot_primary_ID' undeclared (first use in this function)
   47 | #define PM_ID(label) PM_##label##_ID

Could you please suggest what might be missing?
Is there any configuration or file I need to add to fix this issue?

I’ve also attached my project ZIP file for reference.

sta_1.zip

Parents
  • Hello,

    The issue is that the guide that you are following is intended for the nRF52840DK, which uses it's QSPI for flash, but you are trying to use the QSPI for WiFi. This means that you need to redefine the external flash as an external SPI flash.

    Please see the modified project. The main changes are in prj.conf (don't remember if I did any changes there, actually), the app.overlay and mcuboot.overlay.

    I also added SB_CONFIG_BOOTLOADER_MCUBOOT=y in your sysbuild.conf.

    sta_2.zip

    Best regards,

    Edvin

  • I tried building the modified project (sta_2) you suggested, but it threw the following build error:

    devicetree error: Label 'mx25r64' appears on /soc/peripheral@50000000/spi@8000/mx25r6435f@0 and on /soc/peripheral@50000000/spi@a000/mx25r6435f@0
    CMake Error at C:/ncs/v2.8.0/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      C:/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeList-- Configuring incomplete, errors occurred!
    s.txt:12 (find_package)
    
    
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: mcuboot
    
      Location: C:/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:20 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      C:/ncs/v2.8.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    

Reply
  • I tried building the modified project (sta_2) you suggested, but it threw the following build error:

    devicetree error: Label 'mx25r64' appears on /soc/peripheral@50000000/spi@8000/mx25r6435f@0 and on /soc/peripheral@50000000/spi@a000/mx25r6435f@0
    CMake Error at C:/ncs/v2.8.0/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      C:/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeList-- Configuring incomplete, errors occurred!
    s.txt:12 (find_package)
    
    
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: mcuboot
    
      Location: C:/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:20 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      C:/ncs/v2.8.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    

Children
  • Can you please share the build command that you used, and the entire build log (not just where it shows the first error).

    BR,

    Edvin

  • Build log:

    Building sta_2
    west build --build-dir c:/Users/NEEVEE/Downloads/sta_2/sta_2/build c:/Users/NEEVEE/Downloads/sta_2/sta_2 --pristine --board nrf7002dk/nrf5340/cpuapp -- -DNCS_TOOLCHAIN_VERSION="NONE" -DEXTRA_CONF_FILE=boards/nrf52840dk_nrf52840.conf -DDTC_OVERLAY_FILE="app.overlay"
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: C:/ncs/toolchains/2d382dcd92/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.8.0/zephyr/.cache
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf7002dk, qualifiers: nrf5340/cpuapp
    Parsing C:/ncs/v2.8.0/zephyr/share/sysbuild/Kconfig
    Loaded configuration 'C:/Users/NEEVEE/Downloads/sta_2/sta_2/build/_sysbuild/empty.conf'
    Merged configuration 'c:/Users/NEEVEE/Downloads/sta_2/sta_2/sysbuild.conf'
    Configuration saved to 'C:/Users/NEEVEE/Downloads/sta_2/sta_2/build/zephyr/.config'
    Kconfig header saved to 'C:/Users/NEEVEE/Downloads/sta_2/sta_2/build/_sysbuild/autoconf.h'
    --
       *****************************
       * Running CMake for mcuboot *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: C:/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: C:/ncs/toolchains/2d382dcd92/opt/bin/python.exe (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: C:/ncs/v2.8.0/zephyr/.cache
    -- Zephyr version: 3.7.99 (C:/ncs/v2.8.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf7002dk, qualifiers: nrf5340/cpuapp
    -- Found host-tools: zephyr 0.16.8 (C:/ncs/toolchains/2d382dcd92/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.8 (C:/ncs/toolchains/2d382dcd92/opt/zephyr-sdk)
    -- Found Dtc: C:/ncs/toolchains/2d382dcd92/opt/bin/dtc.exe (found suitable version "1.4.7", minimum required is "1.4.6")
    -- Found BOARD.dts: C:/ncs/v2.8.0/zephyr/boards/nordic/nrf7002dk/nrf7002dk_nrf5340_cpuapp.dts
    -- Found devicetree overlay: C:/Users/NEEVEE/Downloads/sta_2/sta_2/sysbuild/mcuboot.overlay
    devicetree error: Label 'mx25r64' appears on /soc/peripheral@50000000/spi@8000/mx25r6435f@0 and on /soc/peripheral@50000000/spi@a000/mx25r6435f@0
    CMake Error at C:/ncs/v2.8.0/zephyr/cmake/modules/dts.cmake:295 (execute_process):
      execute_process failed command indexes:
    
        1: "Child return code: 1"
    
    Call Stack (most recent call first):
      C:/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:133 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:12 (find_package)
    
    -- Configuring incomplete, errors occurred!
    
    CMake Error at cmake/modules/sysbuild_extensions.cmake:514 (message):
      CMake configure failed for Zephyr project: mcuboot
    
      Location: C:/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:20 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:20 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      C:/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      C:/ncs/v2.8.0/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "C:/Users/NEEVEE/Downloads/sta_2/sta_2/build/CMakeFiles/CMakeOutput.log".
    ←[91mFATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\2d382dcd92\opt\bin\cmake.EXE' -DWEST_PYTHON=C:/ncs/toolchains/2d382dcd92/opt/bin/python.exe '-Bc:\Users\NEEVEE\Downloads\sta_2\sta_2\
    build' -GNinja -DBOARD=nrf7002dk/nrf5340/cpuapp -DNCS_TOOLCHAIN_VERSION=NONE -DEXTRA_CONF_FILE=boards/nrf52840dk_nrf52840.conf -DDTC_OVERLAY_FILE=app.overlay '-SC:\ncs\v2.8.0\zephyr\share\sysbuild' '-
    DAPP_DIR:PATH=c:\Users\NEEVEE\Downloads\sta_2\sta_2'
    ←[0m
     *  The terminal process terminated with exit code: 1. 
     *  Terminal will be reused by tasks, press any key to close it.

    Build Configuration:


  • sta_3.zip

    I am sorry. I don't know why I didn't pick up what board you were using. I was trying testing your application for the nRF52840dk/nrf52840, which was why I changed your app.overlay and sysbuild\mcuboot.overlay.

    Attached is the updated version, with your original overlay files. Then I guess the only real change is in the sysbuild.conf, but I attached the whole thing, just in case there is anything else that I did.

    Best regards,

    Edvin

Related