1 Reply Latest reply on Sep 24, 2012 9:43 PM by rama.sai.krishna.vakkantula

    gpif callback and zlp

    user_136061072

      Hello,

         

      is it possible to send a zero length packet from a gpif callback?

         

      i use a slavefifosync like design.

         

      I configured the the P to U Channel to CY_U3P_DMA_TYPE_MANUAL

         

      I do not use a U to P Channel.

         

      I tried it like this:

         

       

         

      void CyFxGpifCB (CyU3PGpifEventType event,uint8_t currentState)
      {
         if (event == CYU3P_GPIF_EVT_SM_INTERRUPT)
         {
             if (currentState == ZLP)
                {
                  CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
                  status = CyU3PDmaChannelCommitBuffer (&glChHandleSlFifoPtoU, 0, 0);    // send ZLP
                  if (status != CY_U3P_SUCCESS)
                    CyU3PDebugPrint (4, "CyU3PDmaChannelCommitBuffer GPIF CB failed, Error code = %x\n", status);
               }
          }
      }

      void CyFxSlFifoPtoUDmaCallback (CyU3PDmaChannel *chHandle,CyU3PDmaCbType_t  type,
                                      CyU3PDmaCBInput_t *input)
      {
          CyU3PReturnStatus_t status = CY_U3P_SUCCESS;
          if (type == CY_U3P_DMA_CB_PROD_EVENT)
          {
              if(input->buffer_p.count!=0)
              {
               status = CyU3PDmaChannelCommitBuffer (chHandle, input->buffer_p.count, 0);
              if (status != CY_U3P_SUCCESS)
                 CyU3PDebugPrint (4, "CyU3PDmaChannelCommitBuffer DMA CB failed, Error code = %d\n", status);
             
              }
          }
      }

         

      but i get the error code "CyU3PDmaChannelCommitBuffer GPIF CB failed, Error code = 0x47"

         

      Is there some other way ?

         

      best regards

         

      g.