|
From: Tim R. <ti...@pr...> - 2019-07-25 21:03:47
|
David Levy wrote: > > Thanks for the answer. Two more questions: > > * I dont have the issue on x86/x64 windows/linux, Is there a > difference with the ARM/Raspberry pi ? > * A buffer size of 0x3FFF (or anything below 0x4000) works on the > rasapberry even if its not a multiple of 512. Does the library > only use the highest multiple of 512 ? > It "works" in the sense that you haven't seen it crash yet. The library does not do anything with the buffer sizes (which is why my attempt to blame your problem on the buffer sizes is a bit lame). The problem happens deeper down. Let's say the device fills up most of the buffer so that there's only 100 bytes left in the buffer. The host controller will only schedule enough time in the frame for 100 bytes. If the device should decide to transfer 512 bytes, which it is allowed to do, it will step on the packets that were scheduled immediately after. That's a bus protocol violation called "babble". If your packet should happen to be scheduled at the very end of the frame, so that your device overwrites the frame boundary, it can actually cause the USB hub to shut down. -- Tim Roberts, ti...@pr... Providenza & Boekelheide, Inc. |