From: Bhavik on
There is one more strange behaviour.
If I insert a USB 2.0 hub between my PC and the device, the
communication does not stop!
Can you explain why this happens?

Thanks,

Bhavik


On Feb 2, 1:59 pm, Bhavik <bhavik.pa...(a)gmail.com> wrote:
> Hello,
>
> It is not the case that the device does not respond at all.
> The device is responding with NAK for the IN request. But it misses to
> respond for once in a while.
> So the host increments its error counter till the 6 errors. and then
>
> The error code I am getting in my driver is: 0xC0000001
> (USBD_STATUS_CRC).
> I have tried to reset the pipe using URB_FUNCTION_RESET_PIPE.
>
> But this also responds with the error code 0xC0000001.
>
> Can you please tell me why this error is given?
>
> Regards,
>
> Bhavik
>
> On Feb 1, 12:49 am, Tim Roberts <t...(a)probo.com> wrote:
>
> > Bhavik <bhavik.pa...(a)gmail.com> wrote:
>
> > >I tried to see the activity on the USB bus using Ellisys USB protocol
> > >analyzer, and found one strange thing.
>
> > >I have a separate thread to read from my USB device, and the writing
> > >occurs from my main application thread.
> > >Now if I write something to my device before there are 6 incomplete
> > >transactions in the read, the read operation continues successfully.
>
> > >If my application stops writing to the device, the read continues till
> > >the time there are 6 consecutive incomplete transactions again.
>
> > >So it seems that if there is any successful transaction to the device,
> > >the Windows driver resets the error counter internally to 0.
>
> > >Can you give me some idea how to work around this problem?
>
> > Yes.  Fix your device so that it properly responds with a NAK when it has
> > no data to transfer.  That's the only way.  This is a hardware protocol
> > violation, and you won't be able to work around it with a mere software
> > driver.
> > --
> > Tim Roberts, t...(a)probo.com
> > Providenza & Boekelheide, Inc.

From: Tim Roberts on
Bhavik <bhavik.patel(a)gmail.com> wrote:
>
>It is not the case that the device does not respond at all.
>The device is responding with NAK for the IN request. But it misses to
>respond for once in a while.
>So the host increments its error counter till the 6 errors. and then
>
>The error code I am getting in my driver is: 0xC0000001
>(USBD_STATUS_CRC).

Where do you see this? If this is an NTSTATUS, it means
STATUS_UNSUCCESSFUL. You have to look at the status code within the URB to
get the USBD errors.

>I have tried to reset the pipe using URB_FUNCTION_RESET_PIPE.
>
>But this also responds with the error code 0xC0000001.
>
>Can you please tell me why this error is given?

I expect the host controller has shut down the port because of the protocol
violation.
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.
From: Tim Roberts on
Bhavik <bhavik.patel(a)gmail.com> wrote:
>
>There is one more strange behaviour.
>If I insert a USB 2.0 hub between my PC and the device, the
>communication does not stop!
>Can you explain why this happens?

Hubs affect the timing. Perhaps your device has a timing problem that is
only triggered when you are directly connected. Do the failures happen on
all computers?
--
Tim Roberts, timr(a)probo.com
Providenza & Boekelheide, Inc.
From: Bhavik on
Ok, I was doing a mistake in looking the error code.
Now I saw the error code in the URB, and it's different from the
NTSTATUS code.

When the OnReadCompletion routine in my driver is called by the IO
manager, the error code in the URB is 0xC0010000, and the NTSTATUS
code is 0xC0000120.
I guess the first one is the USBD_STATUS code for cancelled IRP
(please correct me if I am wrong).
I get this error code because my application calls CancelIo routine
because the read request has failed.

Now when I get a new read request in my driver, I first see if there
was any error in the previous transaction or not.
If there was an error, I try to reset the pipe which had an error.
But when I submit the URB to reset the pipe, I get the USBD error code
0xC0000005 (USBD_STATUS_DEV_NOT_RESPONDING).

Can you please let me what could be a possible solution if I have this
error?

Thanks for helping.

Bhavik



On Feb 3, 3:35 am, Tim Roberts <t...(a)probo.com> wrote:
> Bhavik <bhavik.pa...(a)gmail.com> wrote:
>
> >It is not the case that the device does not respond at all.
> >The device is responding with NAK for the IN request. But it misses to
> >respond for once in a while.
> >So the host increments its error counter till the 6 errors. and then
>
> >The error code I am getting in my driver is: 0xC0000001
> >(USBD_STATUS_CRC).
>
> Where do you see this?  If this is an NTSTATUS, it means
> STATUS_UNSUCCESSFUL.  You have to look at the status code within the URB to
> get the USBD errors.
>
> >I have tried to reset the pipe using URB_FUNCTION_RESET_PIPE.
>
> >But this also responds with the error code 0xC0000001.
>
> >Can you please tell me why this error is given?
>
> I expect the host controller has shut down the port because of the protocol
> violation.
> --
> Tim Roberts, t...(a)probo.com
> Providenza & Boekelheide, Inc.

From: Bhavik on
In my previous post I mentioned that the the URB status code for
resetting the pipe is USBD_STATUS_DEV_NOT_RESPONDING.
But when I submit a write request from my application, the data is
written successfully though. I can see the completed transactions in
the Ellisys USB analyzer.
If the OUT transactions are completed successfully, then how can the
IN request return USBD_STATUS_DEV_NOT_RESPONDING at the same time?

Does this error code mean that the device is not responding to any
request or it means that the device does not respond to only specific
requests?

Thanks

Bhavik

On Feb 3, 12:09 pm, Bhavik <bhavik.pa...(a)gmail.com> wrote:
> Ok, I was doing a mistake in looking the error code.
> Now I saw the error code in the URB, and it's different from the
> NTSTATUS code.
>
> When the OnReadCompletion routine in my driver is called by the IO
> manager, the error code in the URB is 0xC0010000, and the NTSTATUS
> code is 0xC0000120.
> I guess the first one is the USBD_STATUS code for cancelled IRP
> (please correct me if I am wrong).
> I get this error code because my application calls CancelIo routine
> because the read request has failed.
>
> Now when I get a new read request in my driver, I first see if there
> was any error in the previous transaction or not.
> If there was an error, I try to reset the pipe which had an error.
> But when I submit the URB to reset the pipe, I get the USBD error code
> 0xC0000005 (USBD_STATUS_DEV_NOT_RESPONDING).
>
> Can you please let me what could be a possible solution if I have this
> error?
>
> Thanks for helping.
>
> Bhavik
>
> On Feb 3, 3:35 am, Tim Roberts <t...(a)probo.com> wrote:
>
> > Bhavik <bhavik.pa...(a)gmail.com> wrote:
>
> > >It is not the case that the device does not respond at all.
> > >The device is responding with NAK for the IN request. But it misses to
> > >respond for once in a while.
> > >So the host increments its error counter till the 6 errors. and then
>
> > >The error code I am getting in my driver is: 0xC0000001
> > >(USBD_STATUS_CRC).
>
> > Where do you see this?  If this is an NTSTATUS, it means
> > STATUS_UNSUCCESSFUL.  You have to look at the status code within the URB to
> > get the USBD errors.
>
> > >I have tried to reset the pipe using URB_FUNCTION_RESET_PIPE.
>
> > >But this also responds with the error code 0xC0000001.
>
> > >Can you please tell me why this error is given?
>
> > I expect the host controller has shut down the port because of the protocol
> > violation.
> > --
> > Tim Roberts, t...(a)probo.com
> > Providenza & Boekelheide, Inc.