Direct XIP partition manager

Nordic nrf5340, ncs v2.1.0

We have an application that needs a backup image.  We were under the impression that mcuboot would handle the case that an image was corrupted and revert to a known good image, but that appears to not be the case.  From from I've read on this forum, this is possible using the Direct XIP method with REVERT enabled.

For reference, this is the partition map of the application before adding XIP

I'm disappointed by the lack of documentation on this topic, but from reading for forum posts it looks like this is how you enable XIP with revert

#prj.conf
CONFIG_BOOT_BUILD_DIRECT_XIP_VARIANT=y


#child_image/mcuboot.conf
CONFIG_BOOT_DIRECT_XIP=y
CONFIG_BOOT_DIRECT_XIP_REVERT=y

When I add these config options, the partition manager freaks out about the mcuboot_secondary partition.  In the original memory map, mcuboot_secondary starts at address 0x84000, and it appears that this is the same with XIP, but partition manager wants it to start at 0x84001?  

Partition manager failed: Error when inspecting mcuboot_secondary_pad, invalid address 0x84000, expected 0x84001,
Failed to partition region flash_primary, size of region: 1048576
Partition Configuration:
mcuboot:
  placement:
    before:
    - mcuboot_primary
  size: 49152
mcuboot_pad:
  placement:
    align:
      start: 16384
    before:
    - mcuboot_primary_app
  size: 512
mcuboot_secondary_app:
  placement:
    after:
    - mcuboot_secondary_pad
  size: 491009
mcuboot_secondary_pad:
  placement:
    after:
    - mcuboot_primary
    align:
      start: 16384
  size: 512
settings_storage:
  placement:
    before:
    - end
  size: 8192

A few questions..

1.  Is this the correct way to configure XIP?

2.  If so... how do I fix this partition error?

Related