Set new Flash start address for both secure and nonsecure parts

We have a custom bootloader and need to set a different start address in Flash for the entire image (merged.hex)

For an earlier version of nRF Connect SDK (v1.4) this was solved by setting the address of  flash0 in devicetree.
For newer versions of nRF Connect SDK (v2.1.2), this only moved the application/zephyr part of merged.hex image, but not the rest.
The part of the image contained in tfm_secure.hex does not move.

I have tried changing the address of flash0 and all contained partitions.
Also I have tried setting CONFIG_FLASH_BASE_ADDRESS AND CONFIG_ROM_START_OFFSET.
The result is only moving the application/zephyr part contained in zephyr.hex / tfm_nonsecure.hex

I use the "Programmer" tool in nRFDesktop application to visually inspect the placement of hex files.

The following two images shows merged.hex with start-address 0x00 and 0x80000, only the application part has moved.

    

How do I set a different Flash start address that also moves the content of tfm_secure.hex?

Thanks.

- Jon

Related