- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The values, "dmaCfg.prodSckId and dmaCfg.consSckId" are 2 byte values, where the Most significant byte tells the IP Num and the Least significant byte tells the socket number.
Yes, CY_U3P_UIB_SOCKET_CONS_0 is the reserved value for endpoint 0, and the socket number are corresponding to the endpoint numbers, i.e.,
CY_U3P_XXX_SOCKET_CONS_1 == 0x81
CY_U3P_XXX_SOCKET_CONS_2 == 0x82
CY_U3P_XXX_SOCKET_CONS_3 == 0x83.
Yes, the IN endpoint always has 0x8. You could refer to the USB 3 spec, where its given that the most significant bit in the endpoint number shows the direction of the endpoint,
1 for IN and 0 for OUT.
Best Regards,
AliAsgar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
The values, "dmaCfg.prodSckId and dmaCfg.consSckId" are 2 byte values, where the Most significant byte tells the IP Num and the Least significant byte tells the socket number.
Yes, CY_U3P_UIB_SOCKET_CONS_0 is the reserved value for endpoint 0, and the socket number are corresponding to the endpoint numbers, i.e.,
CY_U3P_XXX_SOCKET_CONS_1 == 0x81
CY_U3P_XXX_SOCKET_CONS_2 == 0x82
CY_U3P_XXX_SOCKET_CONS_3 == 0x83.
Yes, the IN endpoint always has 0x8. You could refer to the USB 3 spec, where its given that the most significant bit in the endpoint number shows the direction of the endpoint,
1 for IN and 0 for OUT.
Best Regards,
AliAsgar