Failed to do RS-232 with uartd: serial@3130000

boot_dmesg.log (190.2 KB)
tegra234-air030.dts (486.6 KB)

How to configure the serial@3130000 to have RS-232 feature?
The pimux tegra234-mb1-bct-pinmux-p3701-0000.dtsi

  	uart4_tx_ph3 {
  		nvidia,pins = "uart4_tx_ph3";
  		nvidia,function = "uartd";
  		nvidia,pull = <TEGRA_PIN_PULL_NONE>;
  		nvidia,tristate = <TEGRA_PIN_DISABLE>;
  		nvidia,enable-input = <TEGRA_PIN_DISABLE>;
  		nvidia,lpdr = <TEGRA_PIN_DISABLE>;
  	};

  	uart4_rx_ph4 {
  		nvidia,pins = "uart4_rx_ph4";
  		nvidia,function = "uartd";
  		nvidia,pull = <TEGRA_PIN_PULL_NONE>;
  		nvidia,tristate = <TEGRA_PIN_ENABLE>;
  		nvidia,enable-input = <TEGRA_PIN_ENABLE>;
  		nvidia,lpdr = <TEGRA_PIN_DISABLE>;
  	};

  	uart4_rts_ph5 {
  		nvidia,pins = "uart4_rts_ph5";
  		nvidia,function = "uartd";
  		nvidia,pull = <TEGRA_PIN_PULL_DOWN>;
  		nvidia,tristate = <TEGRA_PIN_DISABLE>;
  		nvidia,enable-input = <TEGRA_PIN_DISABLE>;
  		nvidia,lpdr = <TEGRA_PIN_DISABLE>;
  	};

  	uart4_cts_ph6 {
  		nvidia,pins = "uart4_cts_ph6";
  		nvidia,function = "uartd";
  		nvidia,pull = <TEGRA_PIN_PULL_NONE>;
  		nvidia,tristate = <TEGRA_PIN_ENABLE>;
  		nvidia,enable-input = <TEGRA_PIN_ENABLE>;
  		nvidia,lpdr = <TEGRA_PIN_DISABLE>;
  	};

The GPIO status

root@localhost:/home/ubuntu# cat /sys/kernel/debug/gpio | grep PH
gpio-391 (PH.00 )
gpio-392 (PH.01 )
gpio-393 (PH.02 )
gpio-394 (PH.03 )
gpio-395 (PH.04 )
gpio-396 (PH.05 )
gpio-397 (PH.06 )
gpio-398 (PH.07 )

Test command (loop back)

# stty -F /dev/ttyTHS3 speed 115200 raw -echo
# cat /dev/ttyTHS3 &
# echo “1234” > /dev/ttyTHS3

Do I miss something?
Best Regards

hello user24856,

do you have external hardware connected?

External hardware on the com port? No.

hello user24856,

how you have pin connections? please also note that they’re having different voltages.

The pinmux in the device is following

157 (uart4_cts_ph6):
pull=0
tristate=1
enable-input=1
open-drain=0
io-reset=0
rcv-sel=0
io-hv=0
loopback=0
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
func=uartd
pad-power=0
158 (uart4_rts_ph5):
pull=1
tristate=0
enable-input=0
open-drain=0
io-reset=0
rcv-sel=0
io-hv=0
loopback=0
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
func=uartd
pad-power=0
159 (uart4_rx_ph4):
pull=0
tristate=1
enable-input=1
open-drain=0
io-reset=0
rcv-sel=0
io-hv=0
loopback=0
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
func=uartd
pad-power=0
160 (uart4_tx_ph3):
pull=0
tristate=0
enable-input=0
open-drain=0
io-reset=0
rcv-sel=0
io-hv=0
loopback=0
schmitt=0
pull-down-strength=0
pull-up-strength=0
drive-type=0
func=uartd
pad-power=0

I meant UART and RS-232 are not the same. you should refer to this…

There are four com port totally in our carrier board. We have tried com1, com2 and com5 with RS-232 loopback via command without any error.
This is uarta: serial@3100000 and /dev/ttyTHS0

# stty -F /dev/ttyTHS0 speed 115200 raw -echo
# cat /dev/ttyTHS0 &
# echo “1234” > /dev/ttyTHS0

The com3 mapping table we mapping are (are those item corrected?)

PIN - L5
signal name - UART4_TX
DTS : uartd: serial@3130000
sysfs : /dev/ttyTHS3

And test command is

# stty -F /dev/ttyTHS0 speed 115200 raw -echo
# cat /dev/ttyTHS0 &
# echo “1234” > /dev/ttyTHS0

However, the signal will be halted by system.

I am also having issues with this uart and I get no data on TX and it doesnt respond to data being fed into it from another port. I have verified this with a scope. Seems to be some kind of pinmuxing issue.

hello user24856,

is there kernel failure reported? please also setup a terminal running $ dmesg --follow for gathering logs.

please also have a try to disable getty service for running the test.
$ sudo systemctl stop nvgetty.service
$ sudo systemctl disable nvgetty.service

It’s not work for this issue.

is there kernel failure reported? please check whether you’ve logs for reference.

It has no error log while testing the echo command. The boot log has attached.
boot_dmesg.txt (174.9 KB)

Hi,
Could you try with USB to TTL and see if it can work as a normal USRT port? The adapter is like:
Amazon.com : usb to ttl adapter

For Xavier NX/Nano developer kits, we use this kind of adapter.

Our product specific the UART4 to be RS-232 function like other uart port. The usb to uart is not alternative feature. Is this a limitation or bug?

hello Liszt.Kao,

it looks this pin is default used by camera driver as reset pin.
for example,
#define CAM0_RST_L TEGRA234_MAIN_GPIO(H, 3)

and… these two pin were default configured as GPIOs.

                        gpio-output-low = <
                                TEGRA234_MAIN_GPIO(H, 3)
                                TEGRA234_MAIN_GPIO(H, 4)

for the UART functions.
you should modify pinmux spreadsheets to toggle the pin usage as UD3_TXD/ UD3_RXD.
please see-also developer guide, Changing the Pinmux for reference.
thanks

Both gpio and pinmux has modified, please check the “The GPIO status” and “The pinmux in the device” described above.
Thank you

hello Liszt.Kao,

how you update the pinmux configuration file?
these two should not be GPIO pins.

If we change the pin to be function pin, will it not be visible on “/sys/kernel/debug/gpio”?
By the way, I usually change the pinmux on the

~/Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3701-0000.dtsi.

hello Liszt.Kao,

it should be SFIO instead of GPIO for UART function.
please dump those 2 registers to check the value.
UART4_TX: $ sudo busybox devmem 0x02434020
UART4_RX: $ sudo busybox devmem 0x02434018

please also check TRM for details…
thanks

Thank you for your command to verify it. The issue has been fixed