|
From: Alan S. <st...@ro...> - 2012-11-14 16:22:59
|
On Wed, 14 Nov 2012, geo wrote: > @Alan Stern > >> I do not know the cause of close to 19 transfers per frame instead of close to 33 transfers / frame. > >> Is it possible that if I leave only 2 bulk endpoint 1in and 1out that I will get the full bandwidth on one endpoint ? > > >Do you use all four endpoints? From your description above, it sounds > >like you use only one of them. Endpoints that aren't used won't steal > >any bandwidth. > > 2 bulk endpoints + 1interrupt are used for a CDC console > 2 bulk endpoints are used for real time data, my problem is the direction from uC -> PC. > > > please see the descriptor below The descriptor doesn't matter; what matters is how the endpoints are used. If you use two endpoints at the same time then you can't possibly get the maximum theoretical bandwidth for both of them. But if you use them only one at a time then you can. > The endpoints are filled on the USB TX ISR with EP transfer re-enabled at the end of isr. > > Too bad I do not have access to an USB analyzer ... > I tried to measure the USB TX ISR length ... > Here is what I got with a logic analyzer and gpio debug ... > > 10.63us 10.63us > __________ __________ > | | | | > ^ | ^ | > | | | | > _______________| |_____________________________| |______ > | | > A B > > > figure looks good on plain editor ... sorry for the mess > > > 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 ... Remember that the packets sent to/from your device are not the only packets on the bus. Even if no other devices are attached and no other endpoints are in use, there will still be an SOF packet every millisecond. What about the interrupt-IN endpoint on interface 0? Does the host use it? At what point does the interrupt request occur? When the buffer is empty? Is that when you re-fill the buffer? The delay between packets can be less than 1 us, so if it takes more than a microsecond to refill the buffer, that may already be too long. > >From the figure looks like there is enough room for more transfers but in 1ms I only get > 16 or 17 transfers ( corresponding to 512kB/s or 544kB/s ) and this is correlated with the > average transfer of about 520kB/s that can be seen on host. The host controller might not be capable of running at the theoretical maximum speed. If that's the case, nothing you can do in software will help. Alan Stern |