Device tree overlay won't build second time

Hi, I have a device tree overlay where I configure some GPIO pins. When I build my image the first time it works. After I did some modification to my test-gpio-overlay.dts file the build fails and I get the following error in my log file.

ERROR: test-gpio-overlay.dtbo is not installed in your boot filesystem, please make sure it’s in TEZI_EXTERNAL_KERNEL_DEVICETREE or being provided by virtual/dtb.

This is my. bbappend file:

FILESEXTRAPATHS:prepend := "${THISDIR}/${BPN}:"

SRC_URI:append = " file://test-gpio-overlay.dts"

do_collect_overlays:prepend () {
    cp ${WORKDIR}/test-gpio-overlay.dts ${S}
}

TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT:append = " test-gpio-overlay.dtbo"

When I remove the _BOOT part it will build the image a second time. I don’t understand what is happening. I followed this example. I use a Verdin AM62 with Dahlia carrier board.

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


I’d be glad to help! Could you let me know which OS and version you are using? Are you working with Torizon OS or a Yocto-based BSP?

Also, to help troubleshoot this issue properly, could you run the tdx-info command on your device and share the output? You can find more information about this command at Getting Device Information with Tdx-Info | Toradex Developer Center

The behavior you’re describing with the build working the first time but failing on subsequent builds suggests there might be a platform-specific configuration issue. Once I know your exact setup, I can provide more targeted guidance for your Verdin AM62 with Dahlia carrier board configuration.

Common platforms to consider:

  • Hardware: Verdin AM62, Dahlia Carrier Board
  • OS: Yocto 7.2.0, Torizon OS 6, BSP 7, Torizon OS 7.2.0-build.13
  • Integration: Device tree overlays, GPIO configuration

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT only tells the image generation logic that this overlay should be listed in overlays.txt and loaded at boot. However, the overlay binary also has to be installed into the boot filesystem. That is done through TEZI_EXTERNAL_KERNEL_DEVICETREE.

So you normally need both:

TEZI_EXTERNAL_KERNEL_DEVICETREE += " test-gpio-overlay.dtbo"
TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT += " test-gpio-overlay.dtbo"

Why it may work the first time but fail after modification:

Yocto may have reused previously generated/deployed artifacts from the first build. After you modified the .dts, BitBake had to rebuild or revalidate the overlay deployment path, and then detected that the .dtbo was requested for boot but was not declared as an external kernel device tree to be installed into the boot filesystem.

When you remove _BOOT, the image builds because the overlay is no longer requested in overlays.txt. But that also means it may not be automatically enabled at boot.

Please follow this example.

I have this now:

FILESEXTRAPATHS:prepend := “${THISDIR}/device-tree-overlays-ti:”

CUSTOM_OVERLAYS_SOURCE = "
test-gpio-overlay.dts
"
CUSTOM_OVERLAYS_BINARY = "
test-gpio-overlay.dtbo
"

SRC_URI += "
file://test-gpio-overlay.dts
"

TEZI_EXTERNAL_KERNEL_DEVICETREE += "
${CUSTOM_OVERLAYS_BINARY}
"

TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT += "
${CUSTOM_OVERLAYS_BINARY}
"

do_collect_overlays:prepend() {
for DTS in ${CUSTOM_OVERLAYS_SOURCE}; do
cp ${WORKDIR}/${DTS} ${S}
done
}

Now I get an error saying that a .dtbo from toradex itself is missing.

ERROR: verdin-am62_dsi-to-hdmi_overlay.dtbo is not installed in your boot filesystem, please make sure it’s in TEZI_EXTERNAL_KERNEL_DEVICETREE or being provided by virtual/dtb.

To clarify, I’m currently testing how you add and configure peripherals. That’s why I want to add to the existing Toradex overlays I want the HDMI output to work. The example bbappend file works, but I don’t get any of the exsisting overlays.

I’m adding my test-gpio-overlay.dtbo to the boot filesystem and not replacing it right?

So why is it missing the hdmi overlay?

Your custom overlay is not supposed to replace the Toradex overlays. The HDMI overlay is missing because the list of overlays installed into the boot filesystem was likely overwritten somewhere, while the list of overlays enabled at boot still references the HDMI overlay. Please append to the existing variables instead of assigning/replacing them.

The += operator can be unpredictable in complex build environments like Toradex’s BSP. The explicit :append operator is the industry best practice for this exact scenario. It guarantees your addition is preserved, and the default Toradex overlays remain intact.

FILESEXTRAPATHS:prepend := "${THISDIR}/device-tree-overlays-ti:"

CUSTOM_OVERLAYS_SOURCE = " \
    test-gpio-overlay.dts \
"
CUSTOM_OVERLAYS_BINARY = " \
    test-gpio-overlay.dtbo \
"

SRC_URI:append = " \
    file://test-gpio-overlay.dts \
"

# Add your overlay to the list of files to be deployed
TEZI_EXTERNAL_KERNEL_DEVICETREE:append = " \
    ${CUSTOM_OVERLAYS_BINARY} \
"

# Add your overlay to the list to be automatically enabled at boot
TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT:append = " \
    ${CUSTOM_OVERLAYS_BINARY} \
"

do_collect_overlays:prepend() {
    for DTS in ${CUSTOM_OVERLAYS_SOURCE}; do
        cp ${WORKDIR}/${DTS} ${S}
    done
}

Also make sure the file uses regular ASCII quotes, not typographic quotes:

"${THISDIR}/device-tree-overlays-ti:"
not
“${THISDIR}/device-tree-overlays-ti:”

To debug where the HDMI overlay is being lost, please check the final value of the variables:

bitbake -e <your-image> | grep "^TEZI_EXTERNAL_KERNEL_DEVICETREE="
bitbake -e <your-image> | grep "^TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT="

If TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT contains verdin-am62_dsi-to-hdmi_overlay.dtbo, then TEZI_EXTERNAL_KERNEL_DEVICETREE must also contain it, or the image build will fail with the error you are seeing.

The Toradex overlays are indeed missing from the TEZI_EXTERNAL_KERNEL_DEVICETREE. Why is it still missing after using the append?

For now I manually added them to the device tree.

verdin-am62_spidev_overlay.dtbo
verdin-am62_dsi-to-hdmi_overlay.dtbo