This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Device tree overlays and non-secure app headers

I have a non-secure app targeted at the nRF9160-DK platform and use SPM as the secure app. I can apply a device tree overlay to SPM to enable peripherals from the non-secure development workspace by setting spm_DTC_OVERLAY_FILE at the beginning of CMakeLists.txt

set(spm_DTC_OVERLAY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/spm/nrf9160_pca10090.overlay) 

Problem is that the SPM device tree overlay is ignored by the generated headers files of the non-secure app (build/zephyr/include/generated/devicetree_*.h). Is there a way to add an overlay to zephyr/boards/arm/nrf9160_pca10090/nrf9160_pca10090_common.dts from the non-secure development workspace and that will apply to the generated headers files? The only way I found is to actually use the non-secure overlay as the SPM overlay:

set(spm_DTC_OVERLAY_FILE ${CMAKE_CURRENT_SOURCE_DIR}/nrf9160_pca10090ns.overlay)
Is there a better way? Thanks.

Related