nrf9160 mcuboot link failure searching for z_impl_k_sleep.. is CONFIG_MULTITHREADING required?

I am porting an application from NCS v2.3.0 -> NCS v2.4.0.    My application runs in nrf5340dk_nrf5340_cpuapp_ns with NSIB and mcuboot.  The mcuboot uses external flash for the secondary partition. The application also includes a secure partition to implement custom security services

I have been able to get my code to compile clean and boot to the non-secure app for nrf5340dk_nrf5340_cpuapp.

Now I am also trying to implement the same features on the nrf9160dk_nrf9160_ns.  I changed the --board option in the call to west and removed BLE focused overlays.  I am getting a strange linking error that I don't understand:

:/aa/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(main.c.obj): in function `k_sleep':
D:\AA\prov\provisioning_image\smp_svr\build_9160_shell\mcuboot\zephyr\include\generated\syscalls\kernel.h:100: undefined reference to `z_impl_k_sleep'
d:/aa/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(main.c.obj): in function `k_sem_give':
D:\AA\prov\provisioning_image\smp_svr\build_9160_shell\mcuboot\zephyr\include\generated\syscalls\kernel.h:1089: undefined reference to `z_impl_k_sem_give'
d:/aa/toolchains/31f4403e35/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd.exe: app/libapp.a(main.c.obj): in function `k_thread_create':
D:\AA\prov\provisioning_image\smp_svr\build_9160_shell\mcuboot\zephyr\include\generated\syscalls\kernel.h:50: undefined reference to `z_impl_k_thread_create'

I find these functions are defined in zephyr/kernel/sched.c which is only included if CONFIG_MULTITHREAD, however the mcuboot build does not have CONFIG_MULTITHREAD. 

Does nrf9160 mcuboot need CONFIG_MULTITHREAD even though nrf5340 mcuboot does not?

Parents
  • It appears this problem is due to not setting CONFIG_LOG_MODE_MINIMAL=y.  For nr5340 the CONFIG_LOG_MODE_MINIMAL is always y, but for nrf9160 its necessary to explicitly set it to y.

    With CONFIG_LOG_MODE_MINIMAL=n (or not set) then CONFIG_MULTITHREADING is required to support the logging thread.


  • Hi everyone,

    I'm encountering an issue with MCUboot on NCS 2.7.0 and my custom board based on the nRF52840. The bootloader was functioning correctly with NCS 2.4.0, but now I'm unable to build due to the following error:

    ```
    phyr-eabi/bin/ld.bfd.exe: modules/nrf/drivers/mpsl/flash_sync/lib..__nrf__drivers__mpsl__flash_sync.a(flash_sync_mpsl.c.obj): in function `k_sem_reset': F:/ncs/htrace-firmwares/firmware-bt840/CB2/mcuboot/zephyr/include/generated/syscalls/kernel.h:1137: undefined reference to `z_impl_k_sem_reset'
    ```

    I've created a `mcuboot.conf` file and tried adding `CONFIG_LOG_MODE_MINIMAL=y`, but the error persists.

    When I add `CONFIG_MULTITHREADING=y`, I can successfully build, but then I run out of flash space.

    Has anyone encountered this issue or can offer any suggestions? Your help would be greatly appreciated.

Reply

  • Hi everyone,

    I'm encountering an issue with MCUboot on NCS 2.7.0 and my custom board based on the nRF52840. The bootloader was functioning correctly with NCS 2.4.0, but now I'm unable to build due to the following error:

    ```
    phyr-eabi/bin/ld.bfd.exe: modules/nrf/drivers/mpsl/flash_sync/lib..__nrf__drivers__mpsl__flash_sync.a(flash_sync_mpsl.c.obj): in function `k_sem_reset': F:/ncs/htrace-firmwares/firmware-bt840/CB2/mcuboot/zephyr/include/generated/syscalls/kernel.h:1137: undefined reference to `z_impl_k_sem_reset'
    ```

    I've created a `mcuboot.conf` file and tried adding `CONFIG_LOG_MODE_MINIMAL=y`, but the error persists.

    When I add `CONFIG_MULTITHREADING=y`, I can successfully build, but then I run out of flash space.

    Has anyone encountered this issue or can offer any suggestions? Your help would be greatly appreciated.

Children
No Data
Related