|
From: Tim R. <ti...@pr...> - 2019-07-26 17:59:17
|
David Levy wrote: > The things that bugs me is that a buffer size of 0x4400 (so an even multiple of 512) will not work on the raspberry. And the device is sending data slowly (less than 1kb/sec) so we have time to read the buffer. > > lsusb -v return this if it can give any useful information: > > Endpoint Descriptor: > bLength 7 > bDescriptorType 5 > bEndpointAddress 0x81 EP 1 IN > bmAttributes 2 > Transfer Type Bulk > Synch Type None > Usage Type Data > wMaxPacketSize 0x0040 1x 64 bytes > bInterval 0 > Endpoint Descriptor: > bLength 7 > bDescriptorType 5 > bEndpointAddress 0x01 EP 1 OUT > bmAttributes 2 > Transfer Type Bulk > Synch Type None > Usage Type Data > wMaxPacketSize 0x0040 1x 64 bytes > bInterval 0 The fact that your max packet size is 64 means that you must have a full-speed device, not a high-speed device. That's fine, it just means that the "multiple of 512" thing I mentioned actually only needs to be "multiple of 64". Your description seemed to say that all of the returned packets were less than the full packet size. Is that true? If so, there's really no reason to have your buffer be so large. A transfer is completed as soon as there is a packet shorter than the max packet size. If they're all less than 64 bytes, then you can make the buffer 64 bytes. > And on the endpoint 1, I dont have any issue with another buffer of the same size(but the endpoint 1 doesnt stream any data, it just answers to requests). Well, endpoint 1 receives your requests, but the results have to appear somewhere else (endpoint 0x81?). An OUT endpoint can't return any data. All endpoints (except the control endpoint) are unidirectional. But if you send a buffer of 0x4000 bytes to an OUT endpoint, it's always going to send 0x4000 bytes, which will be 256 packets and is going to span many frames. I assume your writes are actually specifying the real length of the data you're sending. Right? -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |