Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open serial port in linux without changing any pin?

Posix requires changing RTS pin on port opening. I want a way to avoid it.

like image 420
vitaly.v.ch Avatar asked Feb 23 '11 11:02

vitaly.v.ch


People also ask

What does Setserial command do in Linux?

Description. setserial is a program designed to set and/or report the configuration information associated with a serial port. This information includes what I/O port and IRQ a particular serial port is using, and whether or not the break key should be interpreted as the Secure Attention Key, and so on.

How do you reprogram a serial port?

To configure the Serial Port for your device, on your computer go to Control Panel - Device Manager, select “High-Speed USB Serial Port (Com X)”, right click and select Properties. Click the Features tab. This tab is used to change the COM port number and configure the port.

How does Linux assign serial ports?

Linux names its serial ports in the UNIX tradition. The first serial port has the file name /dev/ttyS0, the second serial port has the file name /dev/ttyS1, and so on. This differs from the IBM PC tradition. The first serial port is named COM1:, the second serial port is named COM2:, and so on.


1 Answers

I have no idea why you'd want to do this, but this can be done pretty easily by modifying the linux kernel driver for your serial console so it doesn't toggle RTS. For example, for the 8250-series driver in drivers/tty/serial/8250/ you could change every write to the MCR register (UART_MCR) to ensure that bit 1 (mask is UART_MCR_RTS) is never set.

Since it's abstracted away in userspace, you're out of luck if you want to do this without modifying the kernel driver.

like image 118
cha5on Avatar answered Oct 03 '22 12:10

cha5on