how to give child image add fragment(overlay.conf) via VScode gui?

 I  use  the  vscode to creat a smp_svr sample project  ,and how can i easily add fragment to child image(mcuboot)?

as the picture1, the files overlay-bt.conf overlay-FOTA.conf both are serve to the main image "build_bt_1"

and the picture2 ,the pcd.conf and partition_manager_enable.conf  are serve to the child image “mcuboot”

where can i add fragment to the mcuboot  like picture1(edit build configuration -> kconfig fragments -> add fragment) 

Or can i use a special naming method (config macro or file name) in overlay.conf transfer it from the primary image to the sub image 

My expression may be vague,i just want to transfer config macro to child image  via add fragment

  • Hello, 

    Have a look at the multi-image builds documentation. This is documentation in the latest version of nRF Connect SDK v2.0.0

    Adding a child image e.g. mcuboot, you can add folder <sample>\child_image\mcuboot\prj.conf. 

    "You can enable existing child images in the nRF Connect SDK by enabling the respective modules in the parent image and selecting the desired build strategy."

    Adding these to the CMakeLists.txt of the main image might be the correct path for you, as desribed under Defining and enabling a child image.

    Let me know how that works for you. 

    Kind regards,
    Øyvind

  • thanks for your help 

    i know that can add some sentence to the <sample>\child_image\mcuboot\prj.conf , but the effect not i wonder

    i want to creat a new file  for "build configuration -> kconfig fragments -> add fragment" , which can let new colleague build a new project easily  ,the new file overlay.conf   contains the macro configuration that the parent image wants to pass to the child image

  • I think I understand what you want to achieve, however, there is no buttons in the VS code. You will need to follow the steps provided in the link I provided. 

    From the chapter Updating the build scripts

    To make it possible to enable a child image from a parent image, you must include the child image in the build script. 

    Then under Image Specific Variables it states:

    Variables in the parent image are not propagated to the child image, with the following exceptions:

    • Any variable named <IMAGE_NAME>_VARIABLEONE in a parent image is propagated to the child image named <IMAGE_NAME> as VARIABLEONE.

    • CMake build settings, such as BOARD_DIR, build type, toolchain info, partition manager info, and similar are always passed to child images.

    With these two mechanisms, you can set variables in child images from either parent images or the command line, and you can also set variables globally across all images. For example, to change the VARIABLEONE variable for the childimageone child image and the parent image, specify the CMake command as follows:

  • thank you 

    <IMAGE_NAME>_VARIABLEONE  is like   "mcuboot_CONFIG_BOOT_UPGRADE_ONLY"   , right?

    you answer "the CMake command as follows:" seems be hide

  • If you have "Created a new application from sample" and chose smp_svr. You should only need to add a folder named child_image and then a file e.g. mcuboot.conf. This file will act as fragment for the child image

    In this .conf file can add the needed KConfig configurations e.g. CONFIG_BOOT_UPGRADE_ONLY=y

    There is no need for the second folder in child_image, e.g. <sample>\child_image\mcuboot\prj.conf as described in the link in my previous comment:

        # Note: The folder `child_image/<ACI_NAME>` is only need when configurations
        #       files must be used instead of the child image default configs.
        #       The append a child image default config, place the addetional settings
        #       in `child_image/<ACI_NAME>.conf`.

    Where ACI_NAME is mcuboot in your case.

    Hopes this helps. 

    Kind regards,
    Øyvind

Related