Errors with building a sample project with MCUboot

Hi,

I am following these steps to build a sample project to try out OTA updates of the firmware.

https://devzone.nordicsemi.com/guides/nrf-connect-sdk-guides/b/software/posts/ncs-dfu

However the issue is that when I add CONFIG_BOOTLOADER_MCUBOOT, my builds start to fail. I tried with both 1.8.0 and 1.9.1 sdk

# Ensure an MCUboot-compatible binary is generated.
CONFIG_BOOTLOADER_MCUBOOT=y

The error I get is:

---------------------------------------------------------------------------------------------------------------------------------

> Executing task: nRF Connect: Build: peripheral_lbs/build (active) <

Building peripheral_lbs
west build --build-dir /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs

[0/1] Re-running CMake...
Including boilerplate (Zephyr base (cached)): /opt/nordic/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
-- Application: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs
-- Zephyr version: 2.7.99 (/opt/nordic/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
-- Found west (found suitable version "0.12.0", minimum required is "0.7.1")
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: /Users/macuser/Library/Caches/zephyr
-- Found dtc: /opt/nordic/ncs/v1.9.1/toolchain/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/opt/nordic/ncs/v1.9.1/toolchain)
-- Found BOARD.dts: /opt/nordic/ncs/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Generated zephyr.dts: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/zephyr/dts.cmake
Parsing /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/Kconfig
Loaded configuration '/opt/nordic/ncs/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
Merged configuration '/Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/prj.conf'
Configuration saved to '/Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/zephyr/.config'
Kconfig header saved to '/Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/zephyr/include/generated/autoconf.h'

=== child image mcuboot - begin ===
loading initial cache file /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/mcuboot/child_image_preload.cmake
Including boilerplate (Zephyr base): /opt/nordic/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake
-- Application: /opt/nordic/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.7.99 (/opt/nordic/ncs/v1.9.1/zephyr), build: v2.7.99-ncs1-1
-- Found Python3: /Users/macuser/opt/anaconda3/bin/python3.9 (found suitable exact version "3.9.7") found components: Interpreter
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: /Users/macuser/Library/Caches/zephyr
-- Found dtc: /opt/nordic/ncs/v1.9.1/toolchain/bin/dtc (found suitable version "1.6.1", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/opt/nordic/ncs/v1.9.1/toolchain)
-- Found BOARD.dts: /opt/nordic/ncs/v1.9.1/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Found devicetree overlay: /opt/nordic/ncs/v1.9.1/nrf/modules/mcuboot/usb.overlay
-- Found devicetree overlay: /opt/nordic/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/dts.overlay
-- Generated zephyr.dts: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/mcuboot/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/mcuboot/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/mcuboot/zephyr/include/generated/device_extern.h
-- Including generated dts.cmake file: /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/mcuboot/zephyr/dts.cmake
Parsing /opt/nordic/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/Kconfig
/opt/nordic/ncs/v1.9.1/zephyr/scripts/kconfig/kconfig.py: /opt/nordic/ncs/v1.9.1/bootloader/mcuboot/boot/zephyr/Kconfig:11: '/modules/mcuboot/boot/zephyr/Kconfig' not found (in 'source "$(ZEPHYR_NRF_MODULE_DIR)/modules/mcuboot/boot/zephyr/Kconfig"'). Check that environment variables are set correctly (e.g. $srctree, which is set to '/opt/nordic/ncs/v1.9.1/zephyr'). Also note that unset environment variables expand to the empty string.
CMake Error at /opt/nordic/ncs/v1.9.1/zephyr/cmake/kconfig.cmake:272 (message):
command failed with return code: 1
Call Stack (most recent call first):
/opt/nordic/ncs/v1.9.1/zephyr/cmake/app/boilerplate.cmake:544 (include)
/opt/nordic/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
/opt/nordic/ncs/v1.9.1/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
/Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/CMakeLists.txt:44 (find_package)


-- Configuring incomplete, errors occurred!
CMake Error at /opt/nordic/ncs/v1.9.1/nrf/cmake/multi_image.cmake:409 (message):
CMake generation for mcuboot failed, aborting. Command: 1
Call Stack (most recent call first):
/opt/nordic/ncs/v1.9.1/nrf/cmake/multi_image.cmake:150 (add_child_image_from_source)
/opt/nordic/ncs/v1.9.1/nrf/modules/mcuboot/CMakeLists.txt:216 (add_child_image)


-- Configuring incomplete, errors occurred!
See also "/Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/CMakeFiles/CMakeOutput.log".
See also "/Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build/CMakeFiles/CMakeError.log".
FAILED: build.ninja
/opt/nordic/ncs/v1.9.1/toolchain/Cellar/cmake/3.21.1/bin/cmake --regenerate-during-build -S/Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs -B/Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build
ninja: error: rebuilding 'build.ninja': subcommand failed
FATAL ERROR: command exited with status 1: /opt/nordic/ncs/v1.9.1/toolchain/bin/cmake --build /Users/macuser/Projects/SB/IP/Zypher/RND/peripheral_lbs/build
The terminal process terminated with exit code: 1.

Terminal will be reused by tasks, press any key to close it.
---------------------------------------------------------------------------------------------------------------------------------


Any idea what am I might be doing wrong? 

Thanks!
Parents Reply Children
Related