Create 4 dma channels with 2 address line

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
PeterY
Level 1
Level 1
5 sign-ins First reply posted First question asked

I want to implement two pairs of DMA. Based on the example slave fifosync, I have made the following extensions and created the corresponding DMA channel, but I can't see any endpoint

#define CY_FX_EP_PRODUCER_1               0x01    /* EP 1 OUT */
#define CY_FX_EP_PRODUCER_2               0x02    /* EP 2 OUT */

#define CY_FX_EP_CONSUMER_1               0x81    /* EP 1 IN */
#define CY_FX_EP_CONSUMER_2               0x82    /* EP 2 IN */
 
/* Producer socket used by the U-Port */
#define CY_FX_PRODUCER_1_USB_SOCKET     CY_U3P_UIB_SOCKET_PROD_0     /* USB Socket 1 is producer */
#define CY_FX_PRODUCER_2_USB_SOCKET     CY_U3P_UIB_SOCKET_PROD_1     /* USB Socket 2 is producer */

/* Consumer socket used by the U-Port */
#define CY_FX_CONSUMER_1_USB_SOCKET     CY_U3P_UIB_SOCKET_CONS_0    /* USB Socket 1 is consumer */
#define CY_FX_CONSUMER_2_USB_SOCKET     CY_U3P_UIB_SOCKET_CONS_1    /* USB Socket 2 is consumer */

/* Producer socket used by the P-Port */
#define CY_FX_PRODUCER_1_PPORT_SOCKET     CY_U3P_PIB_SOCKET_0     /* P-port Socket 1 is producer */
#define CY_FX_PRODUCER_2_PPORT_SOCKET     CY_U3P_PIB_SOCKET_1     /* P-port Socket 2 is producer */

/* Consumer socket used by the P-Port */
#define CY_FX_CONSUMER_1_PPORT_SOCKET     CY_U3P_PIB_SOCKET_2   /* P-port Socket 1 is CONSUMER */
#define CY_FX_CONSUMER_2_PPORT_SOCKET     CY_U3P_PIB_SOCKET_3   /* P-port Socket 2 is CONSUMER */
0 Likes
1 Solution
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

For the device to enumerate with 4 endpoints, the descriptors need to be modified. With the default setting, the device enumerates with 2 bulk endpoints only (one IN and one OUT). If this default behaviour is to be changed, then the descriptor file (cyfxslfifousbdscr.c) needs to be changed. Inside this file, the following needs to be changed:

1. The interface descriptor 

2. New endpoint descriptors needs to be added.

3. The "Length of this descriptor and all sub descriptors" field of configuration descriptors should be changed.

Please try this and let me know if you are still facing enumeration issues.

Also, a few examples for the mapping between USB sockets and USB endpoints are given below:

CY_U3P_UIB_SOCKET_PROD_1 will be mapped to OUT endpoint 1 (0x01).

CY_U3P_UIB_SOCKET_CONS_1 will be mapped to IN endpoint 1 (0x81).

So, if you need to use 0x01 and 0x02 as USB OUT endpoints, then the corresponding sockets will be CY_U3P_UIB_SOCKET_PROD_1 and CY_U3P_UIB_SOCKET_PROD_2 respectively. Similarly if 0x81 and 0x82 needs to be used as IN endpoints, then CY_U3P_UIB_SOCKET_CONS_1 and CY_U3P_UIB_SOCKET_CONS_2 will be the respective sockets.  CY_U3P_UIB_SOCKET_PROD_0 and  CY_U3P_UIB_SOCKET_CONS_0 are mapped to the control endpoint. Please do not use these sockets for your project. Please make this modification in your project.

Best Regards,
Jayakrishna

View solution in original post

6 Replies