Ports and Interfaces > USB

WinUsb_ReadPipe returning ERROR_SEM_TIMEOUT

(1/1)

juliang:
Hi,

I built a WinUSB driver, my driver works perfectly on Windows XP, but when running on Windows7 I got the error 121 when calling WinUsb_ReadPipe, by debugging my driver I notice that WinUsb_ReadPipe is returning the error code 121 but the buffer contains what it should contain, I it is reading from the pipe and putting the content on the buffer I passed but still the function is returning this error. I tried increasing the timeout time with WinUsb_SetPipePolicy function, but still I am getting the same error. Is there anything I need to configure on the pipe so the reading process does not fail?

Any input will be helpful.

Jan Axelson:
Read the comments here:

http://blogs.msdn.com/b/usbcoreblog/archive/2010/02/05/how-to-generate-and-view-a-winusb-debug-trace-log.aspx

Jan

juliang:
Hi Jan,

Thanks for your answer, I was able to solve the problem, I just needed to use the WinUSB_AbortPipe function when closing the device, it seems that a reading process was still running impeding to take a good reading next time I opened the device.

I have another issue, when I install my device, it is installed successfully; however, I can see on the device manager that my device keeps enumerating forever, any idea of why is my device doing that?

mdlayt:
I think you contradict yourself.  If it is installed successfully, it won't enumerate anymore (unless you have a tester running or something).

I would be quite surprised if you can communicate with it while this is happening.  Maybe it is something well after enumeration that is going wrong.

One scenario:  it works for a while, then crashes.  When it crashes it resets.  Then the microcontroller reset event causes it to disconnect itself from the bus.  So the whole scenario starts over.

Navigation

[0] Message Index

Go to full version