#82 usb_bulk_read() timeout to read integral multiple of 512 byte data --> 45556

v1.2.x
open
nobody
1
2013-02-19
2012-07-22
No

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

Discussion

  • Xiaofan Chen

    Xiaofan Chen - 2012-07-22

    Re-created this ticket since spammers edited ticket 81 and I wrongly deleted it.

     
  • Xiaofan Chen

    Xiaofan Chen - 2013-02-19

    Most likely the device firmware has some issue with the ZLP (Zero Length Packet) Handling. Take note this is a bulk endpoint.

     
    Last edit: Xiaofan Chen 2013-02-19

Log in to post a comment.