Author Topic: WinUSB Read Pipe  (Read 207 times)

sudheerg_

  • Member
  • ***
  • Posts: 15
WinUSB Read Pipe
« on: January 12, 2017, 04:32:04 am »
Hi,

We are using WinUSB For reading from a custom device. When we connect to a laptop after running for some time the WinUSB ReadPipe function fails to read data from the device and the GetLastError reports the following value: 0x48F (ERROR_DEVICE_NOT_CONNECTED). But, if I had a look at device manager the device is populated there.

What is the best way to figure out what is going on. We are sending a lot of data over Bulk IN Endpoint around (614000 bytes for every 30mS).

Thank You for your time.

Best Regards,
GSR

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2518
    • Lakeview Research
Re: WinUSB Read Pipe
« Reply #1 on: January 12, 2017, 09:37:16 pm »
Best is if you can connect a hardware-based protocol analyzer and watch what happens when you try to read data.

It's likely that the device is failing to respond to IN token packets with data or NAK.

sudheerg_

  • Member
  • ***
  • Posts: 15
Re: WinUSB Read Pipe
« Reply #2 on: January 12, 2017, 11:13:27 pm »
Hi Jan,

Thank You for your reply and time.

I have Advisor T3, my understanding is it has a limitation of how much it can capture. I was not able to configure it to capture for infinite time.

Let me know if any one in this forum know how to configure it to capture for infinite duration. I have used spooled mode available in advisor T3, and I have sufficient hard disk space 700 GB, but the analyzer stops after capturing for some time.

Regards,
GSR

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 2518
    • Lakeview Research
Re: WinUSB Read Pipe
« Reply #3 on: January 13, 2017, 01:28:03 pm »
Not a pretty technique, but depending on how much time elapses before the fail and how much data you can store, you could stop and restart the analyzer periodically in hopes of catching the error.

Also probably not that useful, but you could try waiting until it fails, then start the analyzer and do another read. It's likely that the driver won't attempt anything on the bus, however.

Make sure your firmware is robust enough that the endpoint is always ready to either NAK or accept data.

If you can slow the transfers by adding delays and the problem goes away, that will tell you something.