How to setup serial port connection on j21 header

Hi,

I am using jetson tx2 and was wondering if I am able to use those pin at J21. I read online and tried to use pin 8 (UART0 Tx) and pin 10 (UART0 Rx) to connect to a USB header that I made myself. I tried to find the port using lsusb at another computer but failed to find the port.

Do I need any setting or config to make it work?

Thanks

It should be framing 115200 8N1. Check [url]http://www.jetsonhacks.com/2017/03/24/serial-console-nvidia-jetson-tx2/[/url].

lsusb lists USB devices but won’t have any knowledge of the software connecting to it. If you have a USB serial UART then the host would see the device with lsusb, and then if the driver exists on the host (and often it does, especially if FTDI chipset) your “/dev/ttyUSB0” (or some other number) will exist. Once you find the device on your host you can use the settings @Honey_Patouceul gave.

Hi!

Thanks for all your information! However, what if the usb is just a normal usb cable (type A male to type A female usb cable and I just cut it into half to make the usb header/socket myself). I dont think those type of cable have FTDI chipset or driver in it. Do I still have any way to go about it other than getting those usb that have FTDI/driver in it.

Thanks!

That won’t work. It has to serialize/deserialize data. It isn’t possible for a cable to do this without a UART in it. This could possibly damage something as well.

Hi,

If I connect the usb (type A female) on the j21 pin, and I connect one usb thumb drive to the female connector. Is it possible I access/locate the usb on jetson tx2 itself?

The reason of doing it is because as jetson tx2 board only have one usb port available. Im trying to see if I can make use of j21 to make addition usb port out to access it.

Thanks!

No. J21 cannot serve that function…it isn’t USB, it’s a serial UART and incompatible both electrically and in software. At best it’ll crash and burn…at worst you’ll destroy hardware.

The micro-USB port is an “On the Go” (“OTG”) port. If you use a micro-A USB connector it functions as a normal USB port. The cable which ships with this is micro-B so it won’t work as a host with that cable (this cable was designed for flashing in recovery mode). There are adapters (and I think the dev kit ships with one) for conversion of micro-A to full-sized-A. This would give you the second port.

Or USB is designed to expand with an ordinary USB HUB.

The micro-USB port is only wired for USB2 speeds or slower. The full-sized type-A port can run USB3 speeds.

Ok, thank you so much for the information!

To double confirm, if I want to use the UART pin on J21. The device must have FTDI or support UART, example if I want to connect it to a RS232 drvier, I need a RS232 To TTL Converter Module and connect it to the J21 pins.

Thanks!

The serial port on J21 does not need any driver addition on the Jetson side. The host computer talking to the serial port does need a driver supporting the particular serial UART.

If you reverse the situation and plug the USB end of a serial USB UART into the USB connector of the Jetson, then the Jetson needs the driver. FTDI is usually the most supported in terms of default drivers, but others will work too…they just might need more work.

Are you wanting to talk to the serial console from a host computer to the Jetson? If yes, then the TX/RX/GND lines will connect at the Jetson…and the USB end will connect on the host. The host will need setup, the Jetson should “just work” for this particular case.

If you have custom software and it isn’t a serial console you are interested in, then things change. Are you trying to use a serial console? Or are you trying to do something different?

Hi,

I wanted to connect a hardware that uses rs232 that transmit/receive data to Jetson. So the jetson will be the host and it will communicate to the hardware through the rs232. So I am trying to use the UART pin in jetson to communicate to the hardware. I understand that I can achieve it by using a rs232 to usb converter and plug it into the usb port.

Thanks!

RS232 is a protocol, but there are different implementations of physical voltage levels depending on hardware. The J21 serial console is specifically 3.3V (“TTL Level”). However, J21 won’t work for general purpose…this is wired as serial console. Each side will send garbage to the other as if they are users randomly typing into a keyboard at a logged in terminal.

For general communications you probably want to use J17. This is also 3.3V, but it isn’t configured as serial console. This connector does not require any additional driver beyond what the Jetson already has…the UART built in to the system provides this capability (this will show up as “/dev/ttyTHS2” on the Jetson). Had you chosen to plug in a cable which is a USB serial UART you would need that specific UART supported…the point is that the J17 and J21 serial UARTs already have drivers…external USB serial UARTs do not.

In the case of your device already having 3.3V serial UART wires your other device most likely already has its own driver as well. If the voltage level on your device is not 3.3V you will need to level shift it to 3.3V…1.8V won’t work, and 9-pin D-Sub connectors will cause damage. If your other device has this connector integrated I would not expect it to need an extra driver…if your other device is using a USB or other non-permanent removable serial port then it probably does need a driver.

Is your other device 3.3V? Is it integrated? Is it externally added, and if so, is it USB, PCI, so on?

Hi,

It is externally added, and it can be USB or PCI depending on the J17 pin out. I have search online for J17 pinout but I cant seem to find much about it.

Does J26 pin have UART? I can only find J21 pinout and not the rest thats why I never really find more about the other header pins.

Thanks!

TX1 and TX2 share the same carrier board. The pinouts of J17 are found here:
https://elinux.org/Jetson/TX1_Serial_Console#Color_Codes_and_Pin_Descriptions_of_the_USB_Serial_UART_Cable

This URL describes matching cable pins to J21 pins for serial console. The TX/RX and CTS/RTS numbering on the cable itself are what you’d be interested in. CTS and RTS are something which are not mandatory…depending on how flow control is set up these may or may not help to have connected. RX/TX/GND will of course always be connected. 5V can be ignored, this is a line for devices needing to draw 5V from the USB host. This USB serial UART is a standard connector which works with J17 and is 3.3V with an FTDI chipset (this cable is tested):
https://www.digikey.com/product-detail/en/TTL-232R-3V3/768-1015-ND/1836393

Pin 1: Ground.
Pin 2: CTS for USB end, pairs with RTS for Jetson end.
Pin 3: 5V...do not use.
Pin 4: TX for USB end, pairs with RX for Jetson end.
Pin 5: RX for USB end, pairs with TX for Jetson end.
Pin 6: RTS for USB end, pairs with CTS for Jetson end.

This implies that J17 could be put into loopback for testing via a jumper between pins 4 and 5, plus additionally between pins 2 and 6 if RTS/CTS flow control is used. Loopback will simply echo back whatever is sent.

Note that male/female connectors are such that the cable named in this above URL will “do the right thing” when connected to J17.

The carrier board schematic will allow verification. See:
https://developer.nvidia.com/embedded/downloads#?search=schematic

The schematic will verify J26 does not have any UART connections (though I suppose there might be some sort of GPIO configuration changing this…I’ve just never seen it).

Hi!

I will go and tried it out! Thanks so much for your help and information!