Adding Custom DeviceTree Overlay

Hello community,

I am using the Colibri iMX6 and trying to configure the GPIO pins by using device-tree-overlay.

I am using the BSP 5.7.

I have created a device-tree-overlays_%.bbappend and attached my custom devicetree files under the */file directory as .dts extension.

I am adding this dts to the bbappend and building with bitbake device-tree-overlays

// Example file that disables usbotg


&weim {
	status = "disabled";

It is evaluating as dtbo but

I am attaching this,


#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pwm/pwm.h>
#include "imx6dl.dtsi"
#include "imx6qdl-colibri.dtsi"
#include <imx6dl-pinfunc.h>

/ {
    compatible = "toradex,colibri_imx6dl", "fsl,imx6dl";
	fragment@0 {

        target-path = "/gpio-keys";
        __overlay__ {
			compatible = "gpio-keys";
			pinctrl-names = "default";
			pinctrl-0 = <&pinctrl_gpio_keys>;

			left-key {
				label = "GPIO Left Key";
				gpios = <&gpio3 70 0>;
				linux,code = <KEY_KP4>;

when i build it with bitbake device-tree-overlays it is not evaluating as dtbo.

What is the reason that I could not see. Could you please help…

Best Regards.

build/tmp/work/colibri_imx6-tdx-linux-gnueabi/device-tree-overlays/toradex_5.4-2.3.x-imx+gitAUTOINC+d5905ae8af-r0/temp$ rgrep "gpio"
log.do_fetch.677:DEBUG: Searching for colibri-imx6_gpio-keys_overlay.dts in paths:
log.do_unpack.1459976:DEBUG: Searching for colibri-imx6_gpio-keys_overlay.dts in paths:
log.do_unpack.1459976:NOTE: Unpacking /layers/meta-layer/recipes-kernel/linux/overlays/colibri-imx6_gpio-keys_overlay.dts to /yocto/build/tmp/work/colibri_imx6-tdx-linux-gnueabi/device-tree-overlays/toradex_5.4-2.3.x-imx+gitAUTOINC+d5905ae8af-r0/git/overlays/
log.do_fetch.1459960:DEBUG: Searching for colibri-imx6_gpio-keys_overlay.dts in paths:
log.do_unpack.682:DEBUG: Searching for colibri-imx6_gpio-keys_overlay.dts in paths:
log.do_unpack.682:NOTE: Unpacking /layers/meta-layer/recipes-kernel/linux/overlays/colibri-imx6_gpio-keys_overlay.dts to /yocto/build/tmp/work/colibri_imx6-tdx-linux-gnueabi/device-tree-overlays/toradex_5.4-2.3.x-imx+gitAUTOINC+d5905ae8af-r0/git/overlays/
log.do_patch.1460007:DEBUG: Searching for colibri-imx6_gpio-keys_overlay.dts in paths:
log.do_cleanall.1459552:DEBUG: Searching for colibri-imx6_gpio-keys_overlay.dts in paths:
log.do_patch.713:DEBUG: Searching for colibri-imx6_gpio-keys_overlay.dts in paths:

Also it is the log output.

And also my custom devicetree file is appended at the git dir at the build tmp

build/tmp/work/colibri_imx6-tdx-linux-gnueabi/device-tree-overlays/toradex_5.4-2.3.x-imx+gitAUTOINC+d5905ae8af-r0/git/overlays$ ls | grep gpio

Hello @erdemkahraman,

Welcome to the Toradex Community! Also, sorry for the delay in answering!

Could you please specify if you are using an image based on Downstream or Upstream Kernel? If you could send me the output of command tdx-info from the module, it should give me all the necessary informaiton regarding your setup (detailed information here). On BSP 5.7, you should be able to get it as follows:

wget --output-document=tdx-info && sh ./tdx-info --all
1 Like

Hello @erdemkahraman,

I could build the dts files that you provided successfully for colibri-imx6 machine for BSP 5.7.2.

Here is the structure of my custom layer:

rudhi@nb:~/Yocto/ref_image_bsp5/oe-core/layers/meta-customer$ tree
β”œβ”€β”€ conf
β”‚   └── layer.conf
β”œβ”€β”€ COPYING.MIT
β”œβ”€β”€ README      
└── recipes-kernel
    └── linux
        β”œβ”€β”€ device-tree-overlays
        β”‚   └── colibri-imx6_gpio-keys_overlay.dts
        β”œβ”€β”€ device-tree-overlays_%.bbappend

Here is the device-tree-overlays_%.bbappend file:


SRC_URI += "\
    file://colibri-imx6_gpio-keys_overlay.dts \

    colibri-imx6_gpio-keys_overlay.dtbo \

    colibri-imx6_gpio-keys_overlay.dtbo \

do_collect_overlays:prepend() {
    cp ${WORKDIR}/colibri-imx6_gpio-keys_overlay.dts ${S}

After this, execute the bitbake command to build compile the overlays:
MACHINE=colibri-imx6 bitbake device-tree-overlays

I could find the output dtbo file here: build/deploy/images/colibri-imx6/overlays/colibri-imx6_gpio-keys_overlay.dtbo

Hello rudhi those are solved me thank you a lot