Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > Is it possible to create dma channel between GPIF socket and Host mode Endpoint Socket?

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



Is it possible to create dma channel between GPIF socket and Host mode Endpoint Socket?
Moderator:
RSKV

Post Reply
Follow this topic



Is it possible to create dma channel between GPIF socket and Host mode Endpoint Socket?

kngom83 posted on 17 Dec 2012 7:23 PM PST

1 Forum Post

I use FX3 DVK on host mode.

When i create a dma channel between GPIF(P port) socket and CPU in MANUAL-IN,

(GPIF socket is Producer, CPU socket is Consumer)

a Callback routine is called.

 

but,

When i create a dma channel between GPIF(P port) socket and Host mode Endpoint(U-port) in MANUAL,

(GPIF socket is Producer, Endpoint socket is Consumer)

a Callback routine is not called.

 

   /* Add the IN endpoint. */
    CyU3PMemSet ((uint8_t *)&epCfg, 0, sizeof(epCfg));
    epCfg.type = CY_U3P_USB_EP_BULK;
    epCfg.mult = 1;
    epCfg.maxPktSize = glMscEpSize;
    epCfg.pollingRate = 0;
    /* Since DMA buffer sizes can only be multiple of 16 bytes and
     * also since this is an interrupt endpoint where the max data
     * packet size is same as the maxPktSize field, the fullPktSize
     * has to be a multiple of 16 bytes. */
    size = ((glMscEpSize + 0x0F) & ~0x0F);
    epCfg.fullPktSize = size;
    epCfg.isStreamMode = CyFalse;
 

    /* Add the OUT EP. */
    status = CyU3PUsbHostEpAdd (glMscOutEp, &epCfg);
    if (status != CY_U3P_SUCCESS)
    {
        goto enum_error;
    }

    /* Create a DMA channel for OUT EP. */
    CyU3PMemSet ((uint8_t *)&dmaCfg, 0, sizeof(dmaCfg));
    dmaCfg.size = glMscEpSize;
    dmaCfg.count = 2;  // 0;

    dmaCfg.prodHeader = 0;
    dmaCfg.prodFooter = 0;
    dmaCfg.consHeader = 0;
    dmaCfg.prodAvailCount = 0;

    dmaCfg.dmaMode = CY_U3P_DMA_MODE_BYTE;
    dmaCfg.notification = CY_U3P_DMA_CB_PROD_EVENT | CY_U3P_DMA_CB_CONS_EVENT;


    /* Create a DMA channel for OUT EP. */
    //dmaCfg.prodSckId = CY_U3P_CPU_SOCKET_PROD;
    dmaCfg.prodSckId = CY_U3P_PIB_SOCKET_5;
    dmaCfg.consSckId = (CyU3PDmaSocketId_t)(CY_U3P_UIB_SOCKET_CONS_0 + (0x0F & glMscOutEp));
    dmaCfg.cb = CyFxMassOutDmaCallback;

    status = CyU3PDmaChannelCreate (&glMscOutCh, CY_U3P_DMA_TYPE_MANUAL, &dmaCfg);
    if (status != CY_U3P_SUCCESS)
    {
        goto app_error;
    }

    /* Enable EP transfer. In stream mode, the transfer size should be zero. */
 status = CyU3PUsbHostEpSetXfer (glMscOutEp, CY_U3P_USB_HOST_EPXFER_NORMAL, 0);
 if (status != CY_U3P_SUCCESS)
 {
  goto app_error;
 }

    status = CyU3PDmaChannelSetXfer (&glMscOutCh, 0);
 if (status != CY_U3P_SUCCESS)
 {
  CyU3PDebugPrint (4, "[Error] CyU3PDmaChannelSetXfer(glMscOutCh) Failed, Error code = %d\n", status);
  goto app_error;
 }




Re: Is it possible to create dma channel between GPIF socket and Host mode Endpoint Socket?

RSKV posted on 15 Jan 2013 11:40 PM PST
Cypress Employee
655 Forum Posts

Hi,

Yes. It is possible to create a DMA channel between GPIF II sockets and Host mode endpoint socket.

Please create a tech support case with your project attached to it so that one of our engineer will help you in solving your problem.

Thanks,

sai krishna.






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.