/dev/verdin-uart1 does not exist

I’m trying to apply a device tree overlay to a Yocto build for a verdin-am62 module. Previously, I was using the torizoncore builder to build my image, using the same device tree and overlay in my tcbuild.yaml file, like this

device-tree:
    # >> Directories where to look for include files.
    include-dirs:
      - linux/include/
    # >> Custom device tree source:
    custom: linux/arch/arm64/boot/dts/ti/k3-am625-verdin-wifi-dahlia.dts
    # >> Device-tree overlays configuration:
    overlays:
      add:
        - custom/overlays/verdin-am62_best_bsample.dts

However, when I build using the same device tree and overlay in Yocto, I have a problem: /dev/verdin-uart1 does not exist. I need this for my application.

Here is my bbappend file, device-tree-overlays-ti_%.bbappend

TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT:append = " verdin-am62_best_bsample.dtbo "

FILESEXTRAPATHS:prepend := "${THISDIR}/files:"

SRC_URI:append = " file://verdin-am62_best_bsample.dts "

CUSTOM_OVERLAYS_SOURCE = "verdin-am62_best_bsample.dts"
do_collect_overlays:prepend() {
    for DTS in ${CUSTOM_OVERLAYS_SOURCE}; do
        cp ${WORKDIR}/${DTS} ${S}
    done
}

And my device tree overlay

// SPDX-License-Identifier: GPL-2.0-or-later OR MIT
/*
 * Copyright 2020-2022 Toradex
 */


/dts-v1/;
/plugin/;

/ {
	compatible = "toradex,verdin-am62";
};

/* Verdin UART_1 */
&main_uart1 {
	status = "okay";
};

/* Verdin I2C_1 */
&main_i2c1 {
	status = "okay";
};

/* Verdin I2C_2_DSI */
&main_i2c2 {
	status = "disabled";
};

/* EEPROM on display adapter boards */
/* TODO */

/* EEPROM on Verdin Development board */
/* TODO */

/* Verdin I2S_1 */
&mcasp0 {
	status = "disabled";
};

/* Verdin I2S_2 */
&mcasp1 {
	status = "disabled";
};

/* Verdin PWM_3_DSI */
&epwm1 {
	status = "disabled";
};

/* Verdin PWM_1, PWM_2 */
&epwm0 {
	status = "disabled";
};

/* Verdin QSPI_1 */
&ospi0 {
	status = "disabled";
};

/* Verdin SD_1 */
&sdhci1 {
	status = "disabled";
};

Also, in conf/machine/verdin-am62-extra.conf, I specify this

KERNEL_DEVICETREE = "ti/k3-am625-verdin-wifi-dahlia.dtb"

TEZI_EXTERNAL_KERNEL_DEVICETREE_BOOT:append = " verdin-am62_best_bsample.dtbo "

It seems that my overlay file is getting added to the fdt_overlays variable in overlays.txt,

cat ../build/tmp/work/verdin_am62-poky-linux/controlbox-image-minimal/1.0-r0/bootfs/overlays.txt
fdt_overlays=verdin-am62_dsi-to-hdmi_overlay.dtbo verdin-am62_spidev_overlay.dtbo

I can also see it applied on the u-boot console. However, /dev/verdin-uart1 still does not exist. Is there a problem with my overlay? Or is it still not getting applied correctly? What should I enable in the device tree to be able to access verdin UART?

Hi, I’m the Toradex AI Assistant. The Toradex Support team will follow up with you shortly!

Did you like my answer?

:+1: :-1:


It looks like you are trying to enable UART1 on the Verdin AM62 module, but the device node /dev/verdin-uart1 is not appearing. Here are a few steps to troubleshoot and ensure that your device tree overlay is correctly enabling UART1:

  1. Check the UART Alias:
    Ensure that the alias for UART1 is correctly defined in the base device tree. Typically, UART aliases are defined in the aliases node. For example:

    / {
        aliases {
            serial0 = &main_uart1;
        };
    };
    
  2. Verify the UART Node:
    Make sure that the main_uart1 node is correctly defined in the base device tree and that it has the correct properties. For example:

    &main_uart1 {
        compatible = "ns16550a";
        reg = <0x0 0x0>;
        interrupts = <0x0 0x0>;
        status = "okay";
    };
    
  3. Check the Overlay Application:
    Ensure that your overlay is correctly applied. You can check the boot log to see if the overlay is being applied without errors. Look for messages related to device tree overlays in the boot log.

  4. Verify the Device Node Creation:
    After booting, check the kernel log (dmesg) for any messages related to UART. This can provide clues if there are issues with the UART driver or device tree.

  5. Check the Device Tree Compilation:
    Ensure that your device tree overlay is correctly compiled into a .dtbo file. You can manually compile it using the dtc command:

    dtc -I dts -O dtb -o verdin-am62_best_bsample.dtbo verdin-am62_best_bsample.dts
    
  6. Update the overlays.txt:
    Ensure that the overlays.txt file in the boot partition includes your overlay:

    fdt_overlays=verdin-am62_best_bsample.dtbo
    
  7. Check the U-Boot Environment:
    Ensure that U-Boot is correctly loading the overlays. You can check the U-Boot environment variables related to device tree overlays:

    printenv fdt_overlays
    
  8. Verify the Device Node in /dev:
    After booting, check the /dev directory for the UART device node. It might not be named /dev/verdin-uart1. It could be named something like /dev/ttyS0 or /dev/ttyS1.

If you have verified all the above steps and the issue persists, there might be a problem with the specific device tree bindings or the UART driver. In that case, you might need to refer to the specific documentation for the Verdin AM62 module or reach out to Toradex support for further assistance.

Please, also check if these links can help you solve your problem:

Adding custom overlays to Yocto image.

Oh my god. Never mind. It was a udev problem all along. Fixed the problem by adding udev-toradex-rules to my image.

Glad you were able to resolve this!