Using SEGGER embedded studio for ARM (Nordic Edition) v5.60. using Project-> Configure nRF Connect SDK Project Fails in configuring MCUBoot in Zephyr.
No Documentation on HOW TO USE!
Using SEGGER embedded studio for ARM (Nordic Edition) v5.60. using Project-> Configure nRF Connect SDK Project Fails in configuring MCUBoot in Zephyr.
No Documentation on HOW TO USE!
Hi,
You do not write exactly what you have done and how it fails. Can you elaborate?
Regarding documentation it is a bit scattered. Perhaps the best starting point is the SMP Server Sample. Essentially the only thing you need to chagne in your application to add MCUBoot is to set CONFIG_BOOTLOADER_MCUBOOT=y. However, you also typically need more additions to add support for mcumgr in your application, to handle the transport of the new image etc. This is demonstrated in the SMP Server Sample.
In the SEGGER embedded studio goto the tab 'Project' then goto the tab 'Configure nRF Connect SDK Project'. It will open up a window and populate the window from the "<project> / <build> / zephyr / .config " file.
If you look 'Available Modules' you will see mcuboot is available. Scroll down and expand 'Boot Options' click the 'MCUboot bootloader support'. the variable 'Path to the mcuboot signing key file' is set to my <project>/src, which has a mykey.pem file I manually generated from 'bootloader/mcuboot/scripts/imgtool.py '. The variable field 'Extra arguments to pass to imgtool' is left blank(since just did it by hand).
Then click the box 'Configure'.
SWIRLS around and the RED banner " Cannot Configure project " create_nordic_project.py failed (1). Then click OK on the error banner.
Go back to the tab 'Project' then goto the tab 'Configure nRF Connect SDK Project'. The window comes up blank. And MCUboot project is not in my solution.
I am attaching .config and .config.old.
Do You Need Screenshots?
Do you need error logs? and where would they be found?
Hi,
Aha, I see the same. This works if you set CONFIG_BOOTLOADER_MCUBOOT=y in prj.conf instead of setting it via Configure nRF Connect SDK Project', and that is anyway where you need to set it for this to be persistent after you clean the build folder. So that should be an OK workaround. I have not been able to clarify why this fails though, but it seems there is a problem adding sub-images via SES like this.
No , that does not work. This is the error log...
Creating solution host.emProject
/usr/bin/cmake -GNinja -DBOARD=nrf52840dk_nrf52840 -DBOARD_DIR=/home/mykeb/ncs/zephyr/boards/arm/nrf52840dk_nrf52840 -B/home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/build_mcuboot_nrf52840 -S/home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host -DZEPHYR_TOOLCHAIN_VARIANT=gnuarmemb -DGNUARMEMB_TOOLCHAIN_PATH=/home/mykeb/gnuarmemb -DPYTHON_EXECUTABLE=python3 -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja -DDTC=/usr/bin/dtc -DEXTRA_KCONFIG_TARGETS=menuconfig_ses -DEXTRA_KCONFIG_TARGET_COMMAND_FOR_menuconfig_ses=/home/mykeb/arm_segger_embedded_studio_v560_linux_x64_nordic/html/configure_nordic_project_menuconfig.py
-- Application: /home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host
-- Zephyr version: 2.6.0-rc1 (/home/mykeb/ncs/zephyr), build: v2.6.0-rc1-ncs1-4-g69e3ad6255f2
-- Found Python3: /usr/bin/python3.8 (found suitable exact version "3.8.10") found components: Interpreter
-- Found west (found suitable version "0.11.1", minimum required is "0.7.1")
-- Board: nrf52840dk_nrf52840
-- Cache files will be written to: /home/mykeb/.cache/zephyr
-- Found dtc: /usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
-- Found toolchain: gnuarmemb (/home/mykeb/gnuarmemb)
-- Found BOARD.dts: /home/mykeb/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840.dts
-- Generated zephyr.dts: /home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/build_mcuboot_nrf52840/zephyr/zephyr.dts
-- Generated devicetree_unfixed.h: /home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/build_mcuboot_nrf52840/zephyr/include/generated/devicetree_unfixed.h
-- Generated device_extern.h: /home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/build_mcuboot_nrf52840/zephyr/include/generated/device_extern.h
Parsing /home/mykeb/ncs/zephyr/Kconfig
Loaded configuration '/home/mykeb/ncs/zephyr/boards/arm/nrf52840dk_nrf52840/nrf52840dk_nrf52840_defconfig'
Merged configuration '/home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/prj.conf'
Configuration saved to '/home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/build_mcuboot_nrf52840/zephyr/.config'
Kconfig header saved to '/home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/build_mcuboot_nrf52840/zephyr/include/generated/autoconf.h'
-- The C compiler identification is GNU 9.2.1
-- The CXX compiler identification is GNU 9.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /home/mykeb/gnuarmemb/bin/arm-none-eabi-gcc
-- Application: /home/mykeb/ncs/bootloader/mcuboot/boot/zephyr
-- Zephyr version: 2.6.0-rc1 (/home/mykeb/ncs/zephyr), build: v2.6.0-rc1-ncs1-4-g69e3ad6255f2
-- Found west (found suitable version "0.11.1", minimum required is "0.7.1")
-- Configuring incomplete, errors occurred!
-- Configuring incomplete, errors occurred!
See also "/home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/build_mcuboot_nrf52840/CMakeFiles/CMakeOutput.log".
See also "/home/mykeb/ncs/nrf/samples/gazell/gzp_dynamic_pairing/host/build_mcuboot_nrf52840/CMakeFiles/CMakeError.log".
Including boilerplate (Zephyr base): /home/mykeb/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/mykeb/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
The OLD behavior for policy CMP0079 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
/home/mykeb/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
/home/mykeb/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:35 (include_boilerplate)
CMakeLists.txt:8 (find_package)
=== child image mcuboot - begin ===
Including boilerplate (Zephyr base (cached)): /home/mykeb/ncs/zephyr/cmake/app/boilerplate.cmake
CMake Deprecation Warning at /home/mykeb/ncs/zephyr/cmake/app/boilerplate.cmake:37 (cmake_policy):
The OLD behavior for policy CMP0079 will be removed from a future version
of CMake.
The cmake-policies(7) manual explains that the OLD behaviors of all
policies are deprecated and that a policy should be set to OLD only under
specific short-term circumstances. Projects should be ported to the NEW
behavior and not rely on setting a policy to OLD.
Call Stack (most recent call first):
/home/mykeb/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
/home/mykeb/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
CMakeLists.txt:44 (find_package)
CMake Error at /home/mykeb/ncs/zephyr/cmake/app/boilerplate.cmake:186 (message):
Source directory equals build directory. In-source builds are not
supported. Please specify a build directory, e.g. cmake -Bbuild -H.
Call Stack (most recent call first):
/home/mykeb/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:24 (include)
/home/mykeb/ncs/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:40 (include_boilerplate)
CMakeLists.txt:44 (find_package)
CMake Error at /home/mykeb/ncs/nrf/cmake/multi_image.cmake:303 (message):
CMake generation for mcuboot failed, aborting. Command: 1
Call Stack (most recent call first):
/home/mykeb/ncs/nrf/cmake/multi_image.cmake:84 (add_child_image_from_source)
/home/mykeb/ncs/nrf/modules/mcuboot/CMakeLists.txt:112 (add_child_image)
error: cmake failed
create_nordic_project.py failed (1)
all of the errors suggest the solution is lacking proper cmake directions. And you must be able run 'Configure nRF Connect Project' otherwise you will have a bad ZEPHYR build.