Dear All,
At the moment we have created a custom board device tree, based on the nRF9160 SOC.
At the moment we are using the v2.1.0 of the nRF SDK and everything works fine. We need to upgrade to v2.4.1 that includes the nRF7002 chip.
During this transition we have encountered the following issue:
In the custom_board_nrf9160_common.dts we had the following node for the external flash:
&spi3 { compatible = "nordic,nrf-spim"; status = "okay"; cs-gpios = <&gpio0 21 GPIO_ACTIVE_LOW>, <&gpio0 31 GPIO_ACTIVE_LOW>; pinctrl-0 = <&spi3_default>; pinctrl-1 = <&spi3_sleep>; pinctrl-names = "default", "sleep"; w25q16jv: w25q16jv@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <1000000>; reset-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; size = <0x1000000>; has-dpd; t-enter-dpd = <4000>; t-exit-dpd = <25000>; jedec-id = [ ef 40 15 ]; }; ... };
When transitioning to the new version of the SDK, this node this issue:
[275/285] Linking C executable zephyr\zephyr_pre0.elf FAILED: zephyr/zephyr_pre0.elf zephyr/zephyr_pre0.map .../build/mcuboot/zephyr/zephyr_pre0.map ... undefined reference to '__device_dts_ord_110'
Looking into the generated file build/zephyr/mcuboot/include/devicetree_generated.h I see this:

Based on this I decided to remove the external flash node from the custom_board_nrf9160_common.dts and add it to an overlay file for the non-secure part of my application
custom_board_nrf9160ns.overlay:
&spi3 { w25q16jv: w25q16jv@0 { compatible = "jedec,spi-nor"; reg = <0>; spi-max-frequency = <1000000>; reset-gpios = <&gpio0 25 GPIO_ACTIVE_LOW>; size = <0x1000000>; has-dpd; t-enter-dpd = <4000>; t-exit-dpd = <25000>; jedec-id = [ ef 40 15 ]; }; };
After doing this, the code built fine.
So the question is why does the external flash is causing an issue to the device tree when it is added in the common dts, but works when it is put on the overlay file?