FX3 Short Length Packet

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

   

In my FX3 firmware I am using the CYU3P_USBEP_SLP_EVT Sort Length Packet event to determine the end of the USB transfer.

   

I am able to do so in USB SS but under USB High Speed the event is not generated and my firmware reports transfer failure.

   

My firmware also use the ZLP event. This event is generated in USB SS and USB High Speed.

   

I have tested with the Cypress Control Center tool as well as with my WinUSB interface. The data is transferred but the SLP event is not generated.

   

I have use the JTAG debugger of the SuperSpeed Explorer Kit and the following function are called :

   
        
  • USB High Speed     
            
    • ZLP - API Callback called from CyU3PUibEPEvtHandler (Line 1863)
    •       
    • SLP - The JTAG Break point is not reached - CyU3PUibEPEvtHandler (Line 1868)
    •      
  •     
  • USB Super Speed     
            
    • ZLP - API callback callbed from CyU3PUibProtEpIntrEvtHandler (line 2028 )
    •       
    • SLP - API callback callbed from CyU3PUibProtEpIntrEvtHandler (line 2031 )
    •      
  •    
   

Under USB High Speed, the SLP interrupt is enabled: DEV_EPO_CS=0x60344A00. The EP interrupt is enabled since I get the ZLP Event.

   

Regards,
Stan

0 Likes
6 Replies
Anonymous
Not applicable

Just to be clear, you are sure that your data is not a multiple of High speed EP max size? In SS, probably you have set the EP max to 1024, but in high speed it can be upto 512 for bulk. Please check if your data is not a multiple of this. What is your data size and EPmax settings of the device? 

0 Likes
Anonymous
Not applicable

Yes I am sure. I checked with the Cypress Control Center.

0 Likes
Anonymous
Not applicable

Hi,

   

My work around is to use the Producer Event of the DMA Channel from the USB EP and test is the buffer count is not multiple of the EP Max Pkt Size.

   

This works however this work around can prove unreliable as the DMA Channel is Auto Signal type : Producer socket event doesn't work in Auto Signal mode.

   

Further more, I am missing the CY_U3P_DMA_CB_PROD_EVENT when CyU3PDmaChannelSetXfer is used without CyU3PDmaChannelReset. CyU3PDmaChannelSetXfer does not even return an error !

   

All this to get a SLP notification which is supposed to be supported in hardware.

   

Regards,
Stan

0 Likes
Anonymous
Not applicable

When performing reset of the dma channel to receive the CY_U3P_DMA_CB_PROD_EVENT this causes the  CY_U3P_DMA_CB_XFER_CPLT notification to be missing at times. 

   

My code relies on the DMA channel state to schedule new operation.

   

When using the above workaround to received the CY_U3P_DMA_CB_PROD_EVENT notification. I have observed the DMA Channel state to fail reporting transfer completion in 97.2% of the time, i.e only 2.7% of the transfer completion are notified (out of 11815 transfers).

   

When not using the above workaround (dma channel is not reset prior CyU3PDmaChannelSetXfer ). I have observed the DMA Channel state to report transfer completion all the time (out of 10422 transfers).

   

Since I am using the workaround, my code reports error because it is not able to schedule a new operation due to the invalid DMA Channel State.

   

The above behavior of invalid DMA Channel State is under USB SS.

0 Likes
Anonymous
Not applicable

Hi Stan

   

What is the source of the data coming to the FX3. And what do you plan to do when you get a short packet? 

   

Are you using GPIF? If so, you need to identify the scenario of short packet and commit the short packet even with auto channel. If so, you can generate a interrupt to cpu at the same time to identify that short packet is recieved. 

0 Likes
Anonymous
Not applicable

The SLP is to detect the end of the transfer from the USB side. The GPIF transfer the data to another processor.

   

The SLP is part of the transfer handling system. If the USB send too little or too much data that it is supposed to for the GPIF to transfer an error will be detected and reported to the USB host via a STALL. The GPIF interface will be reset to recover for the potential dead lock that may occur.

   

Have you been able to confirm the issue ? I need to have a validation of the issue or perhaps I am missing something in that case what ?

0 Likes