How to set uart for serial communication on tx1

Hello, I have a problem.
I’m trying to use the RS232 serial port to connect TX1 with camera(to control some parameter.)
But I can only send data from TX1, but not able to receive data from the camera.

I think it is the error of a setting.
but I don’t know how to do. I don’t understand the meaning of “UART: undefined, Port: 0x0000”
Please tell me how to set uart and port number…

Thanks for your interest and sorry for my poor English.

================================

Using setserial,

setserial -g /dev/ttyS0
/dev/ttyS0, UART: undefined, Port: 0x0000, IRQ: 68

================================

ubuntu@tegra-ubuntu:~$ dmesg | grep ttyS0
[ 0.000000] Kernel command line: fbcon=map:0 console=tty0 console=ttyS0,115200n8 androidboot.modem=none androidboot.serialno=P2180A00P00940c003fd androidboot.security=non-secure tegraid=21.1.2.0.0 ddr_die=2048M@2048M ddr_die=2048M@4096M section=256M memtype=0 usb_port_owner_info=2 lane_owner_info=0 emc_max_dvfs=0 touch_id=0@63 video=tegrafb no_console_suspend=1 debug_uartport=lsport,0 earlyprintk=uart8250-32bit,0x70006000 maxcpus=4 usbcore.old_scheme_first=1 lp0_vec=0x1000@0xff2bf000 nvdumper_reserved=0xff23f000 core_edp_mv=1125 core_edp_ma=4000 gpt android.kerneltype=normal androidboot.touch_vendor_id=0 androidboot.touch_panel_id=63 androidboot.touch_feature=0 androidboot.bootreason=pmc:software_reset,pmic:0x0 net.ifnames=0 root=/dev/mmcblk0p1 rw rootwait usbcore.usbfs_memory_mb=1000 vmalloc=320M cma=64M coherent_pool=48M
[ 2.930134] 70006000.serial: ttyS0 at MMIO 0x70006000 (irq = 68) is a Tegra
[ 2.936919] console [ttyS0] enabled, bootconsole disabled

================================
the setting of termios

newtio.c_cflag = B57600|CS8|CLOCAL|CREAD;
newtio.c_iflag = IGNPAR;
newtio.c_oflag = 0;
newtio.c_lflag = 0;
newtio.c_cc[VTIME] = 0;
newtio.c_cc[VMIN] = 0;

ttyS0 is the serial console, not camera. On the dev carrier board ttyTHS2 is the camera if you are talking about the dev board camera connector (this is also routed to J17 using standard 3.3V TTL level 6-pin serial UART cables).

FYI, one of the annoying things about serial ports is that they are not truly “plug-and-play” because you can query the driver, but the driver does not actually have the ability to query the UART. You can set a mode, or query for UART type, but unless the driver was correct in how it got its settings (via something which knows correct settings) the query may tell you about driver state but not actual hardware.

Also, when you do use a serial UART, be sure to check if CTS/RTS hardware flow control is required or not. Normally it isn’t mandatory, but if you get half of communications working, and not the other half, it is possible missing hardware flow control is causing one end of the communications to be ignored.

I suspect one of the reasons why setserial does not know UART type is because the serial UARTs have options to mimic multiple serial UART types…perhaps nothing forwarded the setting of current emulation to the driver.