Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Sync slave FIFO dual EP issue

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Sync slave FIFO dual EP issue
Moderator:
RSKV

Post Reply
Follow this topic



Sync slave FIFO dual EP issue

joebreprivate posted on 30 Jul 2012 8:46 AM PST
Top Contributor
35 Forum Posts

Hi, I’m writing to the forum since I’m really confused about the association Thread-Socket for the GPIF sync FIFO interface. I used the Slave sync FIFO example (putting DMA channels on AUTO) as a starting point but I’m now unable to go ahead.

My needs are:

1)       EP1 working as IN and  OUT, transferring and reading data to and from the PPort using automatic DMA.

2)       I then need a second endpoint EP2 working too  as IN and OUT

EP1 is typically used to transfer big chunk of data and is accessed using async  data transfer (from the CyAPI point of view; not async GIPIF!) . This works perfectly and I’m able to send and receive data to/from the GPIF interface.

In this case your selection was:

 

#define CY_FX_EP_PRODUCER               0x01    /* EP 1 OUT */

#define CY_FX_EP_CONSUMER               0x81    /* EP 1 IN */

 

#define CY_FX_PRODUCER_USB_SOCKET    CY_U3P_UIB_SOCKET_PROD_1    /* USB Socket 1 is producer */

#define CY_FX_CONSUMER_USB_SOCKET    CY_U3P_UIB_SOCKET_CONS_1    /* USB Socket 1 is consumer */

 

#define CY_FX_PRODUCER_PPORT_SOCKET    CY_U3P_PIB_SOCKET_0    /* P-port Socket 0 is producer */

#define CY_FX_CONSUMER_PPORT_SOCKET    CY_U3P_PIB_SOCKET_3    /* P-port Socket 3 is consumer */

 

In your reference design you the set up the 2 DMA channels using :

 

    dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET;

    dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET;

    apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP, CY_U3P_DMA_TYPE_ AUTO, &dmaCfg);

..

 

For the USB 2 FX3 channel and

    dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET;

    dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET;

   apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU, CY_U3P_DMA_TYPE_ AUTO, &dmaCfg);

 

For the FX3 2 USB  DMA channel.

 

First question: how maps the USB socket number to the Endpoint number. Looking at your example I should use CY_U3P_UIB_SOCKET_PROD_1    and CY_U3P_UIB_SOCKET_CONS_1    for EP 1 and  CY_U3P_UIB_SOCKET_PROD_2    and CY_U3P_UIB_SOCKET_CONS_2 for EP2,…  is this correct ?

In order to set up a second    group of DMA channels I modified the above definition as following

 

#define CY_FX_EP_PRODUCER               0x01    /* EP 1 OUT */

#define CY_FX_EP_CONSUMER               0x81    /* EP 1 IN */

#define CY_FX_EP_PRODUCER_NEW      0x02    /* EP 2 OUT */

#define CY_FX_EP_CONSUMER_NEW     0x82    /* EP 1 IN */

 

#define CY_FX_PRODUCER_USB_SOCKET    CY_U3P_UIB_SOCKET_PROD_1    /* USB Socket 1 is producer */

#define CY_FX_CONSUMER_USB_SOCKET    CY_U3P_UIB_SOCKET_CONS_1    /* USB Socket 1 is consumer */

#define CY_FX_PRODUCER_USB_SOCKET_NEW    CY_U3P_UIB_SOCKET_PROD_2    /* USB Socket 2 is producer */

#define CY_FX_CONSUMER_USB_SOCKET_NEW   CY_U3P_UIB_SOCKET_CONS_2    /* USB Socket 2 is consumer */

 

#define CY_FX_PRODUCER_PPORT_SOCKET    CY_U3P_PIB_SOCKET_0    /* P-port Socket 0 is producer */

#define CY_FX_CONSUMER_PPORT_SOCKET    CY_U3P_PIB_SOCKET_3    /* P-port Socket 3 is consumer */

#define CY_FX_PRODUCER_PPORT_SOCKET_NEW    CY_U3P_PIB_SOCKET_1    /* P-port Socket 1 is producer */

#define CY_FX_CONSUMER_PPORT_SOCKET_NEW    CY_U3P_PIB_SOCKET_2    /* P-port Socket 2 is consumer */

 

I then copied your code to set up the 2 new DMA channels:

 

    dmaCfg.prodSckId = CY_FX_PRODUCER_USB_SOCKET_NEW;

    dmaCfg.consSckId = CY_FX_CONSUMER_PPORT_SOCKET_NEW;

    apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoUtoP_new, CY_U3P_DMA_TYPE_ AUTO, &dmaCfg_new);

..

 

For the USB 2 FX3 channel and

    dmaCfg.prodSckId = CY_FX_PRODUCER_PPORT_SOCKET_NEW;

    dmaCfg.consSckId = CY_FX_CONSUMER_USB_SOCKET_NEW;

   apiRetStatus = CyU3PDmaChannelCreate (&glChHandleSlFifoPtoU_new, CY_U3P_DMA_TYPE_M AUTO, &dmaCfg_new);

 

 

First question: is my socket mapping correct according to the description of what I need ?

If yes, EP1 works perfectly both IN and OUT, but EP2 simply doesn’t.  In none of the directions…

 

Do I’m missing something?  Any suggestion ?

 

Thanks in advance, Joel

 

P.S. I’m using a 2 bit addr 32 bit data sync GPIF slave fifo model (GPIF designer)

 

 




Re: Sync slave FIFO dual EP issue

joebreprivate posted on 30 Jul 2012 12:44 PM PST
Top Contributor
35 Forum Posts

Ah sorry, I completely forgot to mention what "doesn't work" means.

 

If I set addr = 2 (soket 2/thread 2 GPIF sel) and I write 4 bytes to EP2 usign CmdEndPtOut->XferData(…) I’m able to write 2 times an XferData to FX3 ( since I’ve set up a DMA channel with 2 buffers) but then at the next XferData the operation aborts on timeout. Monitoring FlagA (which has been assigned to current thread FIFO_full/empty functionality) it remains low ergo the DMA doesn’t transfers the received data to the PPort.

It seems somehow that the producer part in this case is working properly but there is something wrong on the DMA operation or on the egress part of the channel.

 

Any evident mistake ?

 

Thanks, Joel






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.