Hi, I’m the Toradex AI Assistant.
I might make mistakes or occasionally get you wrong. Our support team will step in if needed.
Based on the documentation, your approach for creating a custom device tree in Yocto is mostly correct, but there’s a more complete solution that includes proper U-Boot configuration(1).
Complete Custom Device Tree Setup
Your current setup is on the right track. Here’s the complete configuration based on Toradex documentation:
1. Machine Configuration
Your machine configuration looks correct(1):
require conf/machine/verdin-imx8mp.conf
MACHINEOVERRIDES =. "verdin-imx8mp:"
KMACHINE = "verdin-imx8mp"
KERNEL_DEVICETREE:append = " freescale/imx8mp-verdin-wifi-{my_board}.dtb"
2. Kernel Recipe (.bbappend)
Your kernel bbappend is also correct(1):
FILESEXTRAPATHS:prepend := "${THISDIR}/linux-toradex:"
CUSTOM_DEVICETREE = "imx8mp-verdin-wifi-{my_board}.dts"
SRC_URI += " file://${CUSTOM_DEVICETREE}"
do_configure:append() {
cp ${WORKDIR}/${CUSTOM_DEVICETREE} ${S}/arch/arm64/boot/dts/freescale/
}
3. U-Boot Configuration (Missing Step)
The key missing piece is proper U-Boot configuration. Instead of manually modifying u-boot-initial-env-sd, you should create a U-Boot bbappend(1):
Create recipes-bsp/u-boot/u-boot-toradex_%.bbappend:
do_configure:append() {
# Remove existing fdtfile, if there is one
sed -i '/"fdtfile=.*\\0" \\/d' ${S}/include/configs/verdin-imx8mp.h
# Add new fdtfile
sed -i 's/\("fdt_board=.*\\0" \\\)/\0\n "fdtfile=imx8mp-verdin-wifi-{my_board}.dtb\\0" \\/' ${S}/include/configs/verdin-imx8mp.h
}
4. Machine Extra Configuration
You should also include your machine configuration in your layer’s configuration. Add this line to the end of your conf/layer.conf file(1):
include conf/machine/verdin-imx8mp-{my_board}.conf
Why This Approach Works
This method ensures that(1):
- Your custom device tree is compiled and included in the image
- U-Boot is configured to load your custom device tree automatically
- The system boots with your custom device tree without manual intervention
The documentation shows this exact pattern for customizing device trees in Yocto builds, making it the recommended approach for production systems.
Best regards, Toradex AI Assistant.
Did you like my answer?

If I answered your question, please tick the “Solution” checkbox.
For follow-up questions to me, please use @ToradexAI in your post.