This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

USB IN Endpoint freeze after some time

Hello Guys,

I am working on USB CDC application. I am using Windows XP and usbser.sys driver at host side.
I am trying to run a loopback in which host initiated a write of 64K to USB device over BULK OUT Endpoint and then read it back over BULK IN Endpoint. This loop should be able to run indefinitely.

Now the problem is after some time, HOST stops sending IN token to device. hence device stop sending data over IN Endpoint.
There is no ERR or STALL messages are being sent by either device. HOST just stops sending IN token to device.

I am not seeing this problem for small packet size like 512 bytes, 1K bytes. For these packet size loopback runs for a long time.

Kindly help me if anyone has any clue. I have read so many forum but didn't get the clue for this issue.
Any help is highly appreciated.

Regards,
Gaurav

Parents
  • Hi Tsuneo,

    Thanks for your reply to the query.

    1) What is the RX buffer size on Windows CDC class driver?
    The size is set by SetupComm() (WinAPI) or SerialPort.ReadBufferSize (.NET).

    I have not used this function and settings are default only.

    2) Depending on Windows version (Win2K or older), you may need to insert ZLP (Zero-Length Packet) to bulk IN at every 4K bytes transfer.

    I am testing this on windows Xp and handling the received ZLP from Host to device. Also I am sending ZLP to host after completion of transfer. Just to add, ZLP handling is done only in case of transfer size equal to integral multiple of endpoint size.

    I think issue may be related to Rx buffer as you have mentioned.
    I have read your other posts and set Rx buffer as 65536 bytes using SetupComm. I ran the test case for 64K loopback, but it is still showing the same issue. Host stop sending IN packets to IN endpoint after some time.

    I am studying through this buffer usage.

    Please help me out.

    Best Regards,
    Gaurav

Reply
  • Hi Tsuneo,

    Thanks for your reply to the query.

    1) What is the RX buffer size on Windows CDC class driver?
    The size is set by SetupComm() (WinAPI) or SerialPort.ReadBufferSize (.NET).

    I have not used this function and settings are default only.

    2) Depending on Windows version (Win2K or older), you may need to insert ZLP (Zero-Length Packet) to bulk IN at every 4K bytes transfer.

    I am testing this on windows Xp and handling the received ZLP from Host to device. Also I am sending ZLP to host after completion of transfer. Just to add, ZLP handling is done only in case of transfer size equal to integral multiple of endpoint size.

    I think issue may be related to Rx buffer as you have mentioned.
    I have read your other posts and set Rx buffer as 65536 bytes using SetupComm. I ran the test case for 64K loopback, but it is still showing the same issue. Host stop sending IN packets to IN endpoint after some time.

    I am studying through this buffer usage.

    Please help me out.

    Best Regards,
    Gaurav

Children