LPC4357 High-Speed USB Device Bulk-IN transfers I/O error on Linux

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by kollesok on Tue Sep 16 08:59:15 MST 2014
  Hi everyone.
  While playing around with the USB High-Speed module on LPC4357 I came across a weird behavior of the Bulk-IN transfers on a few Linux machines. I use libusb-1.0 to measure a bandwidth of the Bulk pipes - the test is simple - I send 10MB of random data back and forth and measure how much time it takes.
  At first I ran the test on MacOSX using IOKit Framework as a USB front-end, everything worked perfectly, no errors, no timeouts. Then I switched to Linux with libusb-1.0, three ancient PCs passed the test just fine, but the two new ones showed some instability - from time to time Bulk IN transfers ended up with an error -71 (-EPROTO), which, according to the kernel documentation, means a) bitstuff error  b) no response packet received within the prescribed bus turn-around time c) unknown USB error; these errors show up rarely - 1-3 times per 1000 transfers.
  Both machines have the same motherboard: ASUSTeK COMPUTER INC. H87-PLUS - Intel® H87 chipset with USB-3.0 support.  At first I thought the problem was with the 'xhci' USB Host driver, for some systems it is still buggy, but then I turned off the XHCI support in BIOS and 'ehci' driver showed the same behavior.
  Another strange thing - when I use an external USB 2.0 Hub to connect the device to these Linux systems, everything works fine with both 'xhci' and 'ehci' drivers. 

  For LPC4357 I have written a custom Device Driver based on the LPCUSBLib, but the exact same thing happens with the MSC firmware example from the packet 'lpcopen_2_12_keil_iar_keil_mcb_4357' - I have rebuild that example a bit - changed the device class to '0xFF (vendor specific)' and removed all the MSC Bulk packets processing. Result is the same, so I don't think I have screwed up the LPC device driver, moreover MacOSX and there Linux PCs work just fine. 

  Has anyone come across this problem? It makes it impossible for me to deploy the device - it just wont work on some hosts for an unknown reason. I will appreciate any ideas how to deal with this. Thanks.