Unable to compile MCUBoot without specifying flash slot0_partition and slot1_partition using sysbuild

Hi,

I am currently migrating from NCS 2.5.0 to 2.7.0 and running into an issue where the CMakeLists of mcuboot (https://github.com/nrfconnect/sdk-mcuboot/blob/4c7942e58c5458ce3c4e50d3169e0f865910fe87/boot/zephyr/CMakeLists.txt#L381) complains when it can't find the the slot0_partition and slot1_partition labels in the device tree overlay. However, I am currently using the partition manager to generate the flash layout using pm_static.yml, which previously worked in NCS 2.5.0. Therefore, I am stuck on how to make MCUBoot work with partition manager under sysbuild. Any help or pointers would be appreciated. Thanks!

Parents
  • Hi, 

    Could you share your pm_static.yml?

    The usage of pm_static.yml is the same. The sysbuild will source pm_static.yml to build. The Audio application also uses pm_static.yml to build. 

    Regards,
    Amanda H.

  • Hi, changing the content of the pm_static.yml does not impact the build error message and I still get the same complain of missing dts label. I know partition manager is enabled for child image, but how can I tell it is enabled for mcuboot using sysbuild?

    Update: when building the audio application, it seems that sysbuild actually builds the main application first before mcuboot, whereas in my case mcuboot is always builded first. Does that mean the partition manager needs to be activated first in building the main application to generate the necessary dts file that mcuboot can utilize? If so, how can i make sure that my main app will always get build before mcuboot.

  • You can enable mcuboot by SB_CONFIG_BOOTLOADER_MCUBOOT=y for sysbuild. See Adding MCUboot as an immutable bootloader

  • I understand and MCUBoot is enabled, but I don't know why the partition manager is not enabled for MCUBoot. Here is the building output for my main application showing that it is building with partition manager AFTER adding the partition dummy label to the dts file

    slot0_partition: partition@8000 {

    label = "image-0";
    reg = <0x00008000 0x1>;
    };

    slot1_partition: partition@8001 {
    label = "image-1";
    reg = <0x00008001 0x1>;
    };

    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/....../build/....
    -- Found partition manager static configuration : /Users/......./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.
    Partition 'settings_storage' is not included in the dynamic resolving since it is statically defined.
    -- Configuring done
    -- Generating done
    -- Build files have been written to: /Users/......./build
    -- west build: building application

    The issue I am facing right now is this step happens AFTER the mcuboot CMake, so mcuboot is only reading the dts file. If I remove the dummy label, I get the following error when rebuilding.

    -- The CXX compiler identification is GNU 12.2.0
    -- The ASM compiler identification is GNU
    -- Found assembler: /opt/nordic/ncs/toolchains/f8037e9b83/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc
    -- Using ccache: /opt/nordic/ncs/toolchains/f8037e9b83/bin/ccache
    MCUBoot bootloader key file: /Users/......./bootloader/mcuboot/root-rsa-2048.pem
    ERRORUnable to get parent of node: 
    ERRORUnable to get parent of node: 
    ERRORUnable to get parent of node: 
    ERRORUnable to get parent of node: 
    CMake Error at /Users/......./zephyr/cmake/modules/extensions.cmake:3805 (message):
      dt_prop(erase_size ...) missing required argument: PATH

  • Do you build for nRF52DK board or custom board? Is it possible to reproduce with the nRF52DK board file? If so, please share the project to help reproduce the issue. Thanks.  

Reply Children
No Data
Related