build mcuboot error

Im trying to follow the option 2 of this guide:

developer.nordicsemi.com/.../index.html

But I get the next error when type the next code:

west build -p -b nrf52840dongle_nrf52840 -d build_mcuboot mcuboot/boot/zephyr

Parents
  • Hi, 

    What OS are you using? 

    It seems the environment is not properly set up here. To use the Toolchain Manager, you would normally open the terminal from within the toolchain manager, and that would set up the environment correctly for you. You could either use VS Code with the nRF plugin, which will set up the toolchain automatically as long as you point to the right one, or you could configure the environment manually as you have attempted to do. You can see everything you need in ncs/toolchains/v2.2.0/environment.json.

    Regards,
    Amanda H.

  • I have found the next thread:

     RE: Different Fail Points Building MCUBoot With Different Zephyr Sources 

    Here we can find in the last post that including nrf52840dongle_nrf52840.overlay with the next content:

    &zephyr_udc0 {
      cdc_acm_uart0 {  
      compatible = "zephyr,cdc-acm-uart";
      label = "CDC_ACM_0";
      };
    };

    The problem is solved, and now I can build something more, but I get another error:

    west build -p -b nrf52840dongle_nrf52840 -d build_mcuboot mcuboot/boot/zephyr -- -DDTC_OVERLAY_FILE=nrf52840dongle_nrf52840.overlay
    -- west build: making build dir /home/scada/ncs/v2.2.0/build_mcuboot pristine
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/scada/ncs/v2.2.0/mcuboot/boot/zephyr
    -- Using NCS Toolchain 2.2.0 for building. (/home/scada/ncs/toolchains/v2.2.0/cmake)
    -- Found Python3: /home/scada/ncs/toolchains/v2.2.0/usr/local/bin/python3 (found suitable exact version "3.8.2") found components: Interpreter 
    -- Cache files will be written to: /home/scada/.cache/zephyr
    -- Zephyr version: 3.2.99 (/home/scada/ncs/v2.2.0/zephyr)
    -- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
    -- Board: nrf52840dongle_nrf52840
    -- Found host-tools: zephyr 0.15.1 (/home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.15.1 (/home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk)
    -- Found Dtc: /home/scada/ncs/toolchains/v2.2.0/usr/local/bin/dtc (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/scada/ncs/v2.2.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
    -- Found devicetree overlay: nrf52840dongle_nrf52840.overlay
    'label' is marked as deprecated in 'properties:' in /home/scada/ncs/v2.2.0/zephyr/dts/bindings/serial/zephyr,cdc-acm-uart.yaml for node /soc/usbd@40027000/cdc_acm_uart0.
    -- Generated zephyr.dts: /home/scada/ncs/v2.2.0/build_mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/scada/ncs/v2.2.0/build_mcuboot/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/scada/ncs/v2.2.0/build_mcuboot/zephyr/dts.cmake
    Parsing /home/scada/ncs/v2.2.0/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/home/scada/ncs/v2.2.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
    Merged configuration '/home/scada/ncs/v2.2.0/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/home/scada/ncs/v2.2.0/mcuboot/boot/zephyr/boards/nrf52840dongle_nrf52840.conf'
    Configuration saved to '/home/scada/ncs/v2.2.0/build_mcuboot/zephyr/.config'
    Kconfig header saved to '/home/scada/ncs/v2.2.0/build_mcuboot/zephyr/include/generated/autoconf.h'
    
    warning: LOG_DEFAULT_LEVEL (defined at /home/scada/ncs/v2.2.0/nrf/samples/Kconfig:98,
    subsys/logging/Kconfig.filtering:13) was assigned the value '0' but got the value ''. Check these
    unsatisfied dependencies: (LOG || LOG) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_DEFAULT_LEVEL and/or look up
    LOG_DEFAULT_LEVEL 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: The choice symbol LOG_MODE_MINIMAL (defined at subsys/logging/Kconfig.mode:28) was selected
    (set =y), but no symbol ended up as the choice selection. See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_MODE_MINIMAL and/or look up
    LOG_MODE_MINIMAL 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.
    
    -- The C compiler identification is GNU 12.1.0
    -- The CXX compiler identification is GNU 12.1.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    CMake Warning at /home/scada/ncs/v2.2.0/zephyr/subsys/usb/device/CMakeLists.txt:22 (message):
      CONFIG_USB_DEVICE_VID has default value 0x2FE3.
    
      This value is only for testing and MUST be configured for USB products.
    
    
    CMake Warning at /home/scada/ncs/v2.2.0/zephyr/subsys/usb/device/CMakeLists.txt:28 (message):
      CONFIG_USB_DEVICE_PID has default value 0x100.
    
      This value is only for testing and MUST be configured for USB products.
    
    
    CMake Warning at /home/scada/ncs/v2.2.0/nrf/lib/flash_patch/CMakeLists.txt:8 (message):
      
    
            ----------------------------------------------------------
            --- WARNING: To maintain the integrity of secure boot, ---
            --- enable CONFIG_DISABLE_FLASH_PATCH in production.   ---
            ----------------------------------------------------------
    
    
    MCUBoot bootloader key file: /home/scada/ncs/v2.2.0/mcuboot/root-rsa-2048.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/scada/ncs/v2.2.0/build_mcuboot
    -- west build: building application
    [1/304] Preparing syscall dependency handling
    
    [2/304] Generating include/generated/version.h
    -- Zephyr version: 3.2.99 (/home/scada/ncs/v2.2.0/zephyr), build: v3.2.99-ncs1
    [294/304] Linking C executable zephyr/zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map 
    : && ccache /home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  -fuse-ld=bfd  -Wl,-T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/home/scada/ncs/v2.2.0/build_mcuboot/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a  zephyr/boards/arm/nrf52840dongle_nrf52840/libboards__arm__nrf52840dongle_nrf52840.a  zephyr/drivers/usb/device/libdrivers__usb__device.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/hwinfo/libdrivers__hwinfo.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/mbedtls/libmodules__mbedtls.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"/home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/thumb/v7e-m/nofp"  -L/home/scada/ncs/v2.2.0/build_mcuboot/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -no-pie  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  /home/scada/ncs/v2.2.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.16.a && cd /home/scada/ncs/v2.2.0/build_mcuboot/zephyr && /home/scada/ncs/toolchains/v2.2.0/usr/local/lib/python3.8/site-packages/cmake/data/bin/cmake -E echo
    /home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/scada/ncs/v2.2.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.16.a(mbedtls_common.c.obj): in function `mbedtls_platform_zeroize':
    mbedtls_common.c:(.text.mbedtls_platform_zeroize+0x0): multiple definition of `mbedtls_platform_zeroize'; modules/mbedtls/libmodules__mbedtls.a(platform_util.c.obj):/home/scada/ncs/v2.2.0/modules/crypto/mbedtls/library/platform_util.c:71: first defined here
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/scada/ncs/toolchains/v2.2.0/usr/local/bin/cmake --build /home/scada/ncs/v2.2.0/build_mcuboot
    

    Any idea?

Reply
  • I have found the next thread:

     RE: Different Fail Points Building MCUBoot With Different Zephyr Sources 

    Here we can find in the last post that including nrf52840dongle_nrf52840.overlay with the next content:

    &zephyr_udc0 {
      cdc_acm_uart0 {  
      compatible = "zephyr,cdc-acm-uart";
      label = "CDC_ACM_0";
      };
    };

    The problem is solved, and now I can build something more, but I get another error:

    west build -p -b nrf52840dongle_nrf52840 -d build_mcuboot mcuboot/boot/zephyr -- -DDTC_OVERLAY_FILE=nrf52840dongle_nrf52840.overlay
    -- west build: making build dir /home/scada/ncs/v2.2.0/build_mcuboot pristine
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/scada/ncs/v2.2.0/mcuboot/boot/zephyr
    -- Using NCS Toolchain 2.2.0 for building. (/home/scada/ncs/toolchains/v2.2.0/cmake)
    -- Found Python3: /home/scada/ncs/toolchains/v2.2.0/usr/local/bin/python3 (found suitable exact version "3.8.2") found components: Interpreter 
    -- Cache files will be written to: /home/scada/.cache/zephyr
    -- Zephyr version: 3.2.99 (/home/scada/ncs/v2.2.0/zephyr)
    -- Found west (found suitable version "0.14.0", minimum required is "0.7.1")
    -- Board: nrf52840dongle_nrf52840
    -- Found host-tools: zephyr 0.15.1 (/home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.15.1 (/home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk)
    -- Found Dtc: /home/scada/ncs/toolchains/v2.2.0/usr/local/bin/dtc (found suitable version "1.4.7", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/scada/ncs/v2.2.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840.dts
    -- Found devicetree overlay: nrf52840dongle_nrf52840.overlay
    'label' is marked as deprecated in 'properties:' in /home/scada/ncs/v2.2.0/zephyr/dts/bindings/serial/zephyr,cdc-acm-uart.yaml for node /soc/usbd@40027000/cdc_acm_uart0.
    -- Generated zephyr.dts: /home/scada/ncs/v2.2.0/build_mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/scada/ncs/v2.2.0/build_mcuboot/zephyr/include/generated/devicetree_generated.h
    -- Including generated dts.cmake file: /home/scada/ncs/v2.2.0/build_mcuboot/zephyr/dts.cmake
    Parsing /home/scada/ncs/v2.2.0/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/home/scada/ncs/v2.2.0/zephyr/boards/arm/nrf52840dongle_nrf52840/nrf52840dongle_nrf52840_defconfig'
    Merged configuration '/home/scada/ncs/v2.2.0/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/home/scada/ncs/v2.2.0/mcuboot/boot/zephyr/boards/nrf52840dongle_nrf52840.conf'
    Configuration saved to '/home/scada/ncs/v2.2.0/build_mcuboot/zephyr/.config'
    Kconfig header saved to '/home/scada/ncs/v2.2.0/build_mcuboot/zephyr/include/generated/autoconf.h'
    
    warning: LOG_DEFAULT_LEVEL (defined at /home/scada/ncs/v2.2.0/nrf/samples/Kconfig:98,
    subsys/logging/Kconfig.filtering:13) was assigned the value '0' but got the value ''. Check these
    unsatisfied dependencies: (LOG || LOG) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_DEFAULT_LEVEL and/or look up
    LOG_DEFAULT_LEVEL 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: The choice symbol LOG_MODE_MINIMAL (defined at subsys/logging/Kconfig.mode:28) was selected
    (set =y), but no symbol ended up as the choice selection. See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_MODE_MINIMAL and/or look up
    LOG_MODE_MINIMAL 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.
    
    -- The C compiler identification is GNU 12.1.0
    -- The CXX compiler identification is GNU 12.1.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    CMake Warning at /home/scada/ncs/v2.2.0/zephyr/subsys/usb/device/CMakeLists.txt:22 (message):
      CONFIG_USB_DEVICE_VID has default value 0x2FE3.
    
      This value is only for testing and MUST be configured for USB products.
    
    
    CMake Warning at /home/scada/ncs/v2.2.0/zephyr/subsys/usb/device/CMakeLists.txt:28 (message):
      CONFIG_USB_DEVICE_PID has default value 0x100.
    
      This value is only for testing and MUST be configured for USB products.
    
    
    CMake Warning at /home/scada/ncs/v2.2.0/nrf/lib/flash_patch/CMakeLists.txt:8 (message):
      
    
            ----------------------------------------------------------
            --- WARNING: To maintain the integrity of secure boot, ---
            --- enable CONFIG_DISABLE_FLASH_PATCH in production.   ---
            ----------------------------------------------------------
    
    
    MCUBoot bootloader key file: /home/scada/ncs/v2.2.0/mcuboot/root-rsa-2048.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/scada/ncs/v2.2.0/build_mcuboot
    -- west build: building application
    [1/304] Preparing syscall dependency handling
    
    [2/304] Generating include/generated/version.h
    -- Zephyr version: 3.2.99 (/home/scada/ncs/v2.2.0/zephyr), build: v3.2.99-ncs1
    [294/304] Linking C executable zephyr/zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map 
    : && ccache /home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc  -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr/zephyr_pre0.elf  -fuse-ld=bfd  -Wl,-T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/home/scada/ncs/v2.2.0/build_mcuboot/zephyr/zephyr_pre0.map  -Wl,--whole-archive  app/libapp.a  zephyr/libzephyr.a  zephyr/arch/common/libarch__common.a  zephyr/arch/arch/arm/core/aarch32/libarch__arm__core__aarch32.a  zephyr/arch/arch/arm/core/aarch32/cortex_m/libarch__arm__core__aarch32__cortex_m.a  zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/soc/arm/nordic_nrf/nrf52/libsoc__arm__nordic_nrf__nrf52.a  zephyr/boards/arm/nrf52840dongle_nrf52840/libboards__arm__nrf52840dongle_nrf52840.a  zephyr/drivers/usb/device/libdrivers__usb__device.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/hwinfo/libdrivers__hwinfo.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/mbedtls/libmodules__mbedtls.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -L"/home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/thumb/v7e-m/nofp"  -L/home/scada/ncs/v2.2.0/build_mcuboot/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  -no-pie  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfp16-format=ieee  -Wl,--gc-sections  -Wl,--build-id=none  -Wl,--sort-common=descending  -Wl,--sort-section=alignment  -Wl,-u,_OffsetAbsSyms  -Wl,-u,_ConfigAbsSyms  -nostdlib  -static  -Wl,-X  -Wl,-N  -Wl,--orphan-handling=warn  /home/scada/ncs/v2.2.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.16.a && cd /home/scada/ncs/v2.2.0/build_mcuboot/zephyr && /home/scada/ncs/toolchains/v2.2.0/usr/local/lib/python3.8/site-packages/cmake/data/bin/cmake -E echo
    /home/scada/ncs/toolchains/v2.2.0/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.1.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/scada/ncs/v2.2.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.16.a(mbedtls_common.c.obj): in function `mbedtls_platform_zeroize':
    mbedtls_common.c:(.text.mbedtls_platform_zeroize+0x0): multiple definition of `mbedtls_platform_zeroize'; modules/mbedtls/libmodules__mbedtls.a(platform_util.c.obj):/home/scada/ncs/v2.2.0/modules/crypto/mbedtls/library/platform_util.c:71: first defined here
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/scada/ncs/toolchains/v2.2.0/usr/local/bin/cmake --build /home/scada/ncs/v2.2.0/build_mcuboot
    

    Any idea?

Children
Related