yoctometa-raspberrypi

Adding new dts to Raspberry Yocto project


I have an experimental hardware connected to Raspberry's GPIO lines, and related dts file has been created. In Raspbian, the kernel module and dtbo (overlay) works well i.e. the hardware can be controlled.

Now I have tried to port this to Yocto 2.7.1 using Jumpnowtek's meta-rpi layer [x]. The kernel module porting was otherwise successful (at least, I did not get any complains during compilation), but I haven't been able to add the dts file to system such, that it would be automatically compiled to dtbo and added to /boot/overlays -directory.

[x] https://jumpnowtek.com/rpi/Raspberry-Pi-Systems-with-Yocto.html

I have created a linux-raspberrypi_4.19.bbappend recipe as follows:

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI += "file://newlayer.dts"

RPI_KERNEL_DEVICETREE_OVERLAYS_append = " overlays/newlayer.dtbo "

do_compile_prepend() {
  sed -i '/dtbo-$(CONFIG_ARCH_BCM2835) += \\/a newlayer.dtbo \\' ${S}/arch/${ARCH}/boot/dts/overlays/Makefile
  cp ${WORKDIR}/newlayer.dts ${S}/arch/${ARCH}/boot/dts/overlays/
}

When I execute the "bitbake console-image", I get following error:

| make[3]: *** No rule to make target 'arch/arm/boot/dts/overlays/newlayer.dtbo'.  Stop.
| make[2]: *** [arch/arm/Makefile:345: overlays/newlayer.dtbo] Error 2
| make[1]: *** [Makefile:146: sub-make] Error 2
| make: *** [Makefile:24: __sub-make] Error 2
| ERROR: oe_runmake failed
| WARNING: exit code 1 from a shell command.

If I don't add the "RPI_KERNEL_DEVICETREE_OVERLAYS_append" line, I don't get any error message, but the dts file won't be compiled either. It seems, that contents of the mentioned variable control, which dts files will be compiled.

Any help is welcome.


Solution

  • I had a similar problem recently with yocto kirkstone: develop new dts file and put it into the yocto kernel, make yocto compile it. Checkout my answer.