zephyr: fix handling of devicetree overlays in mcuboot
The current specific setting of devicetree overlay files using `set()`
has a couple of built-in flaws.
It keeps readding the overlay file on each subsequent CMake invocation.
The build command (make/ninja), will automatically invoke CMake if there
are any changes to files used as configure time dependencies.
This can easily be seen by manually re-invoking CMake:
```
# First invocation
$ cmake -DBOARD=nrf52840dk_nrf52840 -DDTC_OVERLAY_FILE=custom.dts ..
Loading Zephyr default modules (Zephyr workspace).
-- Application: /projects/github/ncs/bootloader/mcuboot/boot/zephyr
...
-- Found devicetree overlay: custom.dts
-- Found devicetree overlay: bootloader/mcuboot/boot/zephyr/dts.overlay
# Second invocation
$ cmake -DBOARD=nrf52840dk_nrf52840 -DDTC_OVERLAY_FILE=custom.dts ..
Loading Zephyr default modules (Zephyr workspace).
-- Application: /projects/github/ncs/bootloader/mcuboot/boot/zephyr
...
-- Found devicetree overlay: custom.dts
-- Found devicetree overlay: mcuboot/boot/zephyr/dts.overlay
-- Found devicetree overlay: mcuboot/boot/zephyr/dts.overlay
```
Zephyr has built-in support for application specific overlay config
which gets automatically applied when the overlay file is named:
`app.overlay`.
Therefore rename `dts.overlay` to `app.overlay`.
Ref: https://docs.zephyrproject.org/3.2.0/build/dts/howtos.html \
#set-devicetree-overlays
This change further allows users of mcuboot to place their mcuboot
configuration out-of-tree of the sample by using the
`APPLICATION_CONFIG_DIR` setting.
Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
diff --git a/boot/zephyr/sample.yaml b/boot/zephyr/sample.yaml
index 44ea89a..54c2367 100644
--- a/boot/zephyr/sample.yaml
+++ b/boot/zephyr/sample.yaml
@@ -19,32 +19,32 @@
sample.bootloader.mcuboot.usb_cdc_acm_recovery:
tags: bootloader_mcuboot
platform_allow: nrf52840dongle_nrf52840
- extra_args: DTC_OVERLAY_FILE=./usb_cdc_acm.overlay
+ extra_args: DTC_OVERLAY_FILE="./usb_cdc_acm.overlay;app.overlay"
integration_platforms:
- nrf52840dongle_nrf52840
sample.bootloader.mcuboot.usb_cdc_acm_recovery_log:
extra_args: OVERLAY_CONFIG=./usb_cdc_acm_log_recovery.conf
- DTC_OVERLAY_FILE=./boards/nrf52840_big.overlay
+ DTC_OVERLAY_FILE="./boards/nrf52840_big.overlay;app.overlay"
platform_allow: nrf52840dk_nrf52840
integration_platforms:
- nrf52840dk_nrf52840
tags: bootloader_mcuboot
sample.bootloader.mcuboot.single_slot:
extra_args: OVERLAY_CONFIG=./single_slot.conf
- DTC_OVERLAY_FILE=./boards/nrf52840_single_slot.overlay
+ DTC_OVERLAY_FILE="./boards/nrf52840_single_slot.overlay;app.overlay"
platform_allow: nrf52840dk_nrf52840
integration_platforms:
- nrf52840dk_nrf52840
tags: bootloader_mcuboot
sample.bootloader.mcuboot.qspi_nor_slot:
- extra_args: DTC_OVERLAY_FILE=./boards/nrf52840dk_qspi_nor_secondary.overlay
+ extra_args: DTC_OVERLAY_FILE="./boards/nrf52840dk_qspi_nor_secondary.overlay;app.overlay"
OVERLAY_CONFIG="./boards/nrf52840dk_qspi_nor.conf;./boards/nrf52840dk_qspi_secondary_boot.conf"
platform_allow: nrf52840dk_nrf52840
integration_platforms:
- nrf52840dk_nrf52840
tags: bootloader_mcuboot
sample.bootloader.mcuboot.hooks_multi:
- extra_args: DTC_OVERLAY_FILE=./boards/nrf52840dk_ram_multi.overlay
+ extra_args: DTC_OVERLAY_FILE="./boards/nrf52840dk_ram_multi.overlay;app.overlay"
OVERLAY_CONFIG=./boards/nrf52840dk_hooks_sample_overlay.conf
TEST_BOOT_IMAGE_ACCESS_HOOKS=Y
platform_allow: nrf52840dk_nrf52840