Yocto Project Discussions
 help / color / mirror / Atom feed
* error while adding device tree overlay for UART to the image #bitbake #linux
@ 2024-10-23 14:39 Crane
  2024-10-26  1:37 ` [yocto] " Crane
  2026-03-31 12:36 ` seyd.dany
  0 siblings, 2 replies; 4+ messages in thread
From: Crane @ 2024-10-23 14:39 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 1111 bytes --]

Hello,

This question comes from building Raspberry Pi 5 image in Yocto.

I am trying to add uart device tree overlays to the image.
What's done is to add the overlays in the machine configuration:

> 
> RPI_KERNEL_DEVICETREE_OVERLAYS += " \
> overlays/uart0-pi5.dtbo \
> overlays/uart1-pi5.dtbo \
> overlays/uart2-pi5.dtbo \
> overlays/uart3-pi5.dtbo \
> overlays/uart4-pi5.dtbo \
> "
> 

They are also automatically added to KERNEL_DEVICETREE and it works fine to generate the dt overlay binary in building a Linux kernel.

Then when building the image, there is an error as below:

> 
> | DEBUG: Executing shell function do_image_wic
> | INFO: Creating image(s)...
> |
> | WARNING: bootloader config not specified, using defaults
> |
> | ERROR: Malformed boot file entry: uart0-pi5.dtbo;
> |
> | WARNING: exit code 1 from a shell command.
> 

I am using a custom layer based on Poky scarthgap and meta-raspberrypi scarthgap.
What might be missed in the recipes? It looks like there is some check when packing the wic image. Any inputs will be appreciated.

Thanks!
Crane

[-- Attachment #2: Type: text/html, Size: 1886 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [yocto] error while adding device tree overlay for UART to the image #bitbake #linux
  2024-10-23 14:39 error while adding device tree overlay for UART to the image #bitbake #linux Crane
@ 2024-10-26  1:37 ` Crane
  2024-10-26  2:00   ` Crane
  2026-03-31 12:36 ` seyd.dany
  1 sibling, 1 reply; 4+ messages in thread
From: Crane @ 2024-10-26  1:37 UTC (permalink / raw)
  To: Crane, yocto

[-- Attachment #1: Type: text/plain, Size: 317 bytes --]

I found this link talking about the same error.
https://lists.yoctoproject.org/g/yocto/topic/meta_raspberrypi_error_with/78879953

Indeed, the contents of IMAGE_BOOT_FILES has issues.
But when overlays/uart0-pi5.dtbo is added, both uart0-pi5.dtbo and overlays/uart0-pi5.dtbo are added. This should be the cause.

[-- Attachment #2: Type: text/html, Size: 511 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [yocto] error while adding device tree overlay for UART to the image #bitbake #linux
  2024-10-26  1:37 ` [yocto] " Crane
@ 2024-10-26  2:00   ` Crane
  0 siblings, 0 replies; 4+ messages in thread
From: Crane @ 2024-10-26  2:00 UTC (permalink / raw)
  To: Crane, yocto

[-- Attachment #1: Type: text/plain, Size: 130 bytes --]

Just follow the solution in the link, change two tabs to 8 spaces in front of "overlays/uart?-pi5.dtbo", then it works fine now.

[-- Attachment #2: Type: text/html, Size: 141 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [yocto] error while adding device tree overlay for UART to the image #bitbake #linux
  2024-10-23 14:39 error while adding device tree overlay for UART to the image #bitbake #linux Crane
  2024-10-26  1:37 ` [yocto] " Crane
@ 2026-03-31 12:36 ` seyd.dany
  1 sibling, 0 replies; 4+ messages in thread
From: seyd.dany @ 2026-03-31 12:36 UTC (permalink / raw)
  To: Crane, yocto

[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 2493 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-31 12:36 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-23 14:39 error while adding device tree overlay for UART to the image #bitbake #linux Crane
2024-10-26  1:37 ` [yocto] " Crane
2024-10-26  2:00   ` Crane
2026-03-31 12:36 ` seyd.dany

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox