Skip to content

How to include device tree overlay into Raspberry Pi CM4

I would like to include UART3 and UART5 overlay to enable them, using Yocto. They are already delivered with the whole package ( I added to my main image recipe lines:

RPI_KERNEL_DEVICETREE_OVERLAYS:append = " overlays/uart3-overlay.dtbo"
RPI_KERNEL_DEVICETREE_OVERLAYS:append = " overlays/uart5-overlay.dtbo"

I have also added .bbappend to enable them in /boot/config.txt (file /meta-mylayer/recipes-bsp/bootfiles/rpi-config_%.bbappend):

do_deploy:append() {
   echo "dtoverlay=uart3" >>"${DEPLOYDIR}/bootfiles/config.txt"
   echo "dtoverlay=uart5" >>"${DEPLOYDIR}/bootfiles/config.txt"

And I receive an error:

ERROR: _exec_cmd: install -m 0644 -D /home/jwz/work/build/tmp/deploy/images/raspberrypi4-64/uart3-overlay.dtbo /home/jwz/work/build/tmp/work/raspberrypi4_64-poky-linux/adsb-debug-image/1.0-r0/tmp-wic/boot.1/overlays/uart3-overlay.dtbo returned '1' instead of 0
| output: install: cannot stat '/home/jwz/work/build/tmp/deploy/images/raspberrypi4-64/uart3-overlay.dtbo': No such file or directory

I suppose that those overlays are not compiled, how can I include them into a compiling process?




Found the solution.

Just add those lines into the local.conf inside the build folder.

RPI_KERNEL_DEVICETREE_OVERLAYS:append = " overlays/uart3.dtbo"
RPI_KERNEL_DEVICETREE_OVERLAYS:append = " overlays/uart5.dtbo"

RPI_KERNEL_DEVICETREE_OVERLAYS_append = " overlays/uart3.dtbo"
RPI_KERNEL_DEVICETREE_OVERLAYS_append = " overlays/uart5.dtbo"
2 People found this is helpful