MCUboot DIRECT_XIP

Hi,

I was able to get the DFU system working by CONFIG_BOOTLOADER_MCUBOOT=y.
I notice that the default mcuboot update methode is using the scratch partition. According to the documentation of MCUboot, an alternative is  direct-xip mode.
The problem of flashing the image into the right (not used) slot is been taken care of.
How do I select the  direct-xip mode? I tried setting 

CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT in the prj.conf file of my sample application, but with CONFIG_BOOTLOADER_MCUBOOT=y and CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y, the application will not build.
Do I need to re-build the bootloader itself with some setting to use direct-xip mode?

Parents
  • Hi,

    To add configuration overlays to the mcuboot child image, add them to <APP>/child_image/mcuboot.conf.

    See Multi-image builds, specifically this:

    The MCUBoot configurations are not listed in our Kconfig search, but you can find them at ncs/bootloader/mcuboot/zephyr/Kconfig.

    Does this answer your question?

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    I am afraid the answer did not solve my issue yet.

    There is a folder child_image in my blinky_slot1_dfu  project.

    I added mcuboot.conf as you suggested and added CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y in that file.
    This results in errors during the build process.
    warning: BOOT_BUILD_DIRECT_XIP_VARIANT (defined at
    ...\v2.0.0\nrf\modules\mcuboot\Kconfig:26) was assigned the value 'y' but got the
    value 'n'. Check these unsatisfied dependencies: BOOTLOADER_MCUBOOT (=n). See..(dead link..)
    (The same warning is shown when setting this in the ./blinky_slot1_dfu /mcuboot/prj.conf file)

    Then replaced the CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y with the BOOT_DIRECT_XIP=y defined in the link you provided. But that was not recognized (warning: ignoring malformed line 'BOOT_DIRECT_XIP=y').

    Any tips how to build the application for use with dirext_xip mode?

  • Hi

    BvdP4Celsius said:
    I added mcuboot.conf as you suggested and added CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y in that file.

    CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT is to tell your buildto include extra files in the build/zephyr folder. See Using MCUboot in nRF Connect SDK:
    "

    When you use MCUboot in the execute-in-place (XIP) mode, enable CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT to let the build system generate an additional set of files for the second application slot. These .hex files are identical to the ones listed above, but their names also use the mcuboot_secondary_ prefix. For example, mcuboot_secondary_app_signed.hex is created and placed in the second slot on the target device when the app_signed.hex file is placed in the first slot.
    "

    BvdP4Celsius said:
    warning: ignoring malformed line 'BOOT_DIRECT_XIP=y'

    Kconfig defines are configured in prj.conf files by adding CONFIG_ to them.

    To make this work:

    prj.conf: CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y

    child_image/mcuboot.conf: CONFIG_BOOT_DIRECT_XIP=y

    Regards,
    Sigurd Hellesvik

  • Thanks Sigurd, this seems to do the trick!

    b.t.w., I ignored the error:

    CMake Warning (dev) at ....\build_1\image_preload.cmake:8 (set):
    Syntax error in cmake code at
    ....\build_1\image_preload.cmake:8
    when parsing string
    ...\toolchains\v2.0.0\opt\bin\python.exe
    Invalid escape sequence \U
    Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
    "cmake --help-policy CMP0010" for policy details. Use the cmake_policy
    command to set the policy and suppress this warning.
    This warning is for project developers. Use -Wno-dev to suppress it.

Reply
  • Thanks Sigurd, this seems to do the trick!

    b.t.w., I ignored the error:

    CMake Warning (dev) at ....\build_1\image_preload.cmake:8 (set):
    Syntax error in cmake code at
    ....\build_1\image_preload.cmake:8
    when parsing string
    ...\toolchains\v2.0.0\opt\bin\python.exe
    Invalid escape sequence \U
    Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
    "cmake --help-policy CMP0010" for policy details. Use the cmake_policy
    command to set the policy and suppress this warning.
    This warning is for project developers. Use -Wno-dev to suppress it.

Children
No Data
Related