3 Replies Latest reply on Jan 8, 2017 11:36 PM by nisa

    Slavefifo with multichannel DMA between GPIF and UIB IN EP

    eyal.niv

      Hi,

         

      I am trying to modify the 2bit addr slavefifo sync example to have a multi channel DMA with two GPIF producer sockets instead of a single channel DMA with one GPIF producer socket. The consumer socket is still the same (UIB socket 1).

         

      I have modified all the occurrences of glChHandleSlFifoPtoU to match the "CyU3PDmaMultiChannel" type and have the following configuration for the multi channel DMA:

         

          dmaCfgManyToOne.size  = DMA_BUF_SIZE*size; //increase buffer size for higher performance
          dmaCfgManyToOne.count = 1;//CY_FX_SLFIFO_DMA_BUF_COUNT_P_2_U; // increase buffer count for higher performance
          dmaCfgManyToOne.validSckCount = 2;
          dmaCfgManyToOne.prodSckId[0] = CY_FX_PRODUCER_PPORT_SOCKET0;
          dmaCfgManyToOne.prodSckId[1] = CY_FX_PRODUCER_PPORT_SOCKET1;
          dmaCfgManyToOne.consSckId[0] = CY_FX_CONSUMER_USB_SOCKET;
          dmaCfgManyToOne.consSckId[1] = 0;
          dmaCfgManyToOne.dmaMode = CY_U3P_DMA_MODE_BYTE;
          dmaCfgManyToOne.notification = 0;
          dmaCfgManyToOne.cb = NULL;
          dmaCfgManyToOne.prodHeader = 0;
          dmaCfgManyToOne.prodFooter = 0;
          dmaCfgManyToOne.consHeader = 0;
          dmaCfgManyToOne.prodAvailCount = 0;
          apiRetStatus = CyU3PDmaMultiChannelCreate (&glChHandleSlFifoPtoU,  CY_U3P_DMA_TYPE_AUTO_MANY_TO_ONE, &dmaCfgManyToOne);

         

      CyU3PDmaMultiChannelCreate() fails with "CY_U3P_ERROR_BAD_ARGUMENT". Any suggestions?

      As a side note, another single channel DMA between a UIB producer socket and a PIB consumer socket is created successfully before attempting to create the multi channel DMA.

         

      Also, the GPIF state machine was modified to indicate the current thread level in FLAG A & B instead of thread 0 level. An additional call to initialize the socket has been added:

         

         CyU3PGpifSocketConfigure (0,CY_U3P_PIB_SOCKET_1,6,CyFalse,1);

         

      I should also mention that I went through the Cypress SDK source code in "cyu3multichannel.c" and searched for all the conditions in CyU3PDmaMultiChannelCreate() that return this argument. Everything seems legit so I must be missing something.

         

      Thanks in advance,
      Eyal