CyU3PDmaChannelCommitBuffer can't work

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

cross mob
user_1484456
Level 2
Level 2
25 sign-ins 10 replies posted 10 sign-ins

the USB3 vision example from the frum is combined with FX3 UVC camera design to bring about USB3 vision camera solution. the DMA channel glChHandleDCICmd and glChHandleDCIRsp are both initiated in routine CyFxUSB3VisionApplnInit,  glChHandleDCICmd  as input, glChHandleDCIRsp as output. I can get first U3V packet message from host, then give back the response message to host, but the host can't get the packet. I check up the method to send DMA packet, it succeeds.

apiRetStatus = CyU3PDmaChannelCommitBuffer(&glChHandleDCIRsp, (CCD.length+12), 0);

            if(apiRetStatus != CY_U3P_SUCCESS)

            {

            CyU3PDebugPrint(1,"\r\n CyU3PDmaChannelCommitBuffer failed for glChHandleDCIRsp, error = %x",apiRetStatus);

            CyFxAppErrorHandler(apiRetStatus);

            }

I test the USB3 vision example attched in the frum ticket(after some update the code), it can work with u3v meesages. why can't it work in my code? I create and configure them just as what to do in the u3v example.

    dmaChannelCfg.size           = 1024;

    dmaChannelCfg.count          = 2;           /* No buffers allocated. We will only use the SetupSend API. */

    dmaChannelCfg.prodSckId      = CY_U3P_CPU_SOCKET_PROD;

    dmaChannelCfg.consSckId      = CY_U3P_UIB_SOCKET_CONS_0 | (CY_FX_EP_DCI_RSP & 0x0F);

    dmaChannelCfg.prodAvailCount = 0;

    dmaChannelCfg.prodHeader     = 0;

    dmaChannelCfg.prodFooter     = 0;

    dmaChannelCfg.consHeader     = 0;

    dmaChannelCfg.dmaMode        = CY_U3P_DMA_MODE_BYTE;

    dmaChannelCfg.notification   = 0;

    dmaChannelCfg.cb             = NULL;

    apiRetStatus = CyU3PDmaChannelCreate (&glChHandleDCIRsp, CY_U3P_DMA_TYPE_MANUAL_OUT, &dmaChannelCfg);

    if (apiRetStatus != CY_U3P_SUCCESS)

    {

        CyU3PDebugPrint (4, "Debug Response channel create failed, Error code = %d\n", apiRetStatus);

        CyFxAppErrorHandler (apiRetStatus);

    }

    apiRetStatus = CyU3PDmaChannelSetXfer (&glChHandleDCIRsp, 0);

    if (apiRetStatus != CY_U3P_SUCCESS)

    {

        CyU3PDebugPrint (4, "Debug channel SetXfer failed, Error code = %d\n", apiRetStatus);

        CyFxAppErrorHandler (apiRetStatus);

    }

0 Likes
1 Reply
YashwantK_46
Moderator
Moderator
Moderator
100 solutions authored 50 solutions authored 50 likes received

Hello,

Can you please let me know if you have see "CyU3PDmaChannelCommitBuffer failed for glChHandleDCIRsp, error = %x" printed in the UART debug logs?
If yes, please share the error code that you see.

Can you please share the EpConfig structure for me to review?

Also, please let me know here the CyFxUSB3VisionApplnInit() is being called?

Regards,

Yashwant

0 Likes