I’d like to use an Arduino Nano 33 BLE to control some motors and read data from some encoders. Currently I have the Arduino’s TX/RX pins hooked up with the Jetson’s RX/TX pins (10 and 8, respectively) on header J41. That means the Arduino should be accessible through /dev/ttyTHS1
. I want to bridge the two devices using these pins, not USB.
However, I’m unable to read from or write to the Arduino. When I run cat /dev/ttyTHS1
to read from the port, the command either hangs on me with no output (there should be output) or exits immediately, and when I echo
to /dev/ttyTHS1
, the Arduino fails to respond.
The Arduino has a 3.3 V logic level, and both devices have their serial ports set to 115200 8N1. The Jetson and Arduino share a common ground thanks to a wire connecting their ground pins together (pin 6 on the Jetson).
It seems like several others have had this issue as well. Unfortunately the popular fix (1, 2) where you stop
and disable
the nvgetty
service doesn’t apply to me, since my Jetson lacks that service for some reason and instead has the following:
└─ $ ▶ systemctl list-units --all | grep getty.*.service
getty-static.service loaded inactive dead getty on tty2-tty6 if dbus and logind are not available
getty@tty1.service loaded inactive dead Getty on tty1
serial-getty@ttyGS0.service loaded active running Serial Getty on ttyGS0
serial-getty@ttyS0.service loaded active running Serial Getty on ttyS0
Some more relevant info:
└─ $ ▶ sudo systemctl stop nvgetty
Failed to stop nvgetty.service: Unit nvgetty.service not loaded.
└─ $ ▶ sudo systemctl disable nvgetty
Failed to disable unit: Unit file nvgetty.service does not exist.
└─ $ ▶ ls /etc/systemd/system/getty.target.wants/
getty@tty1.service serial-getty@ttyGS0.service
└─ $ ▶ sudo cat /proc/tty/driver/serial
serinfo:1.0 driver revision:
0: uart:Tegra mmio:0x70006000 irq:63 tx:66 rx:0 RTS|CTS|DTR|RI
1: uart:unknown port:00000000 irq:0
2: uart:unknown port:00000000 irq:0
3: uart:unknown port:00000000 irq:0
└─ $ ▶ dmesg | grep tty
[ 0.000000] Kernel command line: tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1125 core_edp_ma=4000 root=/dev/mmcblk0p1 rw rootwait console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 root=/dev/mmcblk0p1 rw rootwait
[ 0.002351] console [tty0] enabled
[ 0.793376] console [ttyS0] disabled
[ 0.793526] 70006000.serial: ttyS0 at MMIO 0x70006000 (irq = 63, base_baud = 25500000) is a Tegra
[ 3.162475] console [ttyS0] enabled
[ 3.163974] 70006040.serial: ttyTHS1 at MMIO 0x70006040 (irq = 64, base_baud = 0) is a TEGRA_UART
[ 3.164415] 70006200.serial: ttyTHS2 at MMIO 0x70006200 (irq = 65, base_baud = 0) is a TEGRA_UART
└─ $ ▶ sudo cat /proc/cmdline
tegraid=21.1.2.0.0 ddr_die=4096M@2048M section=512M memtype=0 vpr_resize usb_port_owner_info=0 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 console=ttyS0,115200n8 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff780000 core_edp_mv=1125 core_edp_ma=4000 root=/dev/mmcblk0p1 rw rootwait console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait console=ttyS0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 rootfstype=ext4 root=/dev/mmcblk0p1 rw rootwait