Enabling MCU BOOT

Hi,

I have a project which has been working fine but since adding some date/time functionality, when I enable MCU_BOOT, I get linker errors that I can't seem to get to the bottom of.

If I set the following in prj.conf:

CONFIG_BOOTLOADER_MCUBOOT=n
I can compile and link OK.
If change to: 
CONFIG_BOOTLOADER_MCUBOOT=y
I get the following linker errors:
/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `k_work_delayable_is_pending':
/opt/nordic/ncs/v2.6.2/zephyr/include/zephyr/kernel.h:4050: undefined reference to `k_work_delayable_busy_get'
/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `date_time_core_schedule_update':
/opt/nordic/ncs/v2.6.2/nrf/lib/date_time/date_time_core.c:69: undefined reference to `k_work_reschedule'
/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `k_sem_give':
/Users/nick/Documents/Developement/Nordic/nRFConnect/helios_tracker_r4_SDK2.5.2/build_5/mcuboot/zephyr/include/generated/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
/opt/nordic/ncs/toolchains/580e4ef81c/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `k_sem_take':
/Users/nick/Documents/Developement/Nordic/nRFConnect/helios_tracker_r4_SDK2.5.2/build_5/mcuboot/zephyr/include/generated/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
 
I am running NCS v2.6.2.
Any idea what could be the issue?
Parents
  • Hi,

     

    Are you including the DATE_TIME library in your mcuboot?

    You can check this by searching in the build/mcuboot/zephyr/.config file and see if it is set.

     

    To n-select this in mcuboot, you can create "child_images/mcuboot.conf" and set the config CONFIG_DATE_TIME=n.

    Remember to remove your build folder and regenerate the project when adding/removing configuration files.

     

    Could you try this and report back if you still see this issue?

     

    Kind regards,

    Håkon

  • Håkon,

    Thanks!  This fixed the compilation issue.

    Nick

  • Glad to hear, Nick!

    Please feel free to contact us if you have any questions or issues.

     

    Hope you have a wonderful day!

     

    Kind regards,

    Håkon

  • Håkon,

    I am in the process of upgrading to to NCS v2.7.0 and have migrated my board to HWMv2 but I hit the same issue as above when compiling using MCUBOOT.
    i.e. with MCUBOOT disabled via:
    CONFIG_BOOTLOADER_MCUBOOT=n
    I can compile and link ok.

    With CONFIG_BOOTLOADER_MCUBOOT=y, I get:

    /opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `k_work_delayable_is_pending':
    /opt/nordic/ncs/v2.7.0/zephyr/include/zephyr/kernel.h:4064: undefined reference to `k_work_delayable_busy_get'
    /opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `date_time_core_schedule_update':
    /opt/nordic/ncs/v2.7.0/nrf/lib/date_time/date_time_core.c:72: undefined reference to `k_work_reschedule_for_queue'
    /opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `date_time_core_init':
    /opt/nordic/ncs/v2.7.0/nrf/lib/date_time/date_time_core.c:152: undefined reference to `k_work_queue_start'
    collect2: error: ld returned 1 exit status

    I added CONFIG_DATE_TIME=n to the MCBOOT prj.conf but this time it makes no difference.
    Any clues as to what might be the issue?

Reply
  • Håkon,

    I am in the process of upgrading to to NCS v2.7.0 and have migrated my board to HWMv2 but I hit the same issue as above when compiling using MCUBOOT.
    i.e. with MCUBOOT disabled via:
    CONFIG_BOOTLOADER_MCUBOOT=n
    I can compile and link ok.

    With CONFIG_BOOTLOADER_MCUBOOT=y, I get:

    /opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `k_work_delayable_is_pending':
    /opt/nordic/ncs/v2.7.0/zephyr/include/zephyr/kernel.h:4064: undefined reference to `k_work_delayable_busy_get'
    /opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `date_time_core_schedule_update':
    /opt/nordic/ncs/v2.7.0/nrf/lib/date_time/date_time_core.c:72: undefined reference to `k_work_reschedule_for_queue'
    /opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: modules/nrf/lib/date_time/lib..__nrf__lib__date_time.a(date_time_core.c.obj): in function `date_time_core_init':
    /opt/nordic/ncs/v2.7.0/nrf/lib/date_time/date_time_core.c:152: undefined reference to `k_work_queue_start'
    collect2: error: ld returned 1 exit status

    I added CONFIG_DATE_TIME=n to the MCBOOT prj.conf but this time it makes no difference.
    Any clues as to what might be the issue?

Children
Related