2 Replies Latest reply on Nov 21, 2018 12:22 AM by user_374262161

    What binds the endpoint with DMA channels?


      I test and try to understand the code of slave FIFO application AN65974. I have a question: What binds the endpont with the created DMA channels? In the function "CyFxSlFifoApplnStart", endpoint is configured and two DMA channels are created. But I have not see any lines of codes that establishes the relationship between the configured endpoint and DMA channels. If I make a small modification on the value of CY_FX_EP_PRODUCER and CY_FX_EP_CONSUMER to 0x06 and 0x86, the communication becomes unsuccessful. This proves the original EP1 corresponds to the created DMA channels. I attach the AN65974 Firmware and hope to get the answer. Thank you.

        • 1. Re: What binds the endpoint with DMA channels?

          Hi Maverick!


          Each FX3 endpoint is asscoiated with a socket number.

          When you create a DMA channel, you will specify the Producer and Consumer sockets (dmaCfg.prodSckId, dmaCfg.consSckId) for that channel. For an endpoint, first you need to configure it using CyU3PSetEpConfig() API and then you can specify the corresponding endpoint socket number (defined in CyU3PDmaSocketId_t) while creating the DMA channel.

          That is why when you change the endpoint number in endpoint configuration, the communication stops.

          • 2. Re: What binds the endpoint with DMA channels?

            Thank you. I have further questions.

            dmaCfg.prodSckId and dmaCfg.consSckId are not ep_num. How do these values associate with each other?

            I guess UIB socket binds the ep_num, because in the application note. The two created DMA channel have UIB socket of 0x0401 and 0x0301. The lower byte is 0x01 which means the channels are created for endpoint1.

            Please give a remark on my understanding. Thank you.