4 Replies Latest reply on Mar 31, 2020 10:04 PM by RashiV_61

    CPU as DMA port

    WGT_4383351

      Some reference Using FX3, what is required to use DMA fabric to link Parallel Port sockets to a CPU using MANUAL_IN and MANUAL_OUT operations?  and FX3 CPU to Parallel Port Socket DMA Operation-Manual Out/In

       

      How to connect CPU to PPort in the Master/Slave example?

       

      In the attachment in the above references, there is a GPIF designer project too, but GPIF setting has nothing to do with who will be connected to P Port, right? So can I just use existing GPIF designer projects for Master/Slave example and only modify the DMA initialization code in the Master/Slave firmware to swith one end of some DMA channel from U port to CPU port and keep another end as before?

        • 1. Re: CPU as DMA port
          WGT_4383351

          Are these the only modification need :

           

          for CPU to PPort:

           

          1. CyU3PDmaChannelCreate: CY_U3P_DMA_TYPE_AUTO -> CY_U3P_DMA_TYPE_MANUAL_OUT

           

          2. dmaCfg.prodSckId: CY_FX_PRODUCER_USB_SOCKET -> CY_U3P_CPU_SOCKET_PROD

              dmaCfg.consSckId: keep as before

           

          for PPort to CPU:

           

          1. CyU3PDmaChannelCreate: CY_U3P_DMA_TYPE_AUTO -> CY_U3P_DMA_TYPE_MANUAL_IN

           

          2. dmaCfg.consSckId: CY_FX_CONSUMER_USB_SOCKET -> CY_U3P_CPU_SOCKET_CONS

              dmaCfg.prodSckId: keep as before

           

          Then when and where to read/write data by CPU? In the attached project, no CPU read/write can be found, and there is no "AA" data as described in the reference

          • 3. Re: CPU as DMA port
            WGT_4383351

            "Then when and where to read/write data by CPU? In the attached project, no CPU read/write can be found, and there is no "AA" data as described in the reference"

             

            The answer is CyU3PDmaChannelGetBuffer and CyU3PDmaChannelCommitBuffer.

             

            Please focus on the reset of the question.

            • 4. Re: CPU as DMA port
              RashiV_61

              Hello,

               

              Then when and where to read/write data by CPU? In the attached project, no CPU read/write can be found, and there is no "AA" data as described in the reference

              >> Apart from the modifications you mentioned in previous response, buffers (with data) needs to be sent from CPU - PPORT. This is done by CyFxBulkSrcSinkFillInBuffers API in the reference (gpiftousb) project. In this API the buffer is filled with the pattern AA using this Macro

               

              #define CY_FX_BULKSRCSINK_PATTERN            (0xAA)

               

              after filling the buffer with AA , the buffer is comitted to P PORT / GPIF block

               

              manualout.PNG

               

              manualll.PNG

               

              Please confirm that you have added this to you firmware

               

              Regards,

              Rashi