Myonium wrote:
Thanks, Peter, please find below the first results from the “speed issue" analysis:
Good work.
1.) I contrasted the URB chunks received in “simtrace host” with the usbmon output. => There is a 100% match. No data is lost in the “simtrace host program”.
Ok.
2.) I increased and decreased the buffer size (rctx) of the firmware. => If there were bytes lost, than always between URB chunks. Decreasing the buffer size improved the situation a lot! Reducing the buffer size from 128B (default) to 32B almost eliminated the lost byte problem (1 of 5 failed). With a buffer size of 16B I never had a lost byte.
=> Conclusion: The send_rctx with a “large” buffer is so expensive, that we are loosing bytes while sending the chunk. It solved the problem for me, by setting the buffer to 16B. However any idea how we could lighten the send data process? Any other conclusions?
Your findings make sense.
I note that all data to be transmitted is copied byte for byte from the rctx data buffer into the USB peripheral memory. I had expected zero copy. During copying, interrupts are disabled.
Basically the USB "framework" would need to be rewritten specifically for zero copy operation, if the hardware actually allows that.
Meanwhile, going down to 16 or even 8 bytes per packet is fine IMO.
//Peter