MCUboot fails to chain-load image on nRF54L15

Good morning,

currently we are on ncs SDK v2.7.0.

Because SDK v2.8.0 supports the KMU in MCUboot on the nRF54L15, I updated immediately and gave it a try.

Unfortunately, I encountered an odd behaviour when it comes to MCUboot and chain loading of the application.

The CPU resets somewhere behind ZEPHYR_BOOT_LOG_STOP() call (see bootloader/mcuboot/boot/zephyr/main.c:627).

I tried to debug this behaviour. Suprisingly, in debug mode, this does not happen.

So, I tried to go one step back and just gave the zephyr/samples/subsys/mgmt/mcumgr/smp_svr a try for the nrf54l15dk board target.

Unfortunately, this sample does not even compile without error (i.e. undefined reference to `z_impl_k_sem_take`).

Help appreciated.

Best regards,

Christian

Parents
  • Hi

    So, I tried to go one step back and just gave the zephyr/samples/subsys/mgmt/mcumgr/smp_svr a try for the nrf54l15dk board target.

    Could you state how you built the sample?

    The following build target worked for me using command line on windows: west build -b nrf54l15dk/nrf54l15/cpuapp 

    Kind regards,
    Andreas

  • (v2.8.0) christian@x:~/ncs/v2.8.0/zephyr$ west build -b [email protected]/nrf54l15/cpuapp samples/subsys/mgmt/mcumgr/smp_svr/
    -- west build: generating a build system
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/christian/ncs/v2.8.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr
    -- CMake version: 3.21.0
    -- Using NCS Toolchain 2.8.20241106.790718371940 for building. (/home/christian/ncs/toolchains/b81a7cd864/cmake)
    -- Found Python3: /home/christian/ncs/toolchains/b81a7cd864/usr/local/bin/python3 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: /home/christian/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/christian/ncs/v2.8.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15pdk, Revision: 0.2.1, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.16.8 (/home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.8 (/home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
    -- Found Dtc: /home/christian/ncs/toolchains/b81a7cd864/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/christian/ncs/v2.8.0/zephyr/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuapp.dts
    -- Found devicetree overlay: /home/christian/ncs/v2.8.0/zephyr/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay
    unit address and first address in 'reg' (0x5004c000) don't match for /soc/peripheral@50000000/vpr@4c000/mailbox@1
    -- Generated zephyr.dts: /home/christian/ncs/v2.8.0/zephyr/build/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/christian/ncs/v2.8.0/zephyr/build/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/christian/ncs/v2.8.0/zephyr/build/zephyr/dts.cmake
    Parsing /home/christian/ncs/v2.8.0/zephyr/Kconfig
    Loaded configuration '/home/christian/ncs/v2.8.0/zephyr/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuapp_defconfig'
    Merged configuration '/home/christian/ncs/v2.8.0/zephyr/samples/subsys/mgmt/mcumgr/smp_svr/prj.conf'
    Configuration saved to '/home/christian/ncs/v2.8.0/zephyr/build/zephyr/.config'
    Kconfig header saved to '/home/christian/ncs/v2.8.0/zephyr/build/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Found Python3: /home/christian/ncs/toolchains/b81a7cd864/usr/local/bin/python3 (found version "3.12.4") found components: Interpreter
    
    === child image mcuboot -  begin ===
    loading initial cache file /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/child_image_preload.cmake
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/christian/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Using NCS Toolchain 2.8.20241106.790718371940 for building. (/home/christian/ncs/toolchains/b81a7cd864/cmake)
    -- Found Python3: /home/christian/ncs/toolchains/b81a7cd864/usr/local/bin/python3 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter
    -- Cache files will be written to: /home/christian/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/christian/ncs/v2.8.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15pdk, Revision: 0.2.1, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.16.8 (/home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.16.8 (/home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk)
    -- Found Dtc: /home/christian/ncs/toolchains/b81a7cd864/usr/local/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6")
    -- Found BOARD.dts: /home/christian/ncs/v2.8.0/zephyr/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuapp.dts
    -- Found devicetree overlay: /home/christian/ncs/v2.8.0/zephyr/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuapp_0_2_1.overlay
    -- Found devicetree overlay: /home/christian/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/app.overlay
    unit address and first address in 'reg' (0x5004c000) don't match for /soc/peripheral@50000000/vpr@4c000/mailbox@1
    -- Generated zephyr.dts: /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/dts.cmake
    
    warning: NRF_RTC_TIMER_USER_CHAN_COUNT (defined at soc/nordic/nrf53/Kconfig.sync_rtc:23,
    drivers/timer/Kconfig.nrf_rtc:20) was assigned the value '0' but got the value ''. Check these
    unsatisfied dependencies: ((NRF53_SYNC_RTC && SOC_SERIES_NRF53X && SOC_FAMILY_NORDIC_NRF) ||
    (NRF_RTC_TIMER && SYS_CLOCK_EXISTS)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_NRF_RTC_TIMER_USER_CHAN_COUNT and/or look
    up NRF_RTC_TIMER_USER_CHAN_COUNT in the menuconfig/guiconfig interface. The Application Development
    Primer, Setting Configuration Values, and Kconfig - Tips and Best Practices sections of the manual
    might be helpful too.
    
    Parsing /home/christian/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/home/christian/ncs/v2.8.0/zephyr/boards/nordic/nrf54l15pdk/nrf54l15pdk_nrf54l15_cpuapp_defconfig'
    Merged configuration '/home/christian/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/home/christian/ncs/v2.8.0/bootloader/mcuboot/boot/zephyr/boards/nrf54l15pdk_nrf54l15_cpuapp.conf'
    Merged configuration '/home/christian/ncs/v2.8.0/nrf/subsys/partition_manager/partition_manager_enabled.conf'
    Merged configuration '/home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/misc/generated/extra_kconfig_options.conf'
    Configuration saved to '/home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/.config'
    Kconfig header saved to '/home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version "2.38")
    -- The C compiler identification is GNU 12.2.0
    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Setting build type to 'MinSizeRel' as none was specified.
    -- Using ccache: /home/christian/ncs/toolchains/b81a7cd864/usr/bin/ccache
    CMake Deprecation Warning at /home/christian/ncs/v2.8.0/nrf/cmake/partition_manager.cmake:32 (message):
    
    
                ---------------------------------------------------------------------
                --- WARNING: Child and parent image functionality is deprecated   ---
                --- and should be replaced with sysbuild. Child and parent image  ---
                --- support remains only to allow existing customer applications  ---
                --- to build and allow porting to sysbuild, it is no longer       ---
                --- receiving updates or new features and it will not be possible ---
                --- to build using child/parent image at all in nRF Connect SDK   ---
                --- version 2.9 onwards.                                          ---
                ---------------------------------------------------------------------
    Call Stack (most recent call first):
      /home/christian/ncs/v2.8.0/zephyr/cmake/modules/kernel.cmake:255 (include)
      /home/christian/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:142 (include)
      /home/christian/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/christian/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:12 (find_package)
    
    
    MCUBoot bootloader key file: /home/christian/ncs/v2.8.0/bootloader/mcuboot/root-rsa-2048.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/christian/ncs/v2.8.0/zephyr/build/mcuboot
    === child image mcuboot -  end ===
    
    CMake Warning at /home/christian/ncs/v2.8.0/nrf/modules/mcuboot/CMakeLists.txt:382 (message):
    
    
              ---------------------------------------------------------
              --- WARNING: Using default MCUBoot key, it should not ---
              --- be used for production.                           ---
              ---------------------------------------------------------
    
    
    
    
    -- Setting build type to 'MinSizeRel' as none was specified.
    -- Using ccache: /home/christian/ncs/toolchains/b81a7cd864/usr/bin/ccache
    CMake Deprecation Warning at /home/christian/ncs/v2.8.0/nrf/cmake/partition_manager.cmake:32 (message):
    
    
                ---------------------------------------------------------------------
                --- WARNING: Child and parent image functionality is deprecated   ---
                --- and should be replaced with sysbuild. Child and parent image  ---
                --- support remains only to allow existing customer applications  ---
                --- to build and allow porting to sysbuild, it is no longer       ---
                --- receiving updates or new features and it will not be possible ---
                --- to build using child/parent image at all in nRF Connect SDK   ---
                --- version 2.9 onwards.                                          ---
                ---------------------------------------------------------------------
    Call Stack (most recent call first):
      /home/christian/ncs/v2.8.0/zephyr/cmake/modules/kernel.cmake:255 (include)
      /home/christian/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:142 (include)
      /home/christian/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/christian/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:12 (find_package)
    
    
    CMake Warning at /home/christian/ncs/v2.8.0/nrf/cmake/partition_manager.cmake:102 (message):
    
    
              ---------------------------------------------------------------------
              --- WARNING: Using a bootloader without pm_static.yml.            ---
              --- There are cases where a deployed product can consist of       ---
              --- multiple images, and only a subset of these images can be     ---
              --- upgraded through a firmware update mechanism. In such cases,  ---
              --- the upgradable images must have partitions that are static    ---
              --- and are matching the partition map used by the bootloader     ---
              --- programmed onto the device.                                   ---
              ---------------------------------------------------------------------
    
    
    Call Stack (most recent call first):
      /home/christian/ncs/v2.8.0/zephyr/cmake/modules/kernel.cmake:255 (include)
      /home/christian/ncs/v2.8.0/zephyr/cmake/modules/zephyr_default.cmake:142 (include)
      /home/christian/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:66 (include)
      /home/christian/ncs/v2.8.0/zephyr/share/zephyr-package/cmake/ZephyrConfig.cmake:92 (include_boilerplate)
      CMakeLists.txt:12 (find_package)
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/christian/ncs/v2.8.0/zephyr/build
    -- west build: building application
    [1/211] Preparing syscall dependency handling
    
    [8/211] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (/home/christian/ncs/v2.8.0/zephyr), build: v3.7.99-ncs1
    [10/211] Performing build step for 'mcuboot_subimage'
    [1/287] Preparing syscall dependency handling
    
    [7/287] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (/home/christian/ncs/v2.8.0/zephyr), build: v3.7.99-ncs1
    [282/287] Linking C executable zephyr/zephyr_pre0.elf
    FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/zephyr_pre0.map
    : && ccache /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc -Os -DNDEBUG -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/christian/ncs/v2.8.0/zephyr/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/libarch__arm__core.a  zephyr/arch/arch/arm/core/cortex_m/libarch__arm__core__cortex_m.a  zephyr/arch/arch/arm/core/cortex_m/cmse/libarch__arm__core__cortex_m__cmse.a  zephyr/arch/arch/arm/core/mpu/libarch__arm__core__mpu.a  zephyr/lib/libc/minimal/liblib__libc__minimal.a  zephyr/lib/libc/common/liblib__libc__common.a  zephyr/soc/soc/nrf54l15/libsoc__nordic.a  zephyr/drivers/cache/libdrivers__cache.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/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/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/thumb/v8-m.main/nofp"  -L/home/christian/ncs/v2.8.0/zephyr/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 && cd /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr && /home/christian/ncs/toolchains/b81a7cd864/usr/local/bin/cmake -E true
    /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `k_sem_give':
    /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1120: undefined reference to `z_impl_k_sem_give'
    /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `k_thread_create':
    /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:85: undefined reference to `z_impl_k_thread_create'
    /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `k_thread_name_set':
    /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:436: undefined reference to `z_impl_k_thread_name_set'
    /home/christian/ncs/toolchains/b81a7cd864/opt/zephyr-sdk/arm-zephyr-eabi/bin/../lib/gcc/arm-zephyr-eabi/12.2.0/../../../../arm-zephyr-eabi/bin/ld.bfd: app/libapp.a(main.c.obj): in function `k_sem_take':
    /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/include/generated/zephyr/syscalls/kernel.h:1103: undefined reference to `z_impl_k_sem_take'
    collect2: error: ld returned 1 exit status
    ninja: build stopped: subcommand failed.
    [199/211] Linking C executable zephyr/zephyr.elf
    FAILED: modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build mcuboot/zephyr/zephyr.hex mcuboot/zephyr/zephyr.elf /home/christian/ncs/v2.8.0/zephyr/build/modules/mcuboot/mcuboot_subimage-prefix/src/mcuboot_subimage-stamp/mcuboot_subimage-build /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/zephyr.hex /home/christian/ncs/v2.8.0/zephyr/build/mcuboot/zephyr/zephyr.elf
    cd /home/christian/ncs/v2.8.0/zephyr/build/mcuboot && /home/christian/ncs/toolchains/b81a7cd864/usr/local/bin/cmake --build . --
    [201/211] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       47204 B       686 KB      6.72%
                 RAM:       14952 B       188 KB      7.77%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from /home/christian/ncs/v2.8.0/zephyr/build/zephyr/zephyr.elf for board: nrf54l15pdk
    ninja: build stopped: subcommand failed.
    FATAL ERROR: command exited with status 1: /home/christian/ncs/toolchains/b81a7cd864/usr/local/bin/cmake --build /home/christian/ncs/v2.8.0/zephyr/build
    (v2.8.0) christian@x:~/ncs/v2.8.0/zephyr$

  • PS. I'm on Ubuntu 22.04 (WSL) and built the sample for the nRF54L15PDK 

Reply Children
Related