When running the latest StarterWare we plugged in a older USB stick and the following sequence occurs in USBHCDPipeWrite function (usbhostenum.c):
- Entry USBHCDPipeWrite()
- ulRemainingBytes set to 0x1F.
- Enter ulRemainingBytes != 0 loop (line #928).
- USBEndpointStatus (line #1024) returns a USB_HOST_OUT_ERROR.
- g_sUSBHCD[ulIndex].USBOUTPipes[ulPipeIdx].eState = PIPE_ERROR (line #1037).
- StopTimer called (line #1053).
- g_sUSBHCD[ulIndex].USBOUTPipes[ulPipeIdx].eState == PIPE_ERROR (line #1100).
- USB_TIMEOUT_DISABLE!=g_sUSBHCD[ulIndex].USBHTimeOut.Value.slNonEP0 (line #1102).
- ulTimer is currently 0xBB8, skips over if(!ulTimer) line #1104.
- ulRemainingBytes < 64 (line #1140).
- ulByteToSend = ulRemainingBytes (0x1F), line #1142.
- Back to top of ulRemainingBytes != 0 loop (line #928).
- Repeat sequence forever.
So this particular USB stick is a problem for the USB drivers, but what is the proper fix for this?
- Should the ulTimer be cleared when the timer is stopped?
- Should there be an else statement off the if (!ulTimer) on line #1104 with a ulSize set to zero and then break;?
Thanks.