Hello world + mcuboot build errors out of the box

Hi!

I'm working with the nRF52833 in a Laird dev kit, the bl653_dvk and I cannot build a Hello World with mcuboot application in nrf sdk 1.7.0 or greater.

Although in 1.5.1 works fine.

building with the following command in sdk 1.7.1

west build -b bl653_dvk -- -DCONFIG_BOOTLOADER_MCUBOOT=y

gives the following error:

/home/pau/gnuarmemb/10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.bfd: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_sem_give':
/home/pau/ncs/zephyr/samples/hello_world/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:841: undefined reference to `z_impl_k_sem_give'
/home/pau/gnuarmemb/10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.bfd: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_mutex_lock':
/home/pau/ncs/zephyr/samples/hello_world/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:724: undefined reference to `z_impl_k_mutex_lock'
/home/pau/gnuarmemb/10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.bfd: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_sem_take':
/home/pau/ncs/zephyr/samples/hello_world/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:826: undefined reference to `z_impl_k_sem_take'
/home/pau/gnuarmemb/10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.bfd: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_mutex_unlock':
/home/pau/ncs/zephyr/samples/hello_world/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:738: undefined reference to `z_impl_k_mutex_unlock'
/home/pau/gnuarmemb/10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.bfd: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_sem_init':
/home/pau/ncs/zephyr/samples/hello_world/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:810: undefined reference to `z_impl_k_sem_init'
/home/pau/gnuarmemb/10-2020-q4-major/bin/../lib/gcc/arm-none-eabi/10.2.1/../../../../arm-none-eabi/bin/ld.bfd: zephyr/drivers/sensor/nrf5/libdrivers__sensor__nrf5.a(temp_nrf5.c.obj): in function `k_mutex_init':
/home/pau/ncs/zephyr/samples/hello_world/build/mcuboot/zephyr/include/generated/syscalls/kernel.h:708: undefined reference to `z_impl_k_mutex_init'

Am I missing something?

Thanks

Parents Reply Children
  • Thanks for the answer,

    How can I apply this fix?

    Because this fix was made in the zephyr official repository and the nrf connect is working on its own soft fork sdk-zephyr which includes an older zephyr version.

    Hardcoding the change just does not work, cmakes fails at building.

    Thanks

  • The pull request doesn't fix the problem per se, as it only adds a dependency link so that Kconfig will fail at an earlier stage.

     

    What you can do is to adjust calibration skip like this when enabling mcuboot:

    $ west build -b bl653_dvk samples/hello_world/ -- \
    -DCONFIG_BOOTLOADER_MCUBOOT=y \
    -Dmcuboot_CONFIG_CLOCK_CONTROL_NRF_CALIBRATION_MAX_SKIP=0
    ...[6/164] Performing build step for 'mcuboot_subimage'
    [1/254] Preparing syscall dependency handling[247/254] Linking C executable zephyr/zephyr_prebuilt.elf[254/254] Linking C executable zephyr/zephyr.elf
    Memory region Used Size Region Size %age Used
     FLASH: 33972 B 48 KB 69.12%
      SRAM: 23720 B 128 KB 18.10%
      IDT_LIST: 0 GB 2 KB 0.00%
    [149/164] Linking C executable zephyr/zephyr_prebuilt.elf[156/164] Linking C executable zephyr/zephyr.elf
    Memory region Used Size Region Size %age Used
      FLASH: 19008 B 237056 B 8.02%
      SRAM: 6640 B 128 KB 5.07%
     IDT_LIST: 0 GB 2 KB 0.00%
    [164/164] Generating zephyr/merged.hex

     

     

    That said, it does look as the defaults for `bl653_dvk` itself are badly chosen, because the board tries to set an invalid set of config options when building MCUboot.

Related