Re: [yocto] error while adding device tree overlay for UART to the image #bitbake #linux
[email protected] Tue, 31 Mar 2026 05:36:22 -0700
| Newsgroups | org.yoctoproject.lists.yocto |
|---|---|
| Message-ID | <[email protected]> |
Hello Crane,
I faced a similar issue when working with UART overlays on Raspberry Pi 5 using Yocto (scarthgap + meta-raspberrypi).
In my case, the problem was not the kernel build itself, but how the overlays were handled during image generation (wic stage).
What worked for me was:
1. Instead of relying only on RPI_KERNEL_DEVICETREE_OVERLAYS, I explicitly appended the overlay in my configuration:
RPI_KERNEL_DEVICETREE_OVERLAYS:append = " \
overlays/uart0-pi5.dtbo \
"
2. Additionally, I created a bbappend in my custom layer to ensure the overlay is properly referenced in config.txt:
recipes-bsp/bootfiles/rpi-config_git.bbappend
with the following content:
do_deploy:append() {
echo "dtoverlay=uart0-pi5" >> $CONFIG
}
This ensures that:
- the dtbo is deployed correctly
- and also picked up by the boot configuration
It seems that the WIC error ("Malformed boot file entry") can happen if the overlay is present in KERNEL_DEVICETREE but not properly handled or referenced during boot file generation.
After this change, the image was generated without errors and the UART overlay was applied correctly at boot.
Hope this helps.
Best regards,
Danyal