USBHost library. NOTE: This library is only officially supported on the LPC1768 platform. For more information, please see the handbook page.

Dependencies:   FATFileSystem mbed-rtos

Dependents:   BTstack WallbotWii SD to Flash Data Transfer USBHost-MSD_HelloWorld ... more

Issue: Some mouse models cause the USBHost library code to hang.

The example USBHostMouse program from the Handbook hangs after a few moments of mouse input from certain mouse models. This is repeatable for me with the following configuration: 1. I imported the USBHostMouse program into the online compiler from the handbook page: 2. I installed an mbed LPC1768 into an mbed Application Board and connected the LPC1768 to my PC via USB. 3. I setup a Realterm serial terminal to print debug output. 4. I deployed the application onto the LPC1768 and rebooted the board. 5. I plugged a DELL Mouse, Model: DZL-MS111-L(B), into the application board and noted that the USBHost library successfully detected the connection. 6. I began moving the mouse, after several callbacks (it varies every time depending on how fast I move the mouse, usually 1 - 15 callbacks) the board hangs and nothing further is printed to the serial terminal. If I reboot the board this repeats.

I corrected this by changing the while(!mouse.connect()) to while(true) and then I can receive mouse input indefinitely. However, the data is all corrupted, hopping erratically in the x and y directions. When I plug in a DELL Mouse, Model: XN966 everything works as expected, even with the while(!mouse.connect()) line in place.

One thing that I did notice was that the size of the transfer being reported by USBEndPoint.getLengthTransferred() method that is called in USBHostMouse.rxHandler() was consistently 6 bytes for the mouse that didn't work, and 4 bytes for the mouse that did work.