different mcuboot overlay file for different builds

I tried to use `-Dmcuboot_DTC_OVERLAY_FILE` to use different mcuboot overlay for different builds but it always use all the overlay files in the folder. 

The same way works for main application but not mcuboot.

Parents
  • Hi,

    Did you add mcuboot-dragon.overlay manually to the build configuration at some point? The mcuboot.overlay file will be added automatically, but mcuboot-dragon.overlay should not be added unless you manually add it using -Dmcuboot_DTC_OVERLAY_FILE. If you do not want to include mcuboot.overlay you need to rename it to something else, similar to mcuboot-dragon.overlay.

    Best regards,
    Marte

Reply
  • Hi,

    Did you add mcuboot-dragon.overlay manually to the build configuration at some point? The mcuboot.overlay file will be added automatically, but mcuboot-dragon.overlay should not be added unless you manually add it using -Dmcuboot_DTC_OVERLAY_FILE. If you do not want to include mcuboot.overlay you need to rename it to something else, similar to mcuboot-dragon.overlay.

    Best regards,
    Marte

Children
  • I do have -Dmcuboot_DTC_OVERLAY_FILE in my config, you can see it if you fully open the screenshot. It works after I renamed mcuboot.overlay to something else.

    1. so mcuboot.overlay  is a special file for common overylay? Is there any document for how this naming works?

    2. is there similar rule for the application also? can share the document link?

  • Hi,

    Yes, there are some cases where files will be automatically added based on the filename.

    • app.overlay is always added if it exists in the application directory.
    • Board-specific files are added if the name corresponds with the build target. This goes for both devicetree and Kconfig and if the board has multiple revisions:
      • <board>.conf
      • boards/<board>.conf
      • <board>.overlay
      • boards/<board>.overlay
      • boards/<board>_<revision>.overlay
      • Example: If the file exists, it will automatically be added if you build it for nRF52833 DK.
    • For child images, overlays located in the child_image will be added according to specific patterns. If ACI_NAME is the name of the child_image, then the following files are included:
      • child_image/<ACI_NAME>.overlay
      • child_image/<ACI_NAME>/<board>.overlay
      • child_image/<ACI_NAME>/<board>_<revision>.overlay
      • child_image/<ACI_NAME>/boards/<board>.overlay
      • child_image/<ACI_NAME>/boards/<board>_<revision>.overlay
      • child_image/<ACI_NAME>.conf
      • child_image/<ACI_NAME>/<board>.conf
      • child_image/<ACI_NAME>/<board>_<buildtype>.conf

    You can read more about this in the following links:

    Best regards,
    Marte

Related