Re: g_serial and cdc_acm communications

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

 



--- On Wed, 5/12/10, Greg KH <greg@xxxxxxxxx> wrote:

> From: Greg KH <greg@xxxxxxxxx>
> Subject: Re: g_serial and cdc_acm communications
> To: "Ron Madrid" <ron_madrid@xxxxxxxxxxxxx>
> Cc: linux-usb@xxxxxxxxxxxxxxx
> Date: Wednesday, May 12, 2010, 12:18 PM
> On Wed, May 12, 2010 at 11:50:52AM
> -0700, Ron Madrid wrote:
> > I'm trying to transfer data across a USB port via
> g_serial
> > (on gadget side) and cdc_acm (on host side) but I'm
> seeing
> > some strange behavior and I want to get some advice on
> where
> > I can start looking.  This is on an MPC8313 based
> system
> > running the latest kernel.
> > 
> > I have written a pair of applications that open each
> device
> > (ttyGS0 and ttyACM0) and transfer data back and
> forth.
> > However when I'm running the apps  the gadget
> side will send
> > (or think it sent) all appropriate data to the host
> side,
> > but the host will only receive part of the
> transmission and
> > time out in the select() call.  I am not seeing
> any errors
> > from the gadget side kernel but occasionally this will
> lock
> > up my host system.  Small data transfers of
> around 200 bytes
> > or less seem to work fine, but when I try larger
> transfers
> > (1k or greater) I will see it fail (timeout in
> select()).
> > 
> > I know that my data transfer 'protocol' works as it
> works
> > great over ethernet and fsl-usb2-udc seems to work
> fine also
> > as I can do this using g_ether, but I'm not sure
> whether
> > this is a problem within g_serial, its interface with
> > fsl-usb2-udc, or my setup of the tty device in the
> > applications.  I've tried a ton of different
> configurations
> > with the termios structure but haven't seen this work
> > reliably.
> > 
> > Thanks for your feedback and let me know if you need
> more
> > information about the problem.
> 
> What kernel version are you using?

I'm using 2.6.33 on the gadget board and 2.6.17 on the host
=/

> If you use usbmon to monitor the data, do you see
> everything flowing
> properly?

Just before I begin the transfers I see this:
f4ca7d40 4137094460 S Ii:003:02 -115 10 <
f7700840 4137094479 S Co:003:00 s 21 22 0003 0000 0000 0
f7700840 4137094635 C Co:003:00 0 0

The last thing I see when it fails is this:
f524f240 4162584545 S Co:003:00 s 21 22 0000 0000 0000 0
f524f240 4162585480 C Co:003:00 0 0
f4ca7d40 4162585549 C Ii:003:02 -2 0
f4ca7340 4162585599 C Bi:003:01 -2 0

So I understand that these are control signals but I'm not
entirely sure about what they tell me.  It seems that they
are bmRequestType, bRequest, wValue, wIndex, and wLength
but they don't seem to be for my device, except for the
last line.

This is what the normal inputs and outputs look like:
f75a49c0 4142570973 C Bi:003:01 0 22 = 00680000 00020000
00000000 07d00000 00000000 0000
f75a49c0 4142570983 S Bi:003:01 -115 1024 <
f524ff40 4142571348 C Bi:003:01 0 1024 = 99919999 99999999
66666666 66642266 99d99999 99999919 46666664 66646626
f7452940 4142571350 C Bi:003:01 0 1024 = 99999999 99991998
66666666 66646e46 99999919 91999999 66666646 66566666
f7452c40 4142571353 C Bi:003:01 0 0
f6cb7b40 4142571474 C Bi:003:01 0 1024 = 66666666 66666666
99999199 99919989 66666666 66764666 99999999 99999999
f6cb7ac0 4142571476 C Bi:003:01 0 1024 = 66662666 66666664
99819999 99999919 66666664 66666622 99999998 999d9999
f6cb7cc0 4142571478 C Bi:003:01 0 0
f6cb7bc0 4142571598 C Bi:003:01 0 1024 = 46664606 24666666
99999199 99999999 66666662 66266662 99d99198 9b999999
f4ca75c0 4142571600 C Bi:003:01 0 1024 = 64662666 66666466
19d19899 91199999 76646664 66666262 99901909 19999999
f4ca7540 4142571602 C Bi:003:01 0 0
f4ca71c0 4142571723 C Bi:003:01 0 1024 = 99999999 99999999
6666646e 66466666 99919899 99199999 66666666 66646666
f4ca7340 4142571725 C Bi:003:01 0 832 = 99899999 99998999
66646266 64646646 99999999 99989919 62666666 66466666
f524ff40 4142572389 S Bi:003:01 -115 1024 <
f7452940 4142572395 S Bi:003:01 -115 1024 <
f7452c40 4142572397 S Bi:003:01 -115 1024 <
f6cb7b40 4142572399 S Bi:003:01 -115 1024 <
f6cb7ac0 4142572401 S Bi:003:01 -115 1024 <
f6cb7cc0 4142572403 S Bi:003:01 -115 1024 <
f6cb7bc0 4142572406 S Bi:003:01 -115 1024 <
f4ca75c0 4142572408 S Bi:003:01 -115 1024 <
f4ca7540 4142572410 S Bi:003:01 -115 1024 <
f4ca71c0 4142572412 S Bi:003:01 -115 1024 <
f4ca7340 4142572414 S Bi:003:01 -115 1024 <
f686d7c0 4142572869 S Bo:003:01 -115 18 = 00680000 00020000
0000a000 00000000 07d0

The first and last lines match my own header information
appear to be correct.

The last captured transfer looks a little bit different but
I don't know if this tells me anything.
f75a44c0 4142578973 C Bi:003:01 0 22 = 00680000 00020000
00000000 07d00000 00000000 0000
f75a44c0 4142578980 S Bi:003:01 -115 1024 <
f75a41c0 4142579348 C Bi:003:01 0 1024 = 99919999 99999999
66666666 66642266 99d99999 99999919 46666664 66646626
f75a43c0 4142579351 C Bi:003:01 0 1024 = 99999999 99991998
66666666 66646e46 99999919 91999999 66666646 66566666
f75a4cc0 4142579352 C Bi:003:01 0 0
f75a41c0 4142579359 S Bi:003:01 -115 1024 <
f75a43c0 4142579361 S Bi:003:01 -115 1024 <
f75a4cc0 4142579363 S Bi:003:01 -115 1024 <
f75a49c0 4142579473 C Bi:003:01 0 1024 = 66666666 66666666
99999199 99919989 66666666 66764666 99999999 99999999
f524ff40 4142579475 C Bi:003:01 0 1024 = 66662666 66666664
99819999 99999919 66666664 66666622 99999998 999d9999
f7452940 4142579477 C Bi:003:01 0 0
f75a49c0 4142579484 S Bi:003:01 -115 1024 <
f524ff40 4142579486 S Bi:003:01 -115 1024 <
f7452940 4142579488 S Bi:003:01 -115 1024 <
f7452c40 4142579598 C Bi:003:01 0 1024 = 46664606 24666666
99999199 99999999 66666662 66266662 99d99198 9b999999
f6cb7b40 4142579601 C Bi:003:01 0 1024 = 64662666 66666466
19d19899 91199999 76646664 66666262 99901909 19999999
f6cb7ac0 4142579603 C Bi:003:01 0 0
f6cb7cc0 4142579723 C Bi:003:01 0 1024 = 99999999 99999999
6666646e 66466666 99919899 99199999 66666666 66646666
f6cb7bc0 4142579725 C Bi:003:01 0 832 = 99899999 99998999
66646266 64646646 99999999 99989919 62666666 66466666
f7452c40 4142580227 S Bi:003:01 -115 1024 <
f6cb7b40 4142580229 S Bi:003:01 -115 1024 <
f6cb7ac0 4142580231 S Bi:003:01 -115 1024 <
f6cb7cc0 4142580233 S Bi:003:01 -115 1024 <
f6cb7bc0 4142580235 S Bi:003:01 -115 1024 <
f524f240 4162584545 S Co:003:00 s 21 22 0000 0000 0000 0
f524f240 4162585480 C Co:003:00 0 0
f4ca7d40 4162585549 C Ii:003:02 -2 0

If you'd like the entire output (211 lines) I can send that
as well.

Thanks for the help.

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

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux