west build failed due to mcuboot sysbuild

Hi,

With NCS v3.1.0 and Nordic's downstream zephyr ncs-v3.1.0, I got build failure with following message:

--

warning: attempt to assign the value 'n' to the undefined symbol MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION

--

This failure can be reproduced by building sample 'with_mcuboot'.

Command as below:

west build -p always -b nrf52840dk/nrf52840 zephyr/samples/sysbuild/with_mcuboot --sysbuild

But I can succeed to build it without '--sysbuild'. And BTW, with same system (machine with Ubuntu v22.04 installed) I can build this sample with original 'zephyr' according to 'Getting Started Guide'

docs.zephyrproject.org/.../index.html

Parents Reply Children
  • (.venv) luser@zephyrbuild:~/cbs$ west build -p always -b nrf52840dk/nrf52840 zephyr/samples/sysbuild/with_mcuboot --sysbuild
    -- west build: making build dir /home/luser/cbs/build pristine
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/luser/cbs/.venv/bin/python3 (found suitable version "3.10.12", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /home/luser/.cache/zephyr
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52840dk, qualifiers: nrf52840
    Parsing /home/luser/cbs/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/home/luser/cbs/build/_sysbuild/empty.conf'
    Merged configuration '/home/luser/cbs/zephyr/samples/sysbuild/with_mcuboot/sysbuild.conf'
    Configuration saved to '/home/luser/cbs/build/zephyr/.config'
    Kconfig header saved to '/home/luser/cbs/build/_sysbuild/autoconf.h'
    --
       *****************************
       * Running CMake for mcuboot *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/luser/cbs/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.22.1
    -- Found Python3: /home/luser/cbs/.venv/bin/python (found suitable version "3.10.12", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /home/luser/.cache/zephyr
    -- Zephyr version: 4.1.99 (/home/luser/cbs/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52840dk, qualifiers: nrf52840
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found host-tools: zephyr 0.17.4 (/home/luser/zephyrproject/zephyr/zephyr-sdk-0.17.4)
    -- Found toolchain: zephyr 0.17.4 (/home/luser/zephyrproject/zephyr/zephyr-sdk-0.17.4)
    -- Found Dtc: /home/luser/zephyrproject/zephyr/zephyr-sdk-0.17.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/luser/cbs/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840.dts
    -- Found devicetree overlay: /home/luser/cbs/bootloader/mcuboot/boot/zephyr/app.overlay
    -- Generated zephyr.dts: /home/luser/cbs/build/mcuboot/zephyr/zephyr.dts
    -- Generated pickled edt: /home/luser/cbs/build/mcuboot/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/luser/cbs/build/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    Parsing /home/luser/cbs/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/home/luser/cbs/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/home/luser/cbs/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/home/luser/cbs/bootloader/mcuboot/boot/zephyr/boards/nrf52840dk_nrf52840.conf'
    Merged configuration '/home/luser/cbs/zephyr/samples/sysbuild/with_mcuboot/sysbuild/mcuboot.conf'
    Merged configuration '/home/luser/cbs/build/mcuboot/zephyr/.config.sysbuild'
    Configuration saved to '/home/luser/cbs/build/mcuboot/zephyr/.config'
    Kconfig header saved to '/home/luser/cbs/build/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/luser/zephyrproject/zephyr/zephyr-sdk-0.17.4/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: /home/luser/zephyrproject/zephyr/zephyr-sdk-0.17.4/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    CMake Warning at /home/luser/cbs/nrf/lib/flash_patch/CMakeLists.txt:8 (message):
    
    
            ----------------------------------------------------------
            --- WARNING: To maintain the integrity of secure boot, ---
            --- enable CONFIG_DISABLE_FLASH_PATCH in production.   ---
            ----------------------------------------------------------
    
    
    -- Using ccache: /usr/bin/ccache
    -- Found gen_kobject_list: /home/luser/cbs/zephyr/scripts/build/gen_kobject_list.py
    MCUBoot bootloader key file: /home/luser/cbs/bootloader/mcuboot/root-ec-p256.pem
    CMake Warning at CMakeLists.txt:369 (message):
      WARNING: Using default MCUboot signing key file, this file is for debug use
      only and is not secure!
    
    
    Calculated maximum number of sectors: 118
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/luser/cbs/build/mcuboot
    --
       **********************************
       * Running CMake for with_mcuboot *
       **********************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/luser/cbs/zephyr/samples/sysbuild/with_mcuboot
    -- CMake version: 3.22.1
    -- Found Python3: /home/luser/cbs/.venv/bin/python (found suitable version "3.10.12", minimum required is "3.10") found components: Interpreter
    -- Cache files will be written to: /home/luser/.cache/zephyr
    -- Zephyr version: 4.1.99 (/home/luser/cbs/zephyr)
    -- Found west (found suitable version "1.4.0", minimum required is "0.14.0")
    -- Board: nrf52840dk, qualifiers: nrf52840
    -- ZEPHYR_TOOLCHAIN_VARIANT not set, trying to locate Zephyr SDK
    -- Found host-tools: zephyr 0.17.4 (/home/luser/zephyrproject/zephyr/zephyr-sdk-0.17.4)
    -- Found toolchain: zephyr 0.17.4 (/home/luser/zephyrproject/zephyr/zephyr-sdk-0.17.4)
    -- Found Dtc: /home/luser/zephyrproject/zephyr/zephyr-sdk-0.17.4/sysroots/x86_64-pokysdk-linux/usr/bin/dtc (found suitable version "1.7.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/luser/cbs/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840.dts
    -- Generated zephyr.dts: /home/luser/cbs/build/with_mcuboot/zephyr/zephyr.dts
    -- Generated pickled edt: /home/luser/cbs/build/with_mcuboot/zephyr/edt.pickle
    -- Generated devicetree_generated.h: /home/luser/cbs/build/with_mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    
    warning: UPDATEABLE_IMAGE_NUMBER (defined at
    /home/luser/cbs/nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig:87, subsys/dfu/Kconfig:96) was assigned
    the value '1' but got the value ''. Check these unsatisfied dependencies:
    (((BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS) && SOC_SERIES_NRF53X &&
    NCS_SAMPLE_MCUMGR_BT_OTA_DFU) || (!MCUBOOT && IMG_MANAGER)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UPDATEABLE_IMAGE_NUMBER and/or look up
    UPDATEABLE_IMAGE_NUMBER 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: MCUBOOT_UPDATE_FOOTER_SIZE (defined at subsys/dfu/Kconfig:55) was assigned the value
    '0x2000' but got the value ''. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n),
    IMG_MANAGER (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE and/or look up
    MCUBOOT_UPDATE_FOOTER_SIZE 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.
    
    
    /home/luser/cbs/build/with_mcuboot/zephyr/.config.sysbuild:20: warning: attempt to assign the value 'n' to the undefined symbol MCUBOOT_HARDWARE_DOWNGRADE_PREVENTION
    Parsing /home/luser/cbs/zephyr/Kconfig
    Loaded configuration '/home/luser/cbs/zephyr/boards/nordic/nrf52840dk/nrf52840dk_nrf52840_defconfig'
    Merged configuration '/home/luser/cbs/zephyr/samples/sysbuild/with_mcuboot/prj.conf'
    Merged configuration '/home/luser/cbs/build/with_mcuboot/zephyr/.config.sysbuild'
    
    error: Aborting due to Kconfig warnings
    
    CMake Error at /home/luser/cbs/zephyr/cmake/modules/kconfig.cmake:377 (message):
      command failed with return code: 1
    Call Stack (most recent call first):
      /home/luser/cbs/nrf/cmake/modules/kconfig.cmake:83 (include)
      /home/luser/cbs/zephyr/cmake/modules/zephyr_default.cmake:131 (include)
      /home/luser/cbs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/luser/cbs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:5 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    CMake Error at cmake/modules/sysbuild_extensions.cmake:530 (message):
      CMake configure failed for Zephyr project: with_mcuboot
    
      Location: /home/luser/cbs/zephyr/samples/sysbuild/with_mcuboot
    Call Stack (most recent call first):
      cmake/modules/sysbuild_images.cmake:43 (ExternalZephyrProject_Cmake)
      cmake/modules/sysbuild_default.cmake:21 (include)
      /home/luser/cbs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:75 (include)
      /home/luser/cbs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      /home/luser/cbs/zephyr/share/sysbuild-package/cmake/SysbuildConfig.cmake:8 (include)
      template/CMakeLists.txt:10 (find_package)
    
    
    -- Configuring incomplete, errors occurred!
    See also "/home/luser/cbs/build/CMakeFiles/CMakeOutput.log".
    FATAL ERROR: command exited with status 1: /usr/bin/cmake -DWEST_PYTHON=/home/luser/cbs/.venv/bin/python3 -B/home/luser/cbs/build -GNinja -DBOARD=nrf52840dk/nrf52840 -S/home/luser/cbs/zephyr/share/sysbuild -DAPP_DIR:PATH=/home/luser/cbs/zephyr/samples/sysbuild/with_mcuboot
    (.venv) luser@zephyrbuild:~/cbs$
    

  • Hi Benjamin,

    Thanks for reply. The full log of building this sample was provided.

    BTW, I'm working on the Ubuntu environment, not any GUI/IDE involved.
    The steps I was used to initiate my development environment as below:

    • python3 -m venv .venv
    • source .venv/bin/activate
    • pip install west

    west initialization with west.yml as below

    manifest:
      self:
        path: cbs
    
      remotes:
        - name: zephyrproject-rtos
          url-base: https://github.com/zephyrproject-rtos
        - name: nrfconnect
          url-base: https://github.com/nrfconnect
    
      projects:
        - name: zephyr
          remote: nrfconnect
          repo-path: sdk-zephyr
          revision: ncs-v3.1.0
          import: true
        - name: nrf
          remote: nrfconnect
          repo-path: sdk-nrf
          revision: v3.1.0
          import: true

    • west update
    • pip install -r zephyr/scripts/requirements.txt
    • west sdk install -t arm-zephyr-eabi -b .
    • west zephyr-export
    • source zephyr/zephyr-env.sh
Related