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