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: 78So 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.
setserial /dev/ttyS* UART is undefined
linux;serial port
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 noneset line /dev/ttyS0set speed 115200set carrier-watch offset flow noneThen 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.$ kermitC-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>connectConnecting to /dev/ttyS0, speed 115200 Escape character: Ctrl-\ (ASCII 28, FS): enabledType the escape character followed by C to get back,or followed by ? to see other options.----------------------------------------------------Closing /dev/ttyS0...OK