Custom board with Static partitions, MCUboot and Sysbuild

Hello!

I am using an nRF Connect SDK V2.9.0 with a nrf54l15. I want to set up a project with a custom board. I want to add DFU in the future, so there must be MCUboot bootloader and static partitions defined.

I took the zephyr/samples/sysbuild/with_mcuboot sample. Then I compiled it for the nrf54l15dk. From the build directory, I took the partitions.yml file and copied it as pm_static.yml to the root folder of my project. I enabled the partition manager in the sysbuild.conf file, compiled the project again and flashed it - everything works fine and the board prints some logs, as described in the sample readme.

Then, using the VScode extension, I have created a custom board. And I slightly adjusted it:

1) Enabled UART, so I would be able to get some logs, when I run the code on a nrf54l15dk

2) Added missing zephyr,flash-controller chosen node

3) Reduced the boot_partition size to 48K, so it matches the pm_static.yml

The code compiles for the custom board, but when I flash it and reset the board - nothing happens.
Using a debugger, I found out that the bootloader starts, but is unable to find an image. Also, for some reason, logs are disabled in the bootloader.
With a help of the nrfjprog, I have dumped the MCU's memory and inspected the dump. In the dump, I can see the image at the expected address.

So the problem is that I cannot properly set up the project for a custom board, while it works fine for a board from the SDK.
Here is a repository with my code, that exposes the issue I am facing: link

Parents Reply Children
  • Hi!
    Thank you for the answer.
    I am not sure, that this is the problem because:
    1. If I compile the project for the nrf54l15dk/nrf54l15/cpuapp board target everything works fine (pm_static.yml is left unchanged)

    2. Here in the SDK application the mcuboot_pad stops at 0x7800, while the mcuboot_primary
    starts at 0x7000. Which looks similar to my pm_static, but they just use smaller partition for the bootloader

  • Hi,

    DmytroSes said:

    1. If I compile the project for the nrf54l15dk/nrf54l15/cpuapp board target everything works fine (pm_static.yml is left unchanged)

    2. Here in the SDK application the mcuboot_pad stops at 0x7800, while the mcuboot_primary
    starts at 0x7000. Which looks similar to my pm_static, but they just use smaller partition for the bootloader

    Ah, yes. I was a bit too quick in my previous reply.  RE: Flash Partition Management with Trusted Firmware-M explains the partitioning a bit better as well.

    When you apply your changes to the pm_static that works. Have you made sure to reduce and increase any relevant gaps that occurs with the reduction of the bootloader partition?

    Could you also paste any build and/or device logs?

    Kind regards,
    Andreas

  • Thanks for the link to partitioning explanation! I was searching for this.

    Have you made sure to reduce and increase any relevant gaps that occurs with the reduction of the bootloader partition?

    The only thing I changed was the boot_partition size in the board dts file (which is, I think, is unnecessary). The pm_static.yml file has all the partitions taken from the partitions.yml, as described in one of the Nordic lessons. I have done no changes to the pm_static.yml.
    I have also run Memory report tool for both targets (my custom board and the DK) and the partitions are completely identical there.

    The device sends no logs, while in Mcuboot, the logs are not even compiled (which is strange for me, because there are logs for the DK target).

    Here are the build logs for my custom board target:

     *  Executing task: nRF Connect: Build [pristine]: zephyr_sysbuild_issue/build (active) 
    
    Building zephyr_sysbuild_issue
    west build --build-dir /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue --pristine --board my_board/nrf54l15/cpuapp --sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DBOARD_ROOT=/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/dima/ncs/toolchains/b77d8c1312/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/dima/.cache/zephyr
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: my_board, qualifiers: nrf54l15/cpuapp
    Parsing /home/dima/ncs/v2.9.0/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/_sysbuild/empty.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/sysbuild.conf'
    Configuration saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr/.config'
    Kconfig header saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/_sysbuild/autoconf.h'
    -- 
       *****************************
       * Running CMake for mcuboot *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/dima/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: /home/dima/ncs/toolchains/b77d8c1312/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/dima/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: my_board, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found Dtc: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/boards/my_company/my_board/my_board_nrf54l15_cpuapp.dts
    -- Found devicetree overlay: /home/dima/ncs/v2.9.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/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/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.
    
    
    warning: LOG_BACKEND_UART (defined at subsys/logging/backends/Kconfig.uart:4) was assigned the value
    'y' but got the value 'n'. Check these unsatisfied dependencies: UART_CONSOLE (=n),
    (!LOG_MODE_MINIMAL) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_BACKEND_UART and/or look up
    LOG_BACKEND_UART 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/dima/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/boards/my_company/my_board/my_board_nrf54l15_cpuapp_defconfig'
    Merged configuration '/home/dima/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/sysbuild/mcuboot.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/mcuboot/zephyr/.config.sysbuild'
    Configuration saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/mcuboot/zephyr/.config'
    Kconfig header saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/dima/ncs/toolchains/b77d8c1312/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/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Setting build type to 'MinSizeRel' as none was specified.
    -- Using ccache: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/ccache
    -- Configuring done
    CMake Warning at /home/dima/ncs/v2.9.0/zephyr/CMakeLists.txt:952 (message):
      No SOURCES given to Zephyr library: drivers__clock_control
    
      Excluding target from build.
    
    
    MCUBoot bootloader key file: /home/dima/ncs/v2.9.0/bootloader/mcuboot/root-rsa-2048.pem
    -- Generating done
    -- Build files have been written to: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/mcuboot
    -- 
       *******************************************
       * Running CMake for zephyr_sysbuild_issue *
       *******************************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue
    -- CMake version: 3.21.0
    -- Found Python3: /home/dima/ncs/toolchains/b77d8c1312/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/dima/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: my_board, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found Dtc: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/boards/my_company/my_board/my_board_nrf54l15_cpuapp.dts
    unit address and first address in 'reg' (0x5004c000) don't match for /soc/peripheral@50000000/vpr@4c000/mailbox@1
    -- Generated zephyr.dts: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/dts.cmake
    
    warning: UPDATEABLE_IMAGE_NUMBER (defined at
    /home/dima/ncs/v2.9.0/nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig:89, subsys/dfu/Kconfig:95) was
    assigned the value '1' but got the value ''. Check these unsatisfied dependencies:
    (((BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS) && SOC_SERIES_NRF53X &&
    NCS_SAMPLE_MCUMGR_BT_OTA_DFU) || (!MCUBOOT && IMG_MANAGER)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UPDATEABLE_IMAGE_NUMBER and/or look up
    UPDATEABLE_IMAGE_NUMBER 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.
    
    
    warning: MCUBOOT_UPDATE_FOOTER_SIZE (defined at subsys/dfu/Kconfig:54) was assigned the value
    '0x3000' but got the value ''. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n),
    IMG_MANAGER (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE and/or look up
    MCUBOOT_UPDATE_FOOTER_SIZE 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/dima/ncs/v2.9.0/zephyr/Kconfig
    Loaded configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/boards/my_company/my_board/my_board_nrf54l15_cpuapp_defconfig'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/prj.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/.config.sysbuild'
    Configuration saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/.config'
    Kconfig header saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/dima/ncs/toolchains/b77d8c1312/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/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Setting build type to 'MinSizeRel' as none was specified.
    -- Using ccache: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/ccache
    CMake Warning at /home/dima/ncs/v2.9.0/zephyr/CMakeLists.txt:952 (message):
      No SOURCES given to Zephyr library: drivers__clock_control
    
      Excluding target from build.
    
    
    -- Including signing script: /home/dima/ncs/v2.9.0/nrf/cmake/sysbuild/image_signing.cmake
    CMake Warning at /home/dima/ncs/v2.9.0/zephyr/CMakeLists.txt:2164 (message):
      
    
            The CMake build type was set to 'MinSizeRel', but the optimization flag was set to '-Og'.
            This may be intentional and the warning can be turned off by setting the CMake variable 'NO_BUILD_TYPE_WARNING'
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue
    -- Found partition manager static configuration : /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/pm_static.yml
    Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build
    -- west build: building application
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue
    -- CMake version: 3.21.0
    -- Cache files will be written to: /home/dima/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: my_board, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found BOARD.dts: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/boards/my_company/my_board/my_board_nrf54l15_cpuapp.dts
    unit address and first address in 'reg' (0x5004c000) don't match for /soc/peripheral@50000000/vpr@4c000/mailbox@1
    -- Generated zephyr.dts: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/dts.cmake
    Parsing /home/dima/ncs/v2.9.0/zephyr/Kconfig
    Loaded configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/.config'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/.config.sysbuild'
    No change to configuration in '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/.config'
    No change to Kconfig header in '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/include/generated/zephyr/autoconf.h'
    -- Using ccache: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/ccache
    CMake Warning at /home/dima/ncs/v2.9.0/zephyr/CMakeLists.txt:952 (message):
      No SOURCES given to Zephyr library: drivers__clock_control
    
      Excluding target from build.
    
    
    -- Including signing script: /home/dima/ncs/v2.9.0/nrf/cmake/sysbuild/image_signing.cmake
    CMake Warning at /home/dima/ncs/v2.9.0/zephyr/CMakeLists.txt:2164 (message):
      
    
            The CMake build type was set to 'MinSizeRel', but the optimization flag was set to '-Og'.
            This may be intentional and the warning can be turned off by setting the CMake variable 'NO_BUILD_TYPE_WARNING'
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue
    [1/129] Preparing syscall dependency handling
    
    [5/129] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr), build: v3.7.99-ncs2
    [129/129] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       15540 B       686 KB      2.21%
                 RAM:        4176 B       188 KB      2.17%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/zephyr_sysbuild_issue/zephyr/zephyr.elf for board: my_board
    image.py: sign the payload
    image.py: sign the payload
    [3/270] Preparing syscall dependency handling
    
    [7/270] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr), build: v3.7.99-ncs2
    [270/270] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       27042 B        48 KB     55.02%
                 RAM:       22192 B       188 KB     11.53%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build/mcuboot/zephyr/zephyr.elf for board: my_board
    [20/20] Generating ../merged.hex
     *  Terminal will be reused by tasks, press any key to close it. 

    And here are the build logs for the DK target:

     *  Executing task: nRF Connect: Build [pristine]: zephyr_sysbuild_issue/build_devkit (active) 
    
    Building zephyr_sysbuild_issue
    west build --build-dir /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue --pristine --board nrf54l15dk/nrf54l15/cpuapp -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DBOARD_ROOT=/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue
    
    -- west build: generating a build system
    Loading Zephyr module(s) (Zephyr base): sysbuild_default
    -- Found Python3: /home/dima/ncs/toolchains/b77d8c1312/usr/local/bin/python3.12 (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/dima/.cache/zephyr
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l15/cpuapp
    Parsing /home/dima/ncs/v2.9.0/zephyr/share/sysbuild/Kconfig
    Loaded configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/_sysbuild/empty.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/sysbuild.conf'
    Configuration saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr/.config'
    Kconfig header saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/_sysbuild/autoconf.h'
    -- 
       *****************************
       * Running CMake for mcuboot *
       *****************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/dima/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr
    -- CMake version: 3.21.0
    -- Found Python3: /home/dima/ncs/toolchains/b77d8c1312/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/dima/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found Dtc: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/dima/ncs/v2.9.0/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts
    -- Found devicetree overlay: /home/dima/ncs/v2.9.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/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/mcuboot/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/mcuboot/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/mcuboot/zephyr/dts.cmake
    
    warning: FPROTECT_ALLOW_COMBINED_REGIONS (defined at
    /home/dima/ncs/v2.9.0/nrf/lib/fprotect/Kconfig:76) was assigned the value 'y' but got the value 'n'.
    Check these unsatisfied dependencies: FPROTECT (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_FPROTECT_ALLOW_COMBINED_REGIONS and/or look
    up FPROTECT_ALLOW_COMBINED_REGIONS 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.
    
    
    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.
    
    
    warning: LOG_BACKEND_UART (defined at subsys/logging/backends/Kconfig.uart:4) was assigned the value
    'y' but got the value 'n'. Check these unsatisfied dependencies: (!LOG_MODE_MINIMAL) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_LOG_BACKEND_UART and/or look up
    LOG_BACKEND_UART 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/dima/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/Kconfig
    Loaded configuration '/home/dima/ncs/v2.9.0/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig'
    Merged configuration '/home/dima/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/prj.conf'
    Merged configuration '/home/dima/ncs/v2.9.0/bootloader/mcuboot/boot/zephyr/boards/nrf54l15dk_nrf54l15_cpuapp.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/sysbuild/mcuboot.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/mcuboot/zephyr/.config.sysbuild'
    Configuration saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/mcuboot/zephyr/.config'
    Kconfig header saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/mcuboot/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/dima/ncs/toolchains/b77d8c1312/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/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Setting build type to 'MinSizeRel' as none was specified.
    -- Using ccache: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/ccache
    MCUBoot bootloader key file: /home/dima/ncs/v2.9.0/bootloader/mcuboot/root-rsa-2048.pem
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/mcuboot
    -- 
       *******************************************
       * Running CMake for zephyr_sysbuild_issue *
       *******************************************
    
    Loading Zephyr default modules (Zephyr base).
    -- Application: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue
    -- CMake version: 3.21.0
    -- Found Python3: /home/dima/ncs/toolchains/b77d8c1312/usr/local/bin/python (found suitable version "3.12.4", minimum required is "3.8") found components: Interpreter 
    -- Cache files will be written to: /home/dima/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found Dtc: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/dtc (found suitable version "1.5.0", minimum required is "1.4.6") 
    -- Found BOARD.dts: /home/dima/ncs/v2.9.0/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts
    unit address and first address in 'reg' (0x5004c000) don't match for /soc/peripheral@50000000/vpr@4c000/mailbox@1
    -- Generated zephyr.dts: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/dts.cmake
    
    warning: UPDATEABLE_IMAGE_NUMBER (defined at
    /home/dima/ncs/v2.9.0/nrf/samples/common/mcumgr_bt_ota_dfu/Kconfig:89, subsys/dfu/Kconfig:95) was
    assigned the value '1' but got the value ''. Check these unsatisfied dependencies:
    (((BOARD_THINGY53_NRF5340_CPUAPP || BOARD_THINGY53_NRF5340_CPUAPP_NS) && SOC_SERIES_NRF53X &&
    NCS_SAMPLE_MCUMGR_BT_OTA_DFU) || (!MCUBOOT && IMG_MANAGER)) (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_UPDATEABLE_IMAGE_NUMBER and/or look up
    UPDATEABLE_IMAGE_NUMBER 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.
    
    
    warning: MCUBOOT_UPDATE_FOOTER_SIZE (defined at subsys/dfu/Kconfig:54) was assigned the value
    '0x5000' but got the value ''. Check these unsatisfied dependencies: MCUBOOT_IMG_MANAGER (=n),
    IMG_MANAGER (=n). See
    http://docs.zephyrproject.org/latest/kconfig.html#CONFIG_MCUBOOT_UPDATE_FOOTER_SIZE and/or look up
    MCUBOOT_UPDATE_FOOTER_SIZE 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/dima/ncs/v2.9.0/zephyr/Kconfig
    Loaded configuration '/home/dima/ncs/v2.9.0/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp_defconfig'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/prj.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/misc/generated/extra_kconfig_options.conf'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/.config.sysbuild'
    Configuration saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/.config'
    Kconfig header saved to '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/include/generated/zephyr/autoconf.h'
    -- Found GnuLd: /home/dima/ncs/toolchains/b77d8c1312/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/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Setting build type to 'MinSizeRel' as none was specified.
    -- Using ccache: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/ccache
    -- Including signing script: /home/dima/ncs/v2.9.0/nrf/cmake/sysbuild/image_signing.cmake
    CMake Warning at /home/dima/ncs/v2.9.0/zephyr/CMakeLists.txt:2164 (message):
      
    
            The CMake build type was set to 'MinSizeRel', but the optimization flag was set to '-Og'.
            This may be intentional and the warning can be turned off by setting the CMake variable 'NO_BUILD_TYPE_WARNING'
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue
    -- Found partition manager static configuration : /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/pm_static.yml
    Partition 'mcuboot' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_pad' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_primary' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_primary_app' is not included in the dynamic resolving since it is statically defined.
    Partition 'mcuboot_secondary' is not included in the dynamic resolving since it is statically defined.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit
    -- west build: building application
    [0/1] Re-running CMake...
    Loading Zephyr default modules (Zephyr base (cached)).
    -- Application: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue
    -- CMake version: 3.21.0
    -- Cache files will be written to: /home/dima/.cache/zephyr
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr)
    -- Found west (found suitable version "1.2.0", minimum required is "0.14.0")
    -- Board: nrf54l15dk, qualifiers: nrf54l15/cpuapp
    -- Found host-tools: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found toolchain: zephyr 0.17.0 (/home/dima/ncs/toolchains/b77d8c1312/opt/zephyr-sdk)
    -- Found BOARD.dts: /home/dima/ncs/v2.9.0/zephyr/boards/nordic/nrf54l15dk/nrf54l15dk_nrf54l15_cpuapp.dts
    unit address and first address in 'reg' (0x5004c000) don't match for /soc/peripheral@50000000/vpr@4c000/mailbox@1
    -- Generated zephyr.dts: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/zephyr.dts
    -- Generated devicetree_generated.h: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/include/generated/zephyr/devicetree_generated.h
    -- Including generated dts.cmake file: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/dts.cmake
    Parsing /home/dima/ncs/v2.9.0/zephyr/Kconfig
    Loaded configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/.config'
    Merged configuration '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/.config.sysbuild'
    No change to configuration in '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/.config'
    No change to Kconfig header in '/home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/include/generated/zephyr/autoconf.h'
    -- Using ccache: /home/dima/ncs/toolchains/b77d8c1312/usr/bin/ccache
    -- Including signing script: /home/dima/ncs/v2.9.0/nrf/cmake/sysbuild/image_signing.cmake
    CMake Warning at /home/dima/ncs/v2.9.0/zephyr/CMakeLists.txt:2164 (message):
      
    
            The CMake build type was set to 'MinSizeRel', but the optimization flag was set to '-Og'.
            This may be intentional and the warning can be turned off by setting the CMake variable 'NO_BUILD_TYPE_WARNING'
    
    
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue
    [1/144] Preparing syscall dependency handling
    
    [5/144] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr), build: v3.7.99-ncs2
    [144/144] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       27878 B       686 KB      3.97%
                 RAM:        4584 B       188 KB      2.38%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/zephyr_sysbuild_issue/zephyr/zephyr.elf for board: nrf54l15dk
    image.py: sign the payload
    image.py: sign the payload
    [5/282] Preparing syscall dependency handling
    
    [7/282] Generating include/generated/zephyr/version.h
    -- Zephyr version: 3.7.99 (/home/dima/ncs/v2.9.0/zephyr), build: v3.7.99-ncs2
    [282/282] Linking C executable zephyr/zephyr.elf
    Memory region         Used Size  Region Size  %age Used
               FLASH:       34864 B        48 KB     70.93%
                 RAM:       24624 B       188 KB     12.79%
            IDT_LIST:          0 GB        32 KB      0.00%
    Generating files from /home/dima/Projects/giot/workspace/zephyr_sysbuild_issue/build_devkit/mcuboot/zephyr/zephyr.elf for board: nrf54l15dk
    [20/20] Generating ../merged.hex
     *  Terminal will be reused by tasks, press any key to close it. 

  • I have managed to solve the problem with logs. Here is what the bootloader prints for my board:

    *** Booting MCUboot v2.1.0-dev-12e5ee106034 ***
    *** Using nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    I: Starting bootloader
    W: Failed reading sectors; BOOT_MAX_IMG_SECTORS=128 - too small?
    E: Image in the primary slot is not valid!
    E: Unable to find bootable image

    And here what it prints for the DK:

    I: Starting bootloader
    D: Non-optimal sector distribution, slot0 has 167 usable sectors (172 assigned) but slot1 has 172 assigned
    I: Primary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Secondary image: magic=unset, swap_type=0x1, copy_done=0x3, image_ok=0x3
    I: Boot source: none
    I: Image index: 0, Swap type: none
    I: Bootloader chainload address offset: 0xc000
    *** Booting nRF Connect SDK v2.9.0-7787b2649840 ***
    *** Using Zephyr OS v3.7.99-1f8f3dc29142 ***
    Partition manager is used
    Address of sample 0xc800
    Hello sysbuild with mcuboot! nrf54l15dk
    

  • So with some more investigation I have found, that the bootloader cannot properly read image headers. In both cases it reads from the 0xc000 address and in both cases I can see the image magic number through a debugger memory view at this address. However, on my custom board the image headers structure in bootloader is for some reason empty (all the values are 0), like there is something, that prevents the bootloader reading from that area of memory. And because of that the bootloader fails to find the image.

Related