Error trying to build Mcuboot off tree: CMake error: The source does not match the source used to generate cache.

Hi all,

I need to modify the app.overlay dts overlay in mcuboot to be able to see the printout, among other small details. I was able to change them in the "C:/ncs/v2.5.0/bootloader/mcuboot/boot/zephyr/" folder, set the "CONFIG_BOOTLOADER_MCUBOOT=y" flag in "prj.conf" and build it succesfully from the main application.

I want to build mcuboot out-of-tree, so I can modify as required without changing the source. 

I copied over "mcuboot" by:

which left a copy in "C:/Projects/Firmware/zephyr"

I updated the CMakeLists.txt file with the following:

if (CONFIG_BOOTLOADER_MCUBOOT)
   add_child_image(
     NAME mcuboot
     SOURCE_DIR "C:/Projects/Firmware/zephyr"
     )
endif()

And tried re-building the project. At some point I get the following error message:

=== child image mcuboot -  begin ===
loading initial cache file C:/Projects/Firmware/Comms_Module/build/mcuboot/child_image_preload.cmake
CMake Error: The source "C:/Projects/Firmware/zephyr/CMakeLists.txt" does not match the source "C:/ncs/v2.5.0/bootloader/mcuboot/boot/zephyr/CMakeLists.txt" used to generate cache.  Re-run cmake with a different source directory.
CMake Error at C:/ncs/v2.5.0/nrf/cmake/multi_image.cmake:449 (message):
  CMake generation for mcuboot failed, aborting.  Command: 1
Call Stack (most recent call first):
  C:/ncs/v2.5.0/nrf/cmake/multi_image.cmake:178 (add_child_image_from_source)
  CMakeLists.txt:7 (add_child_image)


-- Configuring incomplete, errors occurred!

I've deleted the "C:/Projects/Firmware/Comms_Module/build/mcuboot" directory and done a pristine build, and I still get the same error message.

I can delete the complete  "C:/Projects/Firmware/Comms_Module/build", generate a new build configuration and still I get the same error message.

Is there anything I'm missing that I didn't pick up from the documentation?

Cheers,

Alberto

Parents Reply Children
Related