Hi again,
The previous issue is closed - but I never got any suggestions or answers to my problem.
I still have this problem - if I do a prestine build the mcuboot doesn't work - if I just touch the makefile and build again - then it works.
Below is my last entry in the original issue (https://devzone.nordicsemi.com/f/nordic-q-a/84564/unable-to-find-bootable-image---mcuboot).
Best regards,
Thomas
-------------------
I'm trying to see what differs between the two builds, and one thing I noticed is in the build/ncs/CMakeCache.txt file.
When it fails, it more or less only differs in the following line:
mcuboot_OVERLAY_CONFIG:INTERNAL=
/xx/vsln-ncs/vt2-overlays/vt2-mcuboot-overlay.conf
/xx/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf
When it works it looks like this:
mcuboot_OVERLAY_CONFIG:INTERNAL=
/xx/vsln-ncs/vt2-overlays/vt2-mcuboot-overlay.conf
/xx/ncs/nrf/subsys/partition_manager/partition_manager_enabled.conf
; /xx/vsln-ncs/vt2-overlays/vt2-mcuboot-overlay.conf
/xx/ncs/nrf/subsys/partition_manager/ext_flash_mcuboot_secondary.conf
And the .config only differs for mcuboot as I showed in a previous entry:
$ diff build/ncs/mcuboot/zephyr/.config fail_build/ncs/mcuboot/zephyr/.config 265,266c265,266 < CONFIG_PARTITION_MANAGER_ENABLED=y < CONFIG_FLASH_MAP_CUSTOM=y --- > # CONFIG_PARTITION_MANAGER_ENABLED is not set > # CONFIG_FLASH_MAP_CUSTOM is not set
So, it seems as if the config somehow is not correctly setup during a prestine build. The vt2-mcuboot-overlay.conf is included twice, and the ext_flash_mcuboot_secondary is only included in the working build.
The ext_flash_mcuboot_secondary.conf is included in the CMakeFile.txt for the mcuboot, in the file ncs/nrf/modules/mcuboot/CMakeLists.txt:
if (CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY) # By passing this value we don't require the user to pass any overlay files # to the MCUboot child image for storing the secondary partition in # external flash. add_overlay_config( mcuboot ${ZEPHYR_NRF_MODULE_DIR}/subsys/partition_manager/ext_flash_mcuboot_secondary.conf) endif()And CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY seems to be configured in the subsys/partition_manager/ext_flash_mcuboot_secondary.conf file, which seems odd since then we have a circular reference ... (the config is set in the file included if the config is set ...) ?
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
I can't see that this config is set anywhere else ...
Could that be that the MCUBOOT_SECONDARY somehow is not included in the first build, but in the second build the buildsystem gets that the MCUBOOT_SECONDARY should be included ... at least that how I interpret the CMakeCache.txt contents ... that could explain why the bootloader doesn't find the image in the first build.
Best regards,
Thomas