Linux – Serial port ignoring custom divisor

androidlinuxserial port

I am trying to run a serial port at 3.25Mb/s by applying a divisor of 2 to a baud base of 6.5Mb/s. I am using an IoT device (Telit HE922-3GR) running android 6 with built in serial ports, the proc/tty/driver/ttyS file contains:

serinfo:1.0 driver revision:
0: uart:XGOLD_USIF mmio:0xE1200000 irq:36 tx:32497 rx:20751 fe:1834 RTS|DTR|DSR|CD|RI
1: uart:XGOLD_USIF mmio:0xE1100000 irq:35 tx:453 rx:0 RTS|DTR|DSR|CD|RI

I am using /dev/ttyS1

The divisor is being set in sys/class/tty/ttyS0/custom_divisor to the correct value but the serial port is still running at 6.5Mb/s, no matter what the divisor.

Is there anything I can do to ensure the serial port uses this divisor?

Best Answer

If you have a closer look at the broadcom datasheet specs of some iOT chipsets, you will see there white in black, that the serial communication services implementation in ARM iOT are partial emulations of the common 16550 serial chipsets you find commonly in the PC world. As far as I remember, they write explicitly the emulation only suports a small subset of the 16550 services.

So they provide only a good enough subset of the services "full blown UARTs" provide.

Bottom line, do not count on it supporting all the usual functionalities at 100%.

Related Question