3 Replies Latest reply on Jan 16, 2020 6:28 PM by FuBe_4381791

    What binds the endpoint with DMA channels?

    MaXi_1246331

      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?
            MaXi_1246331

            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.

             

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

              Seconded on this point, it's confusing....

               

              My application uses endpoints: 0x01, 0x02, 0x03 and 0x81, 0x82, 0x83. (0x00 as well but that's reserved)

               

              This would be (if my understanding is correct)

              CY_U3P_XXX_SOCKET_PROD_0 == 0x01

              CY_U3P_XXX_SOCKET_PROD_1 == 0x02

              CY_U3P_XXX_SOCKET_PROD_2 == 0x03

               

              And

               

              CY_U3P_XXX_SOCKET_CONS_0 == 0x81

              CY_U3P_XXX_SOCKET_CONS_1 == 0x82

              CY_U3P_XXX_SOCKET_CONS_2 == 0x83

               

              Where xxx is the type of socket, the 0x81, 0x82, 0x83 are outgoing to the computer, 0x01, 0x02 and 0x03 are incoming from the computer.

               

              The part that confuses me with this is the sample for HID mouse uses CY_U3P_UIB_SOCKET_CONS_1, for 0x81, does that mean lCY_U3P_UIB_SOCKET_CONS_0 is the reserved value for endpoint 0? So everything should be one value up?

               

              eg.

               

              CY_U3P_XXX_SOCKET_CONS_1 == 0x81

              CY_U3P_XXX_SOCKET_CONS_2 == 0x82

              CY_U3P_XXX_SOCKET_CONS_3 == 0x83

               

              Must the end points always use the value 0x8 for outgoing?

               

              Regards!

               

              Fujimi