|
From: Peter S. <pe...@st...> - 2012-11-14 10:24:11
|
Hi George, geo wrote: > >Are you careful to submit new requests as old ones complete? > >That is, do you make sure the request pipeline never empties out? > > Yes, in the rx callback ( cb_xfr ) I submit each time a new transfer, > 8/16Kbytes in size. I'm using sam3u_benchmark.c as starting example, > libusb async API Did you modify the example to submit multiple transfers, as the comment in the program says? http://git.libusb.org/?p=libusb.git;a=blob;f=examples/sam3u_benchmark.c#l108 /* NOTE: To reach maximum possible performance the program must * submit *multiple* transfers here, not just one. * * When only one transfer is submitted there is a gap in the bus * schedule from when the transfer completes until a new transfer * is submitted by the callback. This causes some jitter for * isochronous transfers and loss of throughput for bulk transfers. * * This is avoided by queueing multiple transfers in advance, so * that the host controller is always kept busy, and will schedule * more transfers on the bus while the callback is running for * transfers which have completed on the bus. */ > The USB TX ISR is always 10.63us, less than 20us ... > The distance between the rising edges ( distance between points A > and B in the figure ) is always one of these 3 values: 73us, 52us, > 113us > I do not understand the source of this variation ... If you didn't modify the example to submit multiple transfers then that's a good source of variation. > @Peter Stuge > >> with usb1.1 What microcontroller is it? > >Note that USB 1.1 is *NOT* the same thing as "a full speed device". > > >This is an amazingly common mistake. USB 2.0 devices may only do low > >speed or full speed. > > >In fact, I expect that this is the case for the vast majority of low > >and full speed USB peripherals found in todays microcontrollers. > > The device registers as usb full speed device on linux. > I can achieve 500kbytes/second , I do not think this is possible with > a low speed device. Correct. The device is full speed. My point is that "USB 2.0" does not automatically mean "high speed". Conversely, full speed and low speed does not automatically mean USB 1.1. They are distinct concepts. I think that your device is actually USB 2.0 compliant. It can be 2.0 compliant even though it is only full speed. > Below is the usb descriptor for this device : lsusb -vvv > > EP 3,4,10 are used for a CDC console > > EP 1,2 are used for data, EP 2 is the one used to get the data out of uC > > > Bus 002 Device 008: ID 1234:5678 > > Device Descriptor: > bLength 18 > bDescriptorType 1 > bcdUSB 1.10 I think this should be 2.0, but of course it depends on the actual microcontroller that you are using. Being a full speed device is not a good reason to set bcdUSB to 1.10. > bDeviceClass 2 I don't know if device class 2 allows to have multiple distinct interfaces. It may or it may not. Double check if you're not already sure. The alternative is to set bDeviceClass=0 and bInterfaceClass=2 in each interface descriptor. //Peter |