Hi there,
We are currently building with MCUboot as a child image with NRF5340 custom board configuration. Recently I have introduced the new Zephyr's style of enabling drivers, by using DT macros in Kconfig to automatically enable the drivers with "depends on DT_HAS_MY_DRIVER_COMPATIBLE_ENABLED" and "default y" and "select BUS"
Here is our application folder structure :
boards/
child_image
child_image/mcuboot
child_image/mcuboot/boards
drivers/
dts/
CMakeLists.txt
prj.conf
prj_release.conf
zephyr/module.yml
In boards/arm/<board> folder we have <board>.dts that enables some device tree nodes (accelerometer, ...) on different buses. At this stage the bootloader will use the base device tree file that has these device node enabled, so without other action build system will automatically enable the drivers in Kconfig. This is wanted behavior as some of our own out of tree drivers are included in MCUboot by specifying in zephyr/module.yml where to look for these drivers CMakeLists.txt and Kconfig and our own bindings. We use some of our drivers for custom UI using the exposes MCUBoot hooks. With that we don't need to patch nordic's fork at all, which is pretty nice. But some of these drivers need to be disabled to save flash, as not everything will fit.
So I defined an overlay in child_image/mcuboot/boards so that I can disable some devices for MCUboot using device tree instead of .conf file. This works perfectly fine if I use the default <build_type> by building the application with prj.conf file.
The problem occurs if I build with prj_release.conf file.
In child_image/mcuboot I have this :
boards/
prj.conf
prj_release.conf
And in boards I added <board>.overlay file, and also <board>.conf and <board_release>.conf for the release build.
For the "debug" build everything gets picked up correctly, but for the release build, everything is picked up as well except the .overlay file. I can clearly see in build/mcuboot/CMakeCache.txt that the overlay file is not picked at all in this configuration.
1. According to documentation : https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/app_dev/multi_image/index.html , it would seem that this overlay file should be picked up regardless of the <build_type> used. Could this be a bug ? Now I'm forced to manually disable the drivers in child_image/mcuboot/boards/<board_release>.conf, but I would prefer not having to do that, as the device tree should be the one that says which drivers should be enabled.
2. Right now we have 2 different builds in child_image/mcuboot folder that match the prj and prj_release.conf in application folder. First I wanted to have a single build using child_image/mcuboot/prj.conf and <board>.conf Kconfig fragments, but build system triggers an error because he says that child_image/mcuboot/prj_release.conf is missing. Is that something normal ? Documentation doesn't specify that child_image/mcuboot/prj_release.conf is mandotary.
Thanks in advance for your help,
Best regards,
Jimmy