This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

MCUBoot linking error cannot find -l MCUBOOT_BOOTUTIL

Had this linking error when I tried to build the bootloader for nrf9160dk_nrf52840 calling

west build -b nrf9160dk_nrf52840 ..

the same error ocurred using

cmake -GNinja -DBOARD=nrf9160dk_nrf52840 ..

following the guide in the documentation

The error:

[251/256] Linking C executable zephyr/zephyr_prebuilt.elf
FAILED: zephyr/zephyr_prebuilt.elf
: && ccache /home/erlend/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc zephyr/CMakeFiles/zephyr_prebuilt.dir/misc/empty_file.c.obj -o zephyr/zephyr_prebuilt.elf -Wl,-T zephyr/linker.cmd -Wl,-Map=/home/erlend/src/ncs/bootloader/test52/mcuboot/boot/zephyr/build/build/zephyr/zephyr_prebuilt.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/cortex_m/mpu/libarch__arm__core__aarch32__cortex_m__mpu.a zephyr/lib/libc/minimal/liblib__libc__minimal.a zephyr/lib/posix/liblib__posix.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/nrf9160dk_nrf52840/libboards__arm__nrf9160dk_nrf52840.a zephyr/drivers/gpio/libdrivers__gpio.a zephyr/drivers/flash/libdrivers__flash.a zephyr/drivers/serial/libdrivers__serial.a modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a modules/nordic/lib..__modules__hal__nordic.a modules/mbedtls/lib..__modules__crypto__mbedtls.a modules/tinycbor/lib..__modules__lib__tinycbor__zephyr.a -Wl,--no-whole-archive zephyr/kernel/libkernel.a zephyr/CMakeFiles/offsets.dir/arch/arm/core/offsets/offsets.c.obj -L"/home/erlend/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/thumb/v7e-m/nofp" -L/home/erlend/src/ncs/bootloader/test52/mcuboot/boot/zephyr/build/build/zephyr -lgcc -Wl,--print-memory-usage zephyr/arch/common/libisr_tables.a /home/erlend/src/ncs/nrfxlib/crypto/nrf_cc310_platform/lib/cortex-m4/soft-float/no-interrupts/libnrf_cc310_platform_0.9.4.a -mcpu=cortex-m4 -mthumb -mabi=aapcs -Wl,--gc-sections -Wl,--build-id=none -Wl,--sort-common=descending -Wl,--sort-section=alignment -Wl,-u,_OffsetAbsSyms -Wl,-u,_ConfigAbsSyms -nostdlib -static -no-pie -Wl,-X -Wl,-N -Wl,--orphan-handling=warn -lMCUBOOT_BOOTUTIL && :
/home/erlend/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/9.2.0/../../../../arm-zephyr-eabi/bin/ld: cannot find -lMCUBOOT_BOOTUTIL
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Any help is much appreciated!

Parents Reply Children
No Data
Related