2 Replies Latest reply on May 11, 2012 6:53 AM by n.v.subbarao

    Transfer "Data Produced by CPU" and "Data in the SlaveFifo" via the Same Endpoint

    gary.sun

       I would like to transfer "Data Produced by CPU" and "Data in the SlaveFifo" via the same Endpoint (e.g. Bulk IN EP2)

         

      Is there any way to implement this?

         

       

         

      Any information about this would be appreciated.

         

      Gary

        • 1. Re: Transfer "Data Produced by CPU" and "Data in the SlaveFifo" via the Same Endpoint
          gary.sun

          I tried to modify cyfxbulklpmanmanytoone.

             

          However, It seems that you can create a DMA MultiChannel of "many UIB or PIB to one UIB"

             

          but you can NOT create a DMA MultiChannel of  "UIB or PIB + CPU to one UIB"

             

          Is it really a limitation? Or there is something wrong with my DMA channel configuration?

             

           

             

          Here is my code and results:

             

          CASE 1 - Create DMA MultiChannel Success: PIB + UIB to one UIB

             

              /* Create a DMA MANUAL_MANY_TO_ONE channel between

             

               * the producer and consumer sockets of the U port.

             

               * DMA size is set based on the USB speed. */

             

              dmaCfg_multi.size  = size;

             

              dmaCfg_multi.count = CY_FX_BULKLP_DMA_BUF_COUNT;

             

              dmaCfg_multi.validSckCount = 2;

             

              dmaCfg_multi.prodSckId[0] = CY_U3P_PIB_SOCKET_0;

             

              dmaCfg_multi.prodSckId[1] = CY_U3P_UIB_SOCKET_PROD_1;

             

              //dmaCfg_multi.prodSckId[1] = CY_U3P_CPU_SOCKET_PROD;

             

              dmaCfg_multi.consSckId[0] = CY_U3P_UIB_SOCKET_CONS_2;

             

              dmaCfg_multi.dmaMode = CY_U3P_DMA_MODE_BYTE;

             

              dmaCfg_multi.notification = CY_U3P_DMA_CB_PROD_EVENT;

             

              dmaCfg_multi.cb = CyFxBulkLpDmaCallback;

             

              dmaCfg_multi.prodHeader = 0;

             

              dmaCfg_multi.prodFooter = 0;

             

              dmaCfg_multi.consHeader = 0;

             

              dmaCfg_multi.prodAvailCount = 0;

             

           

             

              apiRetStatus = CyU3PDmaMultiChannelCreate (&glChHandleBulkLp,

             

                      CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE, &dmaCfg_multi);

             

           

             

           

             

          CASE 2 - Create DMA MultiChannel Fail: UIB + CPU to one UIB => Debug message: CyU3PDmaMultiChannelCreate failed, Error code = 64

             

              /* Create a DMA MANUAL_MANY_TO_ONE channel between

             

               * the producer and consumer sockets of the U port.

             

               * DMA size is set based on the USB speed. */

             

              dmaCfg_multi.size  = size;

             

              dmaCfg_multi.count = CY_FX_BULKLP_DMA_BUF_COUNT;

             

              dmaCfg_multi.validSckCount = 2;

             

              dmaCfg_multi.prodSckId[0] = CY_U3P_PIB_SOCKET_0;

             

              //dmaCfg_multi.prodSckId[1] = CY_U3P_UIB_SOCKET_PROD_1;

             

              dmaCfg_multi.prodSckId[1] = CY_U3P_CPU_SOCKET_PROD;

             

              dmaCfg_multi.consSckId[0] = CY_U3P_UIB_SOCKET_CONS_2;

             

              dmaCfg_multi.dmaMode = CY_U3P_DMA_MODE_BYTE;

             

              dmaCfg_multi.notification = CY_U3P_DMA_CB_PROD_EVENT;

             

              dmaCfg_multi.cb = CyFxBulkLpDmaCallback;

             

              dmaCfg_multi.prodHeader = 0;

             

              dmaCfg_multi.prodFooter = 0;

             

              dmaCfg_multi.consHeader = 0;

             

              dmaCfg_multi.prodAvailCount = 0;

             

           

             

              apiRetStatus = CyU3PDmaMultiChannelCreate (&glChHandleBulkLp,

             

                      CY_U3P_DMA_TYPE_MANUAL_MANY_TO_ONE, &dmaCfg_multi);

          • 2. Re: Transfer "Data Produced by CPU" and "Data in the SlaveFifo" via the Same Endpoint
            n.v.subbarao

            Hi Gary,

               

            In your project, you have configured Multi DMA channel in two ways

               

            In case 1 PIB + UIB producer sockets and in case 2 PIB + CPU producer sockets to one UIB consumer sockets. Are these configurations working?

               

            and have you ever tried two PIB producer sockets to one UIB consumer sockets?

               

            Thanks,

               

            Subbarao.