From: Kevin G. <ele...@my...> - 2021-01-31 12:58:34
|
Hello, I am re-using a subject line from the mailing list archive, by user Marcin, in an attempt to append to that thread. https://sourceforge.net/p/pyusb/mailman/pyusb-users/thread/15e9538f-386f-a637-ce2b-5eea3d04bd76%40gmail.com/ I had a simlar issue recently with a simple test application which opened a device and sent some OUT packets (to 512 size endpoint) thus: ..open device.. for i in range(n): dev.write(2,bytearray(os.urandom(512)) ..close device.. On windows, this worked fine for any 'n' but on Linux only even 'n' worked correctly. For odd 'n' one packet was always dropped/stuck. As Marcin suggested, ending with dev.reset() seemed to flush this stuck packet and fixed the issue. But using reset in this way seems wrong. After opening the device calling dev.clear_halt(2) Seemed to fix the issue. Regards Kevin |