AnsweredAssumed Answered

usb-serial ports send weird characters

Question asked by jsmith883 on Feb 7, 2018
Latest reply on Feb 9, 2018 by igorpadykov



I am connecting a modem to the i.MX6 via USB, which enumerates 4 different ttyACM ports.  If I open one of the ports in minicom or screen, when I type in "AT+CGMI", it will type "@T*BLFH" instead.  This worked in kernel 3.14, but it seems that USB serial ports are having issues in kernel 4.1.15.  The two strings seem to be off by the least-significant bit in each byte. 


Someone else had a similar problem, and seems to be related to DMA (see link below).  In this case it was a dedicated UART port and disabling DMA solved the problem.  Is there a way to disable DMA on a USB serial device?

iMX6 Linux serial port buffer 


EDIT: After some more research, I've eliminated some possibilities and dug deeper into the rabbit hole.  It turns out it has nothing to do with the kernel version after all.  If I connect a USB to Serial converter (I'm using Prolific PL2303), and I short the RX and TX together so I read back what I write, I've noticed that I can send data correctly, but when I receive data it is off by one bit.  I've verified this by using a logic analyzer to make sure that when I type "A", the logic analyzer also reads "A".  But when looking at the echo from minicom, it shows "@" instead.


Any ideas why I can send data correctly, but when I receive data it is not correct?  I do not think this is a hardware issue since sending works... right?


Any thoughts on how to get this working?


Here is how the serial port is configured:

# stty -F /dev/ttyACM0 -a
speed 9600 baud;stty: /dev/ttyACM0
line = 0;
intr = ^C; quit = ^\; erase = ^?; kill = ^H; eof = ^D; eol = <undef>;
eol2 = <undef>; swtch = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R;
werase = ^W; lnext = ^V; flush = ^O; min = 100; time = 2;
-parenb -parodd cs8 -hupcl -cstopb cread clocal -crtscts
-ignbrk brkint ignpar -parmrk -inpck -istrip -inlcr -igncr -icrnl ixon -ixoff
-iuclc -ixany -imaxbel -iutf8
-opost -olcuc -ocrnl -onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0
-isig -icanon iexten -echo echoe echok -echonl -noflsh -xcase -tostop -echoprt
echoctl echoke