linux-serial-test icon indicating copy to clipboard operation
linux-serial-test copied to clipboard

PL2303HXD issues with high baud rates

Open swiftgeek opened this issue 6 years ago • 6 comments

6000000 and 12000000 baud rates have issues with linux-serial-test, but work fine in tio/picocom.

Lower ones work fine in linux-serial-test

linux-serial-test -b 6000000 -p /dev/ttyUSB0 -s -e
Linux serial test app
NOTE: non standard baud rate, trying custom divisor
zsh: floating point exception (core dumped)
linux-serial-te[631304] trap divide error ip:556b5c37a677 sp:7fffab836d80 error:0 in linux-serial-test[556b5c37a000+2000]

swiftgeek avatar Nov 30 '19 14:11 swiftgeek

Seems duplicate of #17.

andy-shev avatar Nov 30 '19 21:11 andy-shev

does anyone happen to know what API the tio/picocom apps use? Might be able to learn something there.

@swiftgeek what platform are you testing on?

cbrake avatar Nov 30 '19 21:11 cbrake

Archlinux with 5.3.x kernel

And BOTHER search on picocom repo returns https://github.com/npat-efault/picocom/blob/master/termios2.txt so I guess it's using that.

From tio changelog It looks like it uses termios2 as well, but only for nonstandard baud rates

swiftgeek avatar Dec 01 '19 19:12 swiftgeek

Looking at the code a bit:

  • https://github.com/npat-efault/picocom/blob/master/termios2.c#L159
  • https://github.com/tio/tio/blob/master/src/setspeed2.c#L26
  • https://github.com/tio/tio/blob/master/src/setspeed2.c#L26
  • https://github.com/tio/tio/blob/master/src/tty.c#L609
  • https://github.com/tio/tio/blob/master/configure.ac#L88

Seems we can do something like the tio project to conditionally use the new API.

cbrake avatar Dec 03 '19 13:12 cbrake