Re: usb-serial debugging, missing LSB

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 27, 2018 at 7:47 AM, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
> On Tue, Feb 27, 2018 at 07:26:23AM -0500, Brent Sink wrote:
>> Hi Greg,
>>
>> On Tue, Feb 27, 2018 at 4:16 AM, Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>> > On Mon, Feb 26, 2018 at 10:05:35PM -0500, Brent Sink wrote:
>> >> Hello,
>> >>
>> >> I'm trying to debug a problem I'm having with a usb-serial device
>> >> (modem) when it's plugged into a USB port on a custom i.MX6 board.
>> >>
>> >> If I connect a USB to Serial converter (I'm using Prolific PL2303),
>> >> and I short the RX and TX lines together so I read back what I write,
>> >> I've noticed that I can send data correctly, but when I receive data
>> >> it is missing the LSB.  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.  "B"
>> >> = "B", "C" = "B", "D" = "D", "E" = "D", and so on.  This same problem
>> >> happens to the 3G and 4G modems, as they create ttyACMx ports and
>> >> ModemManager is unable to talk to them because of this same issue.
>> >> This happens on every board we had made, and I've tried using both
>> >> Buildroot and Debian in case it was a rootfs issue... it's not.  I
>> >> also tried using a 3.14 kernel and 4.1.15 kernel - same problem exists
>> >> in both versions.
>> >
>> > This sounds like you have a problem with your physical loopback device.
>> > I suggest getting a different one and trying that out.
>> >
>> > good luck!
>> >
>> > greg k-h
>>
>> I'm not sure I understand what you mean by the physical loopback
>> device?  Do you mean the Prolific PL2303 device, or the modem, or
>> something else?
>
> What ever you are using to "loop" the TX/RX lines together.  Usually
> this is a little "loopback" dongle that you plug into the device.  Make
> sure that is stable and works well.  It seems that no matter what type
> of device you plug yours into, it does not work, are you sure you have
> all of the needed lines connected?

I see.  Yes, both a usb-serial adapter (using usb-serial driver), and
modems (using cdc_acm driver) have the same problem.  The usb-serial
adapter is stable and works well - I've tested it with a RPi and it
works just fine.  Could something with the device tree influence these
drivers?  I added some printk lines to the cdc_acm.c driver to show
what it is writing and what it is reading.  As you can see towards the
bottom of the dmesg below (at time 39.277549), I type an 'a', which it
correctly recognizes as 0x61, but in the acm_process_read_urb and
acm_read_bulk_callback methods it reads 0x60 instead.

Also, I'm really confused that if I paste text into the terminal it
makes it through ok.  It's like if I fill the buffer quick enough, it
works, but if I fill the buffer one character at a time it doesn't
work.  Not sure if that makes any sense...??

[    3.755020] cdc_acm 1-1.1:1.0: interfaces are valid
[    3.845450] cdc_acm 1-1.1:1.0: ttyACM0: USB ACM device
[    3.846546] cdc_acm 1-1.1:1.0: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    3.847188] cdc_acm 1-1.1:1.2: interfaces are valid
[    3.904252] cdc_acm 1-1.1:1.2: ttyACM1: USB ACM device
[    3.905153] cdc_acm 1-1.1:1.2: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    3.918053] cdc_ether 1-1.1:1.8 usb0: register 'cdc_ether' at
usb-ci_hdrc.1-1.1, CDC Ethernet Device, 6a:dc:65:00:ec:f6
[    3.918189] usbcore: registered new interface driver cdc_ether
[    3.920624] cdc_acm 1-1.1:1.4: interfaces are valid
[    3.976558] cdc_acm 1-1.1:1.4: ttyACM2: USB ACM device
[    3.977600] cdc_acm 1-1.1:1.4: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    3.978388] cdc_acm 1-1.1:1.6: interfaces are valid
[    4.058378] cdc_acm 1-1.1:1.6: ttyACM3: USB ACM device
[    4.062264] cdc_acm 1-1.1:1.6: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    4.066925] cdc_acm 1-1.2:1.0: interfaces are valid
[    4.154076] cdc_acm 1-1.2:1.0: ttyACM4: USB ACM device
[    4.155176] cdc_acm 1-1.2:1.0: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    4.155549] cdc_acm 1-1.2:1.2: interfaces are valid
[    4.189088] cdc_acm 1-1.2:1.2: ttyACM5: USB ACM device
[    4.191554] cdc_acm 1-1.2:1.2: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    4.191882] cdc_acm 1-1.2:1.4: interfaces are valid
[    4.239954] cdc_acm 1-1.2:1.4: ttyACM6: USB ACM device
[    4.265495] cdc_acm 1-1.2:1.4: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    4.265867] cdc_acm 1-1.2:1.6: interfaces are valid
[    4.299007] cdc_acm 1-1.2:1.6: ttyACM7: USB ACM device
[    4.301671] cdc_acm 1-1.2:1.6: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    4.301990] cdc_acm 1-1.2:1.8: interfaces are valid
[    4.317575] cdc_acm 1-1.2:1.8: ttyACM8: USB ACM device
[    4.318397] cdc_acm 1-1.2:1.8: acm_ctrl_msg - rq 0x20, val 0x0, len
0x7, result 7
[    4.318708] cdc_acm 1-1.2:1.10: interfaces are valid
[    4.345074] cdc_acm 1-1.2:1.10: ttyACM9: USB ACM device
[    4.346402] cdc_acm 1-1.2:1.10: acm_ctrl_msg - rq 0x20, val 0x0,
len 0x7, result 7
[    4.349568] usbcore: registered new interface driver cdc_acm
[    4.349576] cdc_acm: USB Abstract Control Model driver for USB
modems and ISDN adapters
[   30.552284] tty ttyACM4: acm_tty_install
[   30.552331] tty ttyACM4: acm_tty_open
[   30.552342] cdc_acm 1-1.2:1.0: acm_port_activate
[   30.552458] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 0
[   30.552477] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 1
[   30.552490] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 2
[   30.552502] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 3
[   30.552514] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 4
[   30.552527] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 5
[   30.552539] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 6
[   30.552551] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 7
[   30.552563] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 8
[   30.552575] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 9
[   30.552587] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 10
[   30.552600] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 11
[   30.552612] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 12
[   30.552625] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 13
[   30.552636] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 14
[   30.552648] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 15
[   30.553660] cdc_acm 1-1.2:1.0: acm_ctrl_msg - rq 0x22, val 0x3, len
0x0, result 0
[   30.553882] cdc_acm 1-1.2:1.0: acm_ctrl_irq - network connection: 1
[   30.555880] cdc_acm 1-1.2:1.0: acm_ctrl_irq - network connection: 1
[   39.277507] cdc_acm 1-1.2:1.1: acm_tty_write - count 1
[   39.277532] cdc_acm 1-1.2:1.1: acm_tty_write - write 1
[   39.277549] 61                                               a
[   39.277825] cdc_acm 1-1.2:1.1: acm_softint
[   39.289651] 60                                               `
[   39.289674] cdc_acm 1-1.2:1.1: acm_read_bulk_callback - urb 0, len 1
[   39.289687] 60                                               `
[   39.289721] cdc_acm 1-1.2:1.1: acm_submit_read_urb - urb 0


>
> thanks,
>
> greg k-h



-- 
-brent
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux