Not able to build mcuboot bootloader for nrf7002dk

Hello,

Some pertinent information: We have tested on both ncs V2.5.0 and V2.5.1, and are using zephyr toolchain v0.16.1. We also will be performing OTA similarly to the aws_iot sample project found here: github.com/.../aws_iot

We have been developing on the nrf7002dk, which we have been quite impressed with, and are getting ready to implement OTA on it.

We have dealt with OTA in the past via BLE for the nrf52840, and the nrf52832. As such I tested building MCUboot for the nrf52840 on ncs V2.5.0 and v2.5.1, and there are no issues. We are getting issues specifically building MCUboot for the nrf7002dk. 

Any help on building/flashing MCUboot onto the nrf7002dk would be greatly appreciated!

Thanks,

Joe

  • Hi, 

    We are getting issues specifically building MCUboot for the nrf7002dk. 

    Could you describe what is the issue? Could you provide the logs? How do you build the mcuboot for nRF7002DK? Could yo also provide config files?

    Regards,
    Amanda H.

  • Hello Amanda,

    Thank you for following up on this case. 


    I am building MCUboot according to the README defined in the mcumgr sample code (which can be found here)

    The exact command I am running is as follows 

    west build -b nrf7002dk_nrf5340_cpuapp -d build_mcuboot bootloader/mcuboot/boot/zephyr

    I am running this command at the directory installed onto my computer from Nordic's "Toolchain Manager". When installing nRF Connect SDK v2.5.0 via the Toolchain Manager, it is downloaded to a directory labelled "v2.5.0". Attached is an image of the directory (and its contents).

    Please notice the "bootloader" directory specifically. This is what the bootloader is built from, and requires no modifying (i.e. there are no config files created by me for this process).

    Building and flashing the bootloader for both the nrf52832, and the nrf52840 have no issues. However, simply building the bootloader for the nrf7002dk is failing with the following errors

    [4/278] Generating include/generated/version.h
    -- Zephyr version: 3.4.99 (/home/{me}/ncs/v2.5.0/zephyr), build: v3.4.99-ncs1
    [273/278] Linking C executable zephyr/zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/{me}/ncs/v2.5.0/build_mcuboot/zephyr/zephyr_pre0.map 
    : && ccache /home/{me}/ncs/toolchains/7795df4459/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  zephyr/CMakeFiles/offsets.dir/./arch/arm/core/offsets/offsets.c.obj  -fuse-ld=bfd  -T  zephyr/linker_zephyr_pre0.cmd  -Wl,-Map=/home/{me}/ncs/v2.5.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/cortex_m/cmse/libarch__arm__core__aarch32__cortex_m__cmse.a  zephyr/arch/arch/arm/core/aarch32/mpu/libarch__arm__core__aarch32__mpu.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/arm/common/cortex_m/libsoc__arm__common__cortex_m.a  zephyr/drivers/clock_control/libdrivers__clock_control.a  zephyr/drivers/console/libdrivers__console.a  zephyr/drivers/flash/libdrivers__flash.a  zephyr/drivers/gpio/libdrivers__gpio.a  zephyr/drivers/pinctrl/libdrivers__pinctrl.a  zephyr/drivers/serial/libdrivers__serial.a  zephyr/drivers/timer/libdrivers__timer.a  modules/nrf/lib/fprotect/lib..__nrf__lib__fprotect.a  modules/nrf/lib/fatal_error/lib..__nrf__lib__fatal_error.a  modules/nrf/drivers/hw_cc310/lib..__nrf__drivers__hw_cc310.a  modules/mcuboot/boot/bootutil/zephyr/libmcuboot_util.a  modules/mbedtls/libmbedTLSBase.a  modules/mbedtls/libmbedTLSCrypto.a  modules/mbedtls/libmbedTLSX509.a  modules/mbedtls/libmodules__mbedtls.a  modules/hal_nordic/nrfx/libmodules__hal_nordic__nrfx.a  -Wl,--no-whole-archive  zephyr/kernel/libkernel.a  -L"/home/{me}/ncs/toolchains/7795df4459/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v8-m.main/nofp"  -L/home/{me}/ncs/v2.5.0/build_mcuboot/zephyr  -lgcc  zephyr/arch/common/libisr_tables.a  modules/mbedtls/libmbedTLSBase.a  modules/mbedtls/libmbedTLSCrypto.a  modules/mbedtls/libmbedTLSX509.a  -mcpu=cortex-m33  -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  -Wl,-no-pie  /home/{me}/ncs/v2.5.0/nrfxlib/crypto/nrf_cc312_platform/lib/cortex-m33/soft-float/no-interrupts/libnrf_cc312_platform_0.9.18.a && cd /home/{me}/ncs/v2.5.0/build_mcuboot/zephyr && /usr/bin/cmake -E true
    /home/{me}/ncs/toolchains/7795df4459/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj): in function `k_sleep':
    /home/{me}/ncs/v2.5.0/build_mcuboot/zephyr/include/generated/syscalls/kernel.h:135: undefined reference to `z_impl_k_sleep'
    /home/{me}/ncs/toolchains/7795df4459/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: /home/{me}/ncs/v2.5.0/build_mcuboot/zephyr/include/generated/syscalls/kernel.h:135: undefined reference to `z_impl_k_sleep'
    /home/{me}/ncs/toolchains/7795df4459/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: zephyr/drivers/flash/libdrivers__flash.a(spi_nor.c.obj):(.rodata.spi_nor_config_0+0x0): undefined reference to `__device_dts_ord_143'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    

    To reproduce this issue, it should be as simple as going to the ncs v2.5.0 directory, and running

    west build -b nrf7002dk_nrf5340_cpuapp -d build_mcuboot bootloader/mcuboot/boot/zephyr

    Please let me know if you have any further questions for me.

    Thanks,



    Joe

  • Hi Joe, 

    I would suggest you build the MCUboot as the child image (CONFIG_BOOTLOADER_MCUBOOT=y) as our samples did instead of using it directly.  

    Do you want to send DFU over Wi-Fi, Bluetooth Low Energy, or serial? If using Wi-Fi, you can refer to the AWS IoT sample and Azure IoT Hub sample which support both the nRF7002DK and FOTA over IP.

    -Amanda H.

  • Hello Amanda,

    It is now working. Thank you for providing that. I had the misconception that I had to manually build and flash the bootloader (as I am used to on the nrf52 series).

    I have it working on both Wi-Fi and BLE.

    Thanks again,

    Joe

Related