VIM2 Android ttyS4 4800 baud rate change


#1

How to change baud rate of ttyS4 serial port to 4800?
the command (in su mode): stty -F /dev/ttyS4 4800 fails with message “cannot perform all requested operations”. For higher speeds it works well but I can’t set 4800. I have tried to set half of the current baud_base (from 1500000 to 750000) using setserial, but the baud rate is still 9600 and it works as 9600.


#2

The VIM2 UART minimum baud rate is 9600.
BTW, UART don’t support for 750000 baud rate.

baud = uart_get_baud_rate(port, termios, old, 9600, 4000000);


unsigned int uart_get_baud_rate(struct uart_port *port, struct ktermios *termios,
           struct ktermios *old, unsigned int min, unsigned int max)

I tried to change baud rate of ttyS4 serial port. That is work.

130|kvim2:/ $ stty -F /dev/ttyS4 9600                                          
[ 4042.022889@2] meson_uart c81004e0.serial: ttyS4 use xtal(8M) 24000000 change 1500000 to 1500000
[ 4042.026055@2] meson_uart c81004e0.serial: ttyS4 use xtal(8M) 24000000 change 1500000 to 9600
kvim2:/ $ stty -F /dev/ttyS4 115200                                            
[ 4505.512770@3] meson_uart c81004e0.serial: ttyS4 use xtal(8M) 24000000 change 9600 to 9600
[ 4505.515508@3] meson_uart c81004e0.serial: ttyS4 use xtal(8M) 24000000 change 9600 to 115200
kvim2:/ $ stty -F /dev/ttyS4 19200                                             
[ 4524.214100@0] meson_uart c81004e0.serial: ttyS4 use xtal(8M) 24000000 change 115200 to 115200
[ 4524.217087@0] meson_uart c81004e0.serial: ttyS4 use xtal(8M) 24000000 change 115200 to 19200
kvim2:/ $ stty -F /dev/ttyS4 38400                                             
[ 4533.793617@3] meson_uart c81004e0.serial: ttyS4 use xtal(8M) 24000000 change 19200 to 19200
[ 4533.796392@3] meson_uart c81004e0.serial: ttyS4 use xtal(8M) 24000000 change 19200 to 38400


#3

OK! Thank You for fast feedback. I have managed to configure the GPS (Sirf IV) to 9600 speed. Sorry, I was unaware of this low baud limit. I hope that this post will be helpful for others.


#4

AT BTW
baud_base set by setserial is not a baud rate, as far as I know:
“baud rate”= baud_base/a_divider