Can't generate file with MCUBoot header.

Hello,

I'm trying to make a application bootable through MCUBoot but I'm having a hard time generating the .bin file with MCUBoot header.
According to this page I should be able to turn my application bootable by adding both CONFIG_BOOTLOADER_MCUBOOT and CONFIG_SECURE_BOOT configs to my prj.conf file, right?

Doing so I still don't get a .bin (or .signed.bin) file with MCUBoot header to upload through AuTerm as advised in the Academy guide.
I do generate a zephyr.bin in my ./build/APP_NAME/zephyr folder, but I can't upload it:

Am I missing some step?

  • Hello,

    SDK v2.7.0 introduced sysbuild configurations to enable MCUBoot and the Nordic Secure Immutable Bootloader (NSIB) replacing CONFIG_BOOTLOADER_MCUBOOT and CONFIG_SECURE_BOOT. However, it seems that the documentation you found has not been updated to reflect this. This is unfortunate, and I will report it internally.

    Migrating from multi-image builds to sysbuild - overview of Kconfig symbols which has been moved to sysbuild.

    https://academy.nordicsemi.com/courses/nrf-connect-sdk-intermediate/lessons/lesson-9-bootloaders-and-dfu-fota/ 

    To enable MCUBoot in your current project, create a new file named sysbuild.conf for your sysbuild configuration and place it in the project root. Note: You must perform a clean build after adding the file for it to be detected by the build system. Then add this line:

    3554.sysbuild.conf

    Best regards,

    Vidar

  • Thank you for the reply.

    I tried that as well, but then I get errors when building the application:

    (Sorry, inserting as code wasn't working, I don't know why)

    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/zephyr_pre0.map 
    cmd.exe /C "cd . && C:\ncs\toolchains\b620d30767\opt\zephyr-sdk\arm-zephyr-eabi\bin\arm-zephyr-eabi-gcc.exe -Os -DNDEBUG -gdwarf-4 -gdwarf-4 zephyr/CMakeFiles/zephyr_pre0.dir/misc/empty_file.c.obj -o zephyr\zephyr_pre0.elf  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=C:/ProgramData/Repositories/app_name/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/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/lib/net_buf/liblib__net_buf.a  zephyr/soc/soc/nrf52840/libsoc__nordic.a  zephyr/subsys/random/libsubsys__random.a  zephyr/subsys/bluetooth/common/libsubsys__bluetooth__common.a  zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a  zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a  zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/entropy/libdrivers__entropy.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/timer/libdrivers__timer.a  modules/nrf/lib/fprotect/lib..__nrf__lib__fprotect.a  modules/nrf/drivers/hw_cc3xx/lib..__nrf__drivers__hw_cc3xx.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -LC:/ProgramData/Repositories/app_name/build/mcuboot/zephyr  zephyr/arch/common/libisr_tables.a  -mcpu=cortex-m4  -mthumb  -mabi=aapcs  -mfpu=fpv4-sp-d16  -mfloat-abi=hard  -mfp16-format=ieee  -fuse-ld=bfd  -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  -Wl,-no-pie  C:/ncs/v2.9.0/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/hard-float/no-interrupts/libnrf_cc310_platform_0.9.19.a  C:/ncs/v2.9.0/nrfxlib/crypto/nrf_cc310_bl/lib/cortex-m4/hard-float/no-interrupts/libnrf_cc310_bl_0.9.12.a -L"c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v7e-m+fp/hard" -lc -lgcc && cmd.exe /C "cd /D C:\ProgramData\Repositories\app_name\build\mcuboot\zephyr && C:\ncs\toolchains\b620d30767\opt\bin\cmake.exe -E true""
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(soc_flash_nrf_ticker.c.obj): in function `k_sem_give':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(soc_flash_nrf_ticker.c.obj): in function `k_sem_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(soc_flash_nrf_ticker.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a(lll_adv.c.obj): in function `k_sem_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a(lll_adv.c.obj): in function `lll_adv_reset':
    C:/ncs/v2.9.0/zephyr/subsys/bluetooth/controller/ll_sw/nordic/lll/lll_adv.c:237: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a(lll_adv.c.obj): in function `k_sem_reset':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1137: undefined reference to `z_impl_k_sem_reset'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a(lll_adv.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a(lll_adv.c.obj): in function `k_sem_reset':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1137: undefined reference to `z_impl_k_sem_reset'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/ll_sw/nordic/libsubsys__bluetooth__controller__ll_sw__nordic.a(lll_adv.c.obj): in function `k_sem_give':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a(thread_abort.c.obj): in function `z_impl_k_thread_abort':
    C:/ncs/v2.9.0/zephyr/arch/arm/core/cortex_m/thread_abort.c:53: undefined reference to `z_thread_abort'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/lib/net_buf/liblib__net_buf.a(buf.c.obj): in function `net_buf_destroy':
    C:/ncs/v2.9.0/zephyr/include/zephyr/net_buf.h:1480: undefined reference to `k_queue_prepend'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/lib/net_buf/liblib__net_buf.a(buf.c.obj): in function `k_queue_get':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:694: undefined reference to `z_impl_k_queue_get'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:694: undefined reference to `z_impl_k_queue_get'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/lib/net_buf/liblib__net_buf.a(buf.c.obj): in function `k_sched_current_thread_query':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:216: undefined reference to `z_impl_k_sched_current_thread_query'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/lib/net_buf/liblib__net_buf.a(buf.c.obj): in function `net_buf_alloc_len':
    C:/ncs/v2.9.0/zephyr/lib/net_buf/buf.c:348: undefined reference to `k_sys_work_q'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `k_sem_give':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `bt_tx_irq_raise':
    C:/ncs/v2.9.0/zephyr/subsys/bluetooth/host/hci_core.c:4752: undefined reference to `k_work_submit'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `k_queue_get':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:694: undefined reference to `z_impl_k_queue_get'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `k_sem_give':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `k_sem_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `bt_hci_cmd_send_sync':
    C:/ncs/v2.9.0/zephyr/subsys/bluetooth/host/hci_core.c:396: undefined reference to `k_queue_append'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `k_sched_current_thread_query':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:216: undefined reference to `z_impl_k_sched_current_thread_query'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `k_queue_peek_head':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:726: undefined reference to `z_impl_k_queue_peek_head'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/host/libsubsys__bluetooth__host.a(hci_core.c.obj): in function `bt_hci_cmd_send_sync':
    C:/ncs/v2.9.0/zephyr/subsys/bluetooth/host/hci_core.c:440: undefined reference to `k_sys_work_q'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(ull.c.obj): in function `k_sem_give':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(ull.c.obj): in function `k_sem_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(ull.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(ull.c.obj): in function `k_sem_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(ull.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_queue_get':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:694: undefined reference to `z_impl_k_queue_get'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_yield':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:184: undefined reference to `z_impl_k_yield'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `prio_recv_thread':
    C:/ncs/v2.9.0/zephyr/subsys/bluetooth/controller/hci/hci_driver.c:411: undefined reference to `k_queue_append'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_queue_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:626: undefined reference to `z_impl_k_queue_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_sem_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_thread_create':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:85: undefined reference to `z_impl_k_thread_create'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_thread_name_set':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:436: undefined reference to `z_impl_k_thread_name_set'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_thread_create':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:85: undefined reference to `z_impl_k_thread_create'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_thread_name_set':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:436: undefined reference to `z_impl_k_thread_name_set'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `cmd_handle':
    C:/ncs/v2.9.0/zephyr/subsys/bluetooth/controller/hci/hci_driver.c:760: undefined reference to `k_queue_append'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `hci_recv_fifo_reset':
    C:/ncs/v2.9.0/zephyr/subsys/bluetooth/controller/hci/hci_driver.c:293: undefined reference to `k_sched_lock'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_queue_cancel_wait':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:643: undefined reference to `z_impl_k_queue_cancel_wait'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `k_queue_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:626: undefined reference to `z_impl_k_queue_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/subsys/bluetooth/controller/libsubsys__bluetooth__controller.a(hci_driver.c.obj): in function `hci_recv_fifo_reset':
    C:/ncs/v2.9.0/zephyr/subsys/bluetooth/controller/hci/hci_driver.c:296: undefined reference to `k_sched_unlock'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/entropy/libdrivers__entropy.a(entropy_nrf5.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/entropy/libdrivers__entropy.a(entropy_nrf5.c.obj): in function `k_sem_give':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/entropy/libdrivers__entropy.a(entropy_nrf5.c.obj): in function `k_sem_take':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/entropy/libdrivers__entropy.a(entropy_nrf5.c.obj): in function `k_sem_init':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1086: undefined reference to `z_impl_k_sem_init'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/entropy/libdrivers__entropy.a(entropy_nrf5.c.obj): in function `k_sem_give':
    C:/ProgramData/Repositories/app_name/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj):(.rodata.spi_nor_0_config+0x0): undefined reference to `__device_dts_ord_108'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/kernel/libkernel.a(poll.c.obj): in function `signal_poller':
    C:/ncs/v2.9.0/zephyr/kernel/poll.c:275: undefined reference to `z_unpend_thread'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: C:/ncs/v2.9.0/zephyr/kernel/poll.c:283: undefined reference to `z_ready_thread'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/kernel/libkernel.a(poll.c.obj): in function `signal_triggered_work':
    C:/ncs/v2.9.0/zephyr/kernel/poll.c:617: undefined reference to `z_work_submit_to_queue'
    c:/ncs/toolchains/b620d30767/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: zephyr/kernel/libkernel.a(poll.c.obj): in function `z_impl_k_poll_signal_raise':
    C:/ncs/v2.9.0/zephyr/kernel/poll.c:548: undefined reference to `z_reschedule'
    collect2.exe: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    [15/20] Generating ../dfu_application.zip
    FAILED: _sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build C:/ProgramData/Repositories/app_name/build/_sysbuild/sysbuild/images/bootloader/mcuboot-prefix/src/mcuboot-stamp/mcuboot-build 
    cmd.exe /C "cd /D C:\ProgramData\Repositories\app_name\build\mcuboot && C:\ncs\toolchains\b620d30767\opt\bin\cmake.exe --build ."
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: 'C:\ncs\toolchains\b620d30767\opt\bin\cmake.EXE' --build C:/ProgramData/Repositories/app_name/build

  • Are you building the project for a custom board you have defined, or are you building for the nrf52840dk/nrf52840 target? The section of the build log you posted shows that you are getting multiple linker errors when trying to build the MCUBoot image because it is including the Bluetooth controller. However, I'm not sure why the bootloader would attempt to include the Bluetooth controller as this is not supported.

  • It's a custom board based on the nRF52840 soc.

    I have the board with a bootloader am I am able to update its firmware through serial USB (tried with some samples from Nordic academy). So now I need to make my main application bootable, so I can upload it through USB.

    But I couldn't figure out what I need to do to generate a .bin(or a .signed.bin(?)) with the MCUboot header, so I can upload it through AuTerm as recommended in the Nordic academy course.

    So, summarizing:

    • I have a custom board based on the nRF52840
    • I have successfully uploaded and tested a bootloader (MCUboot) following the tutorial for Serial USB upload
    • I need to turn another application into bootable so I can upload it through the same method that I've used in the academy course.
  • The signed binary with the MCUBoot image header (zephyr.signed.bin) will be automatically generated if you configure your project to include the MCUBoot image (i.e., set SB_CONFIG_BOOTLOADER_MCUBOOT=y in sysbuild).

    The MCUBoot build failed according to the build output you posted in the previous comment, and it is still unclear to me how the bootloader got configured to enable BLE in your project. ' This is why I was wondering if you were building the project for a custom defined board or if you were building with the nRF52840 DK as your build target.

    Can you list the changes you made to include the bootloader and enable DFU in your project?

Related