Exposing Verdin AM625 UART 4 to Linux

Hi everyone,

I’m working with the Verdin AM625 module on the Dahlia carrier board and trying to enable UART4 for a custom application. I’m using the default device tree “k3-am625-verdin-wifi-dahlia.dts”
for the Dahlia board, but can’t seem to get this UART interface properly exposed to Linux as a general purpose serial UART.

It is by default a Linux debug console, but I have not set it to be acting as a console anywhere in our image configuration. In the Toradex documentation, this port is reserved for the M4 MCU, so how can i enable it as a normal UART.

Below are the snippets of my current device tree configuration for UART4:

  1. Pinmux Configuration:
	/* Verdin UART_4 - Reserved to Cortex-M4 */
	pinctrl_mcu_uart0: mcu-uart0-default-pins {
		pinctrl-single,pins = <
			AM62X_MCU_IOPAD(0x0014, PIN_INPUT_PULLUP, 0) /* (B5) MCU_UART0_RXD */ /* SODIMM 151 */
			AM62X_MCU_IOPAD(0x0018, PIN_OUTPUT,       0) /* (A5) MCU_UART0_TXD */ /* SODIMM 153 */
		>;
	};
  1. UART Node Configuration:
&mcu_uart0 {
 status = "okay";
};
  1. Relevant Alias (if needed):

/ {
 aliases {
  can0 = &main_mcan0;
  can1 = &mcu_mcan0;
  ethernet0 = &cpsw_port1;
  ethernet1 = &cpsw_port2;
  i2c0 = &main_i2c0;
  i2c1 = &main_i2c1;
  i2c2 = &main_i2c2;
  i2c3 = &mcu_i2c0;
  i2c4 = &main_i2c3;
  mmc0 = &sdhci0;
  mmc1 = &sdhci1;
  mmc2 = &sdhci2;
  rtc0 = &rtc_i2c;
  rtc1 = &wkup_rtc0;
  serial0 = &main_uart1;
  serial1 = &wkup_uart0;
  serial2 = &main_uart0;
  serial3 = &mcu_uart0;
  serial4 = &main_uart5;
  usb0 = &usb0;
  usb1 = &usb1;
 };
};

After applying these changes, I’ve recompiled and deployed the device tree, I can see UART4 as /dev/ttyS3 but when i connect to it i access the Linux console terminal.

What must i do to disable this UART as a debug console and enable it as a standard UART serial port. I believe this behavior has to do with the onboard M4 MCU, but I found no documentation on how to disable Linux/MCU from using UART4 as a debug serial. There as some instructions on how to do it for other "non TI based modules such as the Verdin iMX8, but nothing for the Verdin AM625.

Are there any additional changes I need to make to expose UART4 properly?
Do I need to modify the u-boot configuration or make any adjustments in the kernel?

I’d appreciate any guidance or suggestions from the community. If you need further details about my setup or configurations, feel free to ask.

Thanks in advance for your help!

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

Did you like my answer?

:+1: :-1:


Hello,

To configure UART4 on your Verdin AM625 module for general-purpose use instead of as a Linux debug console, you’ll need to make some adjustments in both the U-Boot environment and the Linux kernel command line. Here’s a step-by-step guide to help you achieve this:

  1. Disable U-Boot Console Output on UART4:

    • Interrupt the boot process to access the U-Boot prompt.
    • Use the setenv command to modify the console environment variable. If UART4 is currently set as the console, it might appear as console=ttyS3,115200. You should remove or change this setting.
    • Save your changes with saveenv and reboot the system.
  2. Disable Linux Kernel Console Output on UART4:

    • Modify the kernel command line to ensure it does not reference UART4 as a console. This can be done by editing the boot parameters in U-Boot or using fw_setenv in Linux to adjust the console parameter.
    • Ensure that the console parameter does not include ttyS3 or the equivalent for UART4.
  3. Device Tree Configuration:

    • Verify that your device tree is correctly configured to enable UART4 as a general-purpose UART. Your current configuration seems to enable it, but ensure no other settings are overriding this.
    • Double-check that the pinmux settings are correct and that no other device is using the same pins.
  4. Disable Serial Getty:

    • If a serial getty is running on UART4, it will need to be disabled. You can do this by masking the service using systemctl mask serial-getty@ttyS3.service.

By following these steps, you should be able to configure UART4 for general-purpose use. If you encounter any issues, it might be helpful to review each configuration step to ensure there are no conflicting settings.

I hope this helps! If you have any more questions or need further assistance, feel free to ask.

Best regards,
Toradex AI Assistant

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

https://www.kernel.org/pub/linux//kernel/v6.x/ChangeLog-6.5.3

Verdin UART1 issue on yocto build.

Hello @ABTrac,

By default, UART3 is the linux console, not UART4.
Also by default UART4 is usable as a normal UART, as the device tree overlay for the Cortex-M4 core is not enabled by default.

Which version of the BSP are you using?
The output of tdx-info should contain all the needed information.

Also, how are you accessing UART4 from the module?

Best Regards,
Bruno

Hi Bruno

Thank you for the reply. The problem was resolved by disabling the Serial Getty for ttyS3

Than you for your continues support.

Hello @ABTrac,

That is good to know, thanks for the update.

Best Regards,
Bruno