Author Topic: Delayed EndOfTransfer Interrupt  (Read 8330 times)

mikyak

  • Member
  • ***
  • Posts: 9
Delayed EndOfTransfer Interrupt
« on: October 28, 2011, 11:38:40 am »
Hello!

Here is a SCSI mass bulk scenario.

0. We check that the endpoint is shown as an input endpoint according to its status register (as it should be based on the configuration).
1. In response to scsi_inquiry, the CBW data are sent, which is displayed as successful on the analyzer.
2. Now we would like to send the corresponding CSW status data as well.
To do this we wait for the EndOfTransfer interrupt but it does not happen.
3. At last the host resets the USB line, and the EndOfTransfer interrupt suddenly fires. However, now the endpoint
is shown as an output endpoint according to its status register.

If I try to send immediately after the CBW data are sent, by busy waiting for the usb data register to empty,
then I can also see that the endpoint is not shown as an input endpoint by its status register.
Also,sometimes the endpoint gets halted, according to the status register, after the CBW is sent.

What do you make of this fact that the direction of endpoint which is configured as input
suddenly changes in the status register  ?







Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: Delayed EndOfTransfer Interrupt
« Reply #1 on: October 28, 2011, 12:28:41 pm »
Each bulk endpoint has a direction that defines the direction of data in the data phase of transactions. An IN endpoint sends data to the host. An OUT endpoint receives data from the host.

Each bulk transaction has three phases. In the token phase, the host sends information to the endpoint. In the data phase, the host or device sends data depending on the endpoint's direction. In the handshake phase, the receiver of data in the data phase sends status information.

So after sending CBW data, the endpoint must accept the ACK sent by the host in the handshake phase. Is your endpoint doing that? If you're not seeing the ACK, verify that the endpoint is using the correct data toggle value.

Jan