1 Reply Latest reply on Feb 11, 2020 8:52 PM by EktaN_26

    USBFS_LoadInEP ignores length argument?

    JoBr_1593366

      When using DMA with Automatic Buffer Management, USBFS_ReadOutEP is only called once to set up the DMA, and the length argument matters:

      The allocated buffer size and length parameter must be equal to endpoint maximum packet size.

       

      But with USBFS_LoadInEP, the first call is:

      Configure DMA. This is required only once, with parameter pData is not NULL.

       

      Then further calls are

      Initiate DMA transaction on demand, with the pData pointer is NULL.

       

      It seems like the length parameter is irrelevant to the first call, so should it just be NULL?  Looking inside USB_LoadInEP16, the length parameter only seems to be used if pData == NULL.  Yet Cypress example code uses the length of the buffer when called the first time...

        • 1. Re: USBFS_LoadInEP ignores length argument?
          EktaN_26

          Hello JoBr_1593366

           

          When using DMA with Automatic Buffer Management, the first time USBFS_LoadInEP() is called, it is used to setup the DMA . When this is done it does not make use of the length parameter passed.

          The second time USBFS_LoadInEP() is called, it is used to trigger the the DMA transaction. This time it makes use of the  length parameter.

           

          This has been done so that only one function could be used to perform two tasks.

           

          I tried passing NULL in place of the length parameter, the first time USBFS_LoadInEP() is called and everything seems to be working properly

           

          Best Regards

          Ekta