I'm working on the nvidia jetson tk1 board which has a rs232 serial port and I'm trying to do a loopback test by shorting the pin 2 and pin 3. I'm using the serial port communicator terminal gtkterm but when I try to write in the terminal I can't get the characters to echo back nor will the characters show up on the screen. I am using ubuntu. I used the command setserial -g /dev/ttyS* and setserial -g /dev/ttyTHS* to see the information about the ports but the output I get is

/dev/ttyS0, UART: undefined, Port: 0x0000, IRQ: 122
/dev/ttyS1, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS2, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyS3, UART: unknown, Port: 0x0000, IRQ: 0
/dev/ttyTHS0, UART: undefined, Port: 0x0000, IRQ: 68
/dev/ttyTHS1, UART: undefined, Port: 0x0000, IRQ: 69
/dev/ttyTHS2, UART: undefined, Port: 0x0000, IRQ: 78

So I have a few questions here:

  • which ones are the REAL ports,
  • why does it say the UART is undefined, and
  • why does it seem like they're not physically mapped at all.

I also did a little research and you can change the UART with this command sudo setserial /dev/ttyS1 uart 16550A but I don't know the UART model type, I checked the document and the parts of the board and all I can tell you is the UART type is DB-9 UART serial console.


IIRC Jetson TK1's DB9 is connected to /dev/ttyS0 on Linux kernel. And the default Ubuntu distribution sets it up as kernel's console device (see cat /proc/consoles) and runs getty on it. You need to stop them for your application to use /dev/ttyS0 exclusively.

To stop getty you could run stop ttyS0. I don't know how to detach /dev/ttyS0 from kernel console devices, you have to remove console=ttyS0,... from the boot parameter. Anyway, for the first test it's highly recommeded to connect DB9 from other PC with a cross cable.

I'm afraind setserial's output is meaningless and useless on TK1. /dev/ttyS0 is ready on boot and you could configure it using Linux termios API, so just use stty or other sophisticated terminal software like kermit. I've never used gtkterm but it also will do. You could achieve nothing unless got rid of getty or shell process from the port, though.

To use kermit, do apt-get install ckermit and create ~/.kermrc file with the following content:

set modem type none
set line /dev/ttyS0
set speed 115200
set carrier-watch off
set flow none

Then launch kermit in a terminal. Enter connect on the prompt to connect the serial port. In the session typing Ctrl+\ followed by c to get back to the prompt, q to quit kermit.

$ kermit
C-Kermit 9.0.302 OPEN SOURCE:, 20 Aug 2011, for Linux+SSL+KRB5 (64-bit)
 Copyright (C) 1985, 2011,
  Trustees of Columbia University in the City of New York.
Type ? or HELP for help.
(/home/yaegashi/) C-Kermit>connect
Connecting to /dev/ttyS0, speed 115200
 Escape character: Ctrl-\ (ASCII 28, FS): enabled
Type the escape character followed by C to get back,
or followed by ? to see other options.

Closing /dev/ttyS0...OK
  • Thank you for the reply. The device belongs to the company I'm working for so I dont want to mess around too much with it and accidentally detach something I'm not supposed to. So is that why it says the UART is undefined? Shouldnt there be a model type next to it, I mean the UART is right there how can it not identify it? – Nesibe Yavuz Jul 21 '15 at 13:02
  • @NesibeYavuz Updated my post. Just try stop ttyS0 first, it won't break anything in your system. Then run kermit on /dev/ttyS0 as explained above. I again recommend you to prepare another PC working as a serial terminal for testing, instead of a loopback connection. – yaegashi Jul 21 '15 at 17:06
  • Thank you, the problem was just like you said the port was being used by default and we set up another computer and cross cabled. We saw that (by using putty) we had access to the terminal in the ubuntu OS. The alternative might be to be use the expansion IO and use the pins that are embedded in there. – Nesibe Yavuz Jul 31 '15 at 8:49

I just experienced a similar problem with undefined UART serial ports and Linux, with an ARCHMI PC. dmesg | grep serial was not showing any results. After many trials, I noticed that it was a BIOS problem. After disabling the "Quick Boot" option, everything run smoothly and serial ports were loaded correctly with UART, dmesg showed results. Just in case it helps by chance.

  • Can you please elaborate on how to disable "Qucik Boot" option. – Naga Kiran Jun 1 '18 at 10:52
  • When you turn on the computer, enter the BIOS. (Probably by pressing F2 key). Then go to Boot tab, then select the row Fast Boot, and change value to disabled. – ferdymercury Jun 2 '18 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.