Re: Persistent stall in the Cypress FX2 FIFO



Hello !

Are you absolutely certain that the endpoint is STALLed ? STALL condition
usually means that the endpoint has received an invalid USB request. In this
case, and looking at the FX2 TRM, it might mean you're not serving the IBN
and PING requests sent by the host.

For example, the host sends you a BULK OUT packet with more data than you
can handle in one transfer. First, the DATA IN interrupt of the appropriate
endpoint is set, and you service it properly to receive the data and clear
the master interrupt (INT2IRQ) and the individual interrupt register. This
is all well and good, and is done precisely the same way for transfers which
are below the limit.
However, when more data is sent in while the buffer is still full (sending
more than 512 bytes), the firmware responds with a NAK signal to the host to
any further sends. This indicates that the endpoint cannot receive any more
data, and in USB 2.0 environment, it instructs the host to start sending
PING requests instead. A PING request is much like asking "are you ready yet
?", and is used instead of multiple NAK returns to conserve bandwidth.

In your scenario, it might be possible that after the NAK signal is sent
back to the host, you're not serving the PING/IBN interrupts generated by
the firmware. If you do not serve these interrupts (clear them), the
firmware most likely STALLs the endpoint to indicate that it has received a
request that was not served (i.e. an unsupported USB request). Since the
host is constantly sending the PING packet to you, and you're not serving
it, the endpoint stays STALLed for ever more, regardless of you clearing or
resetting the endpoint.

See the FX2 TRM for instructions on how to serve the PING interrupt (Chapter
8.6.3.1.). If this helps you solve the issue, post back to these boards to
indicate that it was the culprit. This indication helps others who're
wrestling with the same problem

Greetings,
Antti Keskinen


----- Original Message -----
From: "A.D." <stevenson@xxxxxxxxxxx>
Newsgroups: comp.arch.embedded
Sent: Sunday, November 20, 2005 6:28 PM
Subject: Persistent stall in the Cypress FX2 FIFO


> Hi all,
> I am using the Cypress FX2 to interface an FPGA to a PC via an
> USB2.0 link. The FX2 was configured to provide 4 bulk endpoints
> (+ synchronous FIFOs). Each bulk EP (2,4,6,8) is 512 byte long
> and is double buffered.
> All seems to work quite fine, but when a FIFO get full (i.e. the PC
> send more than 512 bytes) the EP does not take data any more,
> even if the FPGA empty the FIFO!
> The endpoint seems to be stalled, but the stall flag in the EPxCS
> register is cleared. I tryed also to reset the pipe or to send a Clear
> Feature message, but nothing succeed in unlocking this "stall"
> condition. What else should i try?!?
> Any help is highly appreciated!
> TIA
>
> A.D.


.



Relevant Pages

  • Re: USB Status Pipe Strategy
    ... I guess what concerns me is how fast the host may actually poll. ... the time specification that is put on an interrupt endpoint is ... You're right in that this could be done as a Bulk Endpoint. ... I could continuously send an URB from the ...
    (microsoft.public.development.device.drivers)
  • Re: USB problems
    ... > endpoint open.. ... The stall I'm referring to is a bit in the ISP1581 controller. ... and then sets the stall bit on the control endpoint for seemingly no good ... I have to set the NO_STRINGS quirk to stop FreeBSD from ignoring th ...
    (freebsd-current)
  • USBEHCI.SYS bug with high-bandwidth interrupt endpoints
    ... I was investigating USB 2.0 high-bandwidth interrupt ... three transactions per microframe with a maximum packet size of 1024 ... bytes in the endpoint descriptor. ...
    (microsoft.public.development.device.drivers)
  • Re: Iyonix USB: Bulk IN endpoints
    ... well with this sort of data on a bulk endpoint. ... I need to be able to initiate a request for a non-blocking input ... I looked at the documentation of the Simtec stack again today, ... embedded system and the number of bytes waiting to be transmitted from ...
    (comp.sys.acorn.programmer)
  • Re: Requesting for less than endpoint size in UsbBuildInterruptOrBulkTransferRequest
    ... If you KNOW that the device will send less data, you CAN request less that ... If the device sends more than your buffer size, ... the transfer fails, the endpoint is stalled. ... > client driver should issue a bulk request of at least endpoint size? ...
    (microsoft.public.development.device.drivers)