mcuee/libusb-win32

Bug: usb_bulk_read() timeout to read integral multiple of 512 byte data --> 45556

mcuee opened this issue · 3 comments

mcuee commented

https://sourceforge.net/p/libusb-win32/bugs/82/

Updated: 2013-02-19 Created: 2012-07-22

When I control the USB device to commit a 512 Bytes package or 1024, 1536,2048,2560 ... (integral multiple of 512 byte), to 1MB Max.

Then use usb_bulk_read() to read the data:(i=1,2,3,4....)
1 Worked call: usb_bulk_read(m_usb_dev, USB_BULK_EP_IN, read_buffer, 512 * i, 500);
2 Time out call: usb_bulk_read(m_usb_dev, USB_BULK_EP_IN, read_buffer, 1024 * 1024, 500);

If usb device commit a 511 or 513 bytes package (not equal to 512, or integral multiple of 512 byte), these to usb_bulk_read() call all work fine.

testlibusb-win.exe output:
DLL version: 1.2.6.0
Driver version: 1.2.6.0

bus/device idVendor/idProduct
bus-0/\.\libusb0-0001--0x4077-0x1243 4077/1243
- Manufacturer : Hell LS
- Product : Hell LS
bLength: 18
bDescriptorType: 01h
bcdUSB: 0200h
bDeviceClass: 00h
bDeviceSubClass: 00h
bDeviceProtocol: 00h
bMaxPacketSize0: 40h
idVendor: 4707h
idProduct: 2143h
bcdDevice: 0000h
iManufacturer: 1
iProduct: 2
iSerialNumber: 0
bNumConfigurations: 1
wTotalLength: 32
bNumInterfaces: 1
bConfigurationValue: 1
iConfiguration: 0
bmAttributes: a0h
MaxPower: 50
bInterfaceNumber: 0
bAlternateSetting: 0
bNumEndpoints: 2
bInterfaceClass: 255
bInterfaceSubClass: 0
bInterfaceProtocol: 0
iInterface: 0
bEndpointAddress: 02h
bmAttributes: 02h
wMaxPacketSize: 64
bInterval: 0
bRefresh: 0
bSynchAddress: 0
bEndpointAddress: 86h
bmAttributes: 02h
wMaxPacketSize: 512
bInterval: 0
bRefresh: 0
bSynchAddress: 0
mcuee commented

Most likely this is a device problem and not libusb-win32 problem.

mcuee commented

libusb-win32 project is in a support only mode. Mailing list support is still provided, no changes to the codes and release.

mcuee commented

Close this for now.