USB DMA socket to endpoint mapping

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

cross mob
WGT_4383351
Level 5
Level 5
First like received

In AN87216 examples,

CY_FX_CONSUMER_USB_SOCKET=CY_U3P_UIB_SOCKET_CONS_1 and CY_FX_PRODUCER_USB_SOCKET=CY_U3P_UIB_SOCKET_PROD_1 is used.

What decides how CY_U3P_UIB_SOCKET_... is mapped to endpoints in the firmware? Is there a static mappint relation? Where is the documentation about this?

1 Solution

Hello,

Your following understanding is correct on mapping of endpoint with the UIB socket.

CY_U3P_UIB_SOCKET_CONS_n : USB logical IN endpoint n

CY_U3P_UIB_SOCKET_PROD_n : USB logical OUT endpoint n

The descriptors will then decide which endpoints are associated with which interface. Also, your configuration of endpoints and mapping to sockets are proper in response 3. After configuration, you can use the sockets to configure corresponding DMA channel.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
5 Replies
WGT_4383351
Level 5
Level 5
First like received

Is it:

CY_U3P_UIB_SOCKET_CONS_n : USB logical IN endpoint n

CY_U3P_UIB_SOCKET_PROD_n : USB logical OUT endpoint n

Then other part of the firmware will decide which IN endpoint of which interface of which alternate setting will be mapped to logical IN endpoint n. The same for OUT endpoints.

Is that right?

0 Likes

How is USB logical IN/OUT endpoint n be mapped to a specific endpoint of a specific interface?

0 Likes
WGT_4383351
Level 5
Level 5
First like received

Is this done in the USB descripitor?

/* Standard super speed configuration descriptor */

const uint8_t CyFxUSBSSConfigDscr[] __attribute__ ((aligned (32))) =

{

//existing code in the slave example:

/* Configuration descriptor */

/* Interface descriptor */

    0x09,                           /* Descriptor size */

    CY_U3P_USB_INTRFC_DESCR,        /* Interface Descriptor type */

    0x00,                           /* Interface number */

    0x00,                           /* Alternate setting number */

    0x02,                           /* Number of end points */

    0xFF,                           /* Interface class */

    0x00,                           /* Interface sub class */

    0x00,                           /* Interface protocol code */

    0x00,                           /* Interface descriptor string index */

/* Endpoint descriptor for producer EP */

CY_FX_EP_PRODUCER=0x01

/* Super speed endpoint companion descriptor for producer EP */

/* Endpoint descriptor for consumer EP */

CY_FX_EP_CONSUMER=0x81

/* Super speed endpoint companion descriptor for producer EP */

//added code :add an interface with three endpoints

/* The second Interface descriptor */

    0x09,                           /* Descriptor size */

    CY_U3P_USB_INTRFC_DESCR,        /* Interface Descriptor type */

    0x00,                           /* Interface number */

    0x00,                           /* Alternate setting number */

   0x03,                           /* Number of end points */

    0xFF,                           /* Interface class */

    0x00,                           /* Interface sub class */

    0x00,                           /* Interface protocol code */

    0x00,                           /* Interface descriptor string index */

/* Endpoint descriptor for producer EP */

SECOND_PRODUCER_EP=0x02

/* Super speed endpoint companion descriptor for producer EP */

/* Endpoint descriptor for consumer EP */

SECOND_CONSUMER_EP=0x82

/* Super speed endpoint companion descriptor for producer EP */

/* Endpoint descriptor for consumer EP */

THIRD_CONSUMER_EP=0x83

/* Super speed endpoint companion descriptor for producer EP */

}

Will the above descriptor decide the mapping:

CY_FX_EP_PRODUCER : CY_U3P_UIB_SOCKET_PROD_1

CY_FX_EP_CONSUMER : CY_U3P_UIB_SOCKET_CONS_1

SECOND_PRODUCER_EP : CY_U3P_UIB_SOCKET_PROD_2

SECOND_CONSUMER_EP : CY_U3P_UIB_SOCKET_CONS_2

THIRD_CONSUMER_EP : CY_U3P_UIB_SOCKET_CONS_3

0 Likes
WGT_4383351
Level 5
Level 5
First like received

0x01,                           /* Interface number */

//added interface need modified interface number too

0 Likes

Hello,

Your following understanding is correct on mapping of endpoint with the UIB socket.

CY_U3P_UIB_SOCKET_CONS_n : USB logical IN endpoint n

CY_U3P_UIB_SOCKET_PROD_n : USB logical OUT endpoint n

The descriptors will then decide which endpoints are associated with which interface. Also, your configuration of endpoints and mapping to sockets are proper in response 3. After configuration, you can use the sockets to configure corresponding DMA channel.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes