|
From: Sumant O. <soe...@xs...> - 2021-02-12 15:36:08
|
Hi guys, I'm trying to communicate synchronously using libusb to a PICKit 3 (04d8:900a). The device has one configuration, with one interface and alt-interface. This interface has two interrupt endpoints (one in, one out) that I need to use. I notice the following behavior. After opening the device and detaching the dummy kernel driver, I set the configuration, claim the interface, and set the alt-interface. I can write to and then read from the endpoints, but when repeating a write followed by a read, I very frequently get a read timeout. I need to (essentially) close the device, unplug, and replug, to be able to read again (after writing). Note that I do check the current configuration first, to see if I need to set it. Clearing halt conditions doesn't help at all. However, when I on purpose don't set the configuration, don't claim the interface and don't set the alt-interface, I can write and read without any timeout issues, as often as I want. What's going on here? I've tried both libusb-compat and libusb-1.0 with the synchronous interface only, on linux. I'm mostly used to the old libusb (thus mostly using libusb-compat for now) since it worked for all my previous projects, and am only now looking a bit into libusb-1.0 to see if it would remedy the situation, without luck. Thanks, Sumant -- Sumant Oemrawsingh |