Hi,
In Mass storage class – ehci.c file has a function called WaitForTransferComplete. This has a forever loop for bug catch and it gets invoked by HCDControlTransfer. So far it never got stuck there except today. We would like to add a reasonable timeout without compromising the normal operation. What would be the reasonable timeout?
Thanks
Dear S S,
I was checking the example and this implementation was left blank.
This is depending of the implementation, in this example when using the commands to communicate with the device there's the next macro: MS_COMMAND_DATA_TIMEOUT_MS with the default value of 10000 ms.
Looking in other sources, the most common value is 5 seconds, so depending of your application you have a wide margin to implement this timeout.
Best Regards,
Alexis Andalon
Dear S S,
1-. Yes, you could try returning other status, only remember that the code will get stuck in the assert in the assert instrucction. Maybe after the timeout you could try a software reset or module reinitialization.
2.- It's important when a high speed stack is being used like USB or Ethernet that the storage is in a rapid access memory. That's why this buffers are being stored in the second section of SRAM
Let me know if this helps you.
Best Regards,
Alexis Andalon