Getting FLASH_MAP dependency warning when trying to migrate build systems to sysbuild

Hello,

I am trying to migrate a project nRF Connect SDK v2.6.2 to v2.7.0 for the nrf5340dk target board, particularly to update to the new hw model v2 and sysbuild. I am particularly having issues when building with MCUBoot + sysbuild. I am essentially following the sample with_mcuboot to get a sense of the changes necessary to properly configure my project. When trying to build with sysbuild and mcuboot with 2.7.0, I get the following warning which fails the build:

warning: FLASH_MAP (defined at subsys/storage/flash_map/Kconfig:10) has direct dependencies FLASH_HAS_DRIVER_ENABLED with value n, but is currently being y-selected by the following symbols:
- MCUBOOT_DEVICE_SETTINGS (defined at /opt/nordic/ncs/v2.7.0/bootloader/mcuboot/boot/zephyr/Kconfig:726), with value y, direct dependencies y (value: y)

In order to simplify the issue and reproduce, I decided to just work off of the with_mcuboot sample project to try to learn and understand how sysbuild works. When I use the sample as is, mcuboot builds fine. But since I want to add a device tree overlay, I decided to use the folder structure for mcuboot instead. But even with no overlay file, the warning appears. So pretty much to reproduce, I simply move and rename the sysbuild/mcuboot.conf to sysbuild/mcuboot/prj.conf and that produces the warning as well. Then I can simply move back the prj.conf to under Sysbuild and renamed back to mcuboot.conf and the build works fine.

sysbuild.conf

-----

# Sysbuild configuration file.

# Enable MCUboot per default for this sample.
SB_CONFIG_BOOTLOADER_MCUBOOT=y
-----
The mcuboot conf content is left as default from the sample.
This does not produce the warning:
<home>/application
├── CMakeLists.txt
├── prj.conf
└── sysbuild
    ├── mcuboot.conf
This is essentially what I have that produces the FLASH_MAP warning.
<home>/application
├── CMakeLists.txt
├── prj.conf
└── sysbuild
    └── mcuboot
        ├── prj.conf

Ultimately, my goal is that I would like to use the mcuboot folder structure so that I can store my mcuboot overlays in the folder structure as this is a cleaner solution than relying on using CMake arguments to specify the locations of the dts overlays (mcuboot_DTS_OVERLAY_FILE) but without the build failing due to the warning. I would also like to understand why the file location and name change produces this warning even in a simple sample like with_mcuboot.

Edit: Same issue with v2.9.0

  • Hi,

    MCUboot has a base prj,conf file. Let's call this (A).

    sysbuild/mcuboot/prj.conf OVERWRITES (A). This means mcuboot configueation becomes only sysbuild/mcuboot/prj.conf.

    sysbuild/mcuboot.conf OVERLAYS (A). This means mcuboot configueation becomes (A) plus sysbuild/mcuboot.conf .

    If you want sysbuild/mcuboot/prj.conf to behave the same, you must copy the content from (A) into your project configuration.

    Regards,
    Sigurd Hellesvik

  • Hello Sigurd,

    Thank you for the reply. I think your clarification really helped me understand how the mcuboot configuration works.

    If I was to go with the approach of just using mcuboot.conf to overlay (A), what is the recommended method of adding device tree overlays into the sysbuild structure?

    My understanding is that you would add your overlays into sysbuild/mcuboot/boards and the build would automatically detect the dts overlay for multiple boards. But whenever I add a mcuboot directory, the build requires a prj.conf. Since I just want to overlay both dts and (A), what is the correct approach? OR would I be obligated to copy (A) into sysbuild/mcuboot/prj.conf and then I would be able to add the dts overlay?

    I am looking for the correct way to add mcuboot dts overlay without having to use build command arguments.

  • Alfredo Antolinez said:
    If I was to go with the approach of just using mcuboot.conf to overlay (A), what is the recommended method of adding device tree overlays into the sysbuild structure?

    If you are good with generic dts overlays for all boards, that would be mcuboot.overlay.

    Alfredo Antolinez said:
    My understanding is that you would add your overlays into sysbuild/mcuboot/boards and the build would automatically detect the dts overlay for multiple boards. But whenever I add a mcuboot directory, the build requires a prj.conf. Since I just want to overlay both dts and (A), what is the correct approach? OR would I be obligated to copy (A) into sysbuild/mcuboot/prj.conf and then I would be able to add the dts overlay?

    Yea, board specific overlays require prj.conf. In this case you must define the full prj.conf.

  • Excellent! Thank you for the clarification. Now I feel I have a better understanding of how sysbuild works.

Related