Hi,
I've successfully integrated an out of tree driver using the out_of_tree_driver example in the application_development sample folder for Zephyr; it has built and ran fine up to this point.
Recently, I added DFU functionality and along the way added CONFIG_BOOTLOADER_MCUBOOT=y to my prj.conf file. Now that this is added, I get an error when trying to build the project:
MCUBoot bootloader key file: C:/Repos/ml-firmware/nRF_NCS/sdk/v1.5.0/bootloader/mcuboot/root-ec-p256.pem -- Configuring done CMake Error at C:/Repos/ml-firmware/nRF_NCS/sdk/v1.5.0/zephyr/cmake/extensions.cmake:416 (add_library): No SOURCES given to target: _out_of_tree_driver Call Stack (most recent call first): C:/Repos/ml-firmware/nRF_NCS/drivers/out_of_tree_driver/zephyr/CMakeLists.txt:28 (zephyr_library_named) CMake Generate step failed. Build files cannot be regenerated correctly. CMake Error at C:/Repos/ml-firmware/nRF_NCS/sdk/v1.5.0/nrf/cmake/multi_image.cmake:287 (message): CMake generation for mcuboot failed, aborting. Command: 1 Call Stack (most recent call first): C:/Repos/ml-firmware/nRF_NCS/sdk/v1.5.0/nrf/cmake/multi_image.cmake:84 (add_child_image_from_source) C:/Repos/ml-firmware/nRF_NCS/sdk/v1.5.0/nrf/modules/mcuboot/CMakeLists.txt:112 (add_child_image)
As you can see, it says "No SOURCES given to target" but I do include them with the zephyr_library_sources_ifdef line in my CMakeLists.txt for the driver (and the relevant CONFIG_DRIVER is set to 'y' in my prj.conf). I'm assuming the problem has to do with the mcuboot child image being created and not inheriting everything it should from the app parent image, but I'm not sure how to solve it.
This is the code that adds my out of tree driver to my project, located in my project folder CMakeLists.txt:
list(APPEND ZEPHYR_EXTRA_MODULES ${CMAKE_CURRENT_SOURCE_DIR}/../drivers/out_of_tree_driver )
And here is an excerpt of the CMakeLists.txt in that driver folder:
zephyr_include_directories(.) zephyr_library_named("_out_of_tree_driver") zephyr_library_sources_ifdef(CONFIG_DRIVER out_of_tree_driver.c)
I've taken a look at section 2.2.2 titled "Modify device tree and configurations of a child image" per the NCS tutorial here, but it's not exactly what I'm looking to do. For reference I'm using NCS v1.5.0.
Thanks in advance for any help!