Cannot successfully build mcuboot on ncs 2.7.0

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.

  • Hello,

    Are you trying to add the MPSL into the bootloader? Or do I misunderstand something here?

    Best regards,

    Edvin

  • Hi ,

    I'm not sure if I understand the question. I'm just trying to add the mcuboot servirce to my firmware as I successfuly did with ncs 2.4.0.

    I have my own kconfig definition:

        config BOOTLOADER
            bool "Enable OTA and dependencies"
            select FLASH
            select BT
            select BT_PERIPHERAL
            select NCS_SAMPLE_MCUMGR_BT_OTA_DFU
            select MCUMGR
            select MCUMGR_TRANSPORT_BT
            imply MCUMGR_TRANSPORT_UART
            select MCUMGR_GRP_IMG
            select BOOTLOADER_MCUBOOT
            select MCUMGR_TRANSPORT_BT_REASSEMBLY
            select MCUMGR_GRP_OS_MCUMGR_PARAMS
        endmenu

    Then in my prj.conf I set:

    CONFIG_BOOTLOADER=y

    When I build the project with this setup and ncs 2.4.0 the MCUboot image is created. But with NCS.2.7.0 the build fails with this 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 been following other related post on the devzone, where some fixed the error using:

    `CONFIG_LOG_MODE_MINIMAL=y`,

    but it doesnt work.

    The, I tried adding

    CONFIG_MULTITHREADING=y

    Then I'm able to build the mcuboot image, but the image size is too big.

  • Hello,

    I am terribly sorry for the late reply. I was pulled out of DevZone for a couple of weeks, but I am back now. 

    Interesting. Adding that snippet to the peripheral_uart sample's Kconfig file seems to work just fine. So I guess it is some other part not being included properly.

    Do you have these in your main.c?

    #include <zephyr/types.h>
    #include <zephyr/kernel.h>

    If that is not the issue, can you please zip the application you are working on, so that I can have a look? There may be another config being set in the peripheral_uart application that is not set in your application.

    Best regards,

    Edvin

Related