endpoint discriptor file

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

I would like to add the IN and OUT interrupt endpoints to the Slave FIFO example (C:\cypress\FX3 SDK\firmware\slavefifo\slfifosync). What should I modify in the descriptor file "cyfxslfifousbdscr.c" so that it contains both information about the slave fifo and IN and OUT interrupt endpoints.

   

Thanks,

   

Nazila

   

P.S. I attached the file that I have been using for the Interrupt endpoint descriptor example.

0 Likes
6 Replies
Anonymous
Not applicable

You've change

   

1. the Interface descriptor to reflect the number of endpoints.

   

2. Add the endpoint descriptors under the corresponding interface descriptor

   

3. Change the length of the Configuration descriptor to account for the length increase due to the addition of endpoint descriptors.

   

Regards,

   

Anand

0 Likes
Anonymous
Not applicable

Hii Anand,

   

I am trying to do the same I am trying to add an other out endpoint and also an other socket(consumer) in the syncslavefifo example I am having a problem in the configuration descriptor in the file (cyfxsfifousbdscr.c). may be the same error as u mentioned above how can I change the size can you give more information regarding it.

   

And if this changes are done will this example run.

   

 

   

 

   

Thanks in advance

0 Likes
Anonymous
Not applicable

Hi,

   

at the beginning of each configuration descriptor (FS, HS and SS) is the Configuration descriptor. Its size is in the always 0x09= 9 bytes long. Then you can see the descriptor type and then the "Length of this descriptor and all sub descriptors". In that length you have to add the amount of bytes you added with an additional endpoint descriptor. I have added a descriptor in the following example, see changes colored in red. The FS and HS descriptor have no companion descriptor so there you just have to add 7. Just compare the descriptor file in the slave fifo async example.

   

 

   

const uint8_t CyFxUSBSSConfigDscr[] __attribute__ ((aligned (32))) =
{
    /* Configuration descriptor */
    0x09,                           /* Descriptor size */
    CY_U3P_USB_CONFIG_DESCR,        /* Configuration descriptor type */
    (0x2C + 13),0x00,                      /* Length of this descriptor and all sub descriptors */
    0x01,                           /* Number of interfaces */
    0x01,                           /* Configuration number */
    0x00,                           /* COnfiguration string index */
    0x80,                           /* Config characteristics - Bus powered */
    0x32,                           /* Max power consumption of device (in 8mA unit) : 400mA */

    /* 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 */
    0x07,                           /* Descriptor size */
    CY_U3P_USB_ENDPNT_DESCR,        /* Endpoint descriptor type */
    CY_FX_EP_PRODUCER,              /* Endpoint address and description */
    CY_U3P_USB_EP_BULK,             /* Bulk endpoint type */
    0x00,0x04,                      /* Max packet size = 1024 bytes */
    0x00,                           /* Servicing interval for data transfers : 0 for bulk */

    /* Super speed endpoint companion descriptor for producer EP */
    0x06,                           /* Descriptor size */
    CY_U3P_SS_EP_COMPN_DESCR,       /* SS endpoint companion descriptor type */
    0x00,                           /* Max no. of packets in a burst : 0: burst 1 packet at a time */
    0x00,                           /* Max streams for bulk EP = 0 (No streams) */
    0x00,0x00,                      /* Service interval for the EP : 0 for bulk */

    /* Endpoint descriptor for consumer EP */
    0x07,                           /* Descriptor size */
    CY_U3P_USB_ENDPNT_DESCR,        /* Endpoint descriptor type */
    CY_FX_EP_CONSUMER,              /* Endpoint address and description */
    CY_U3P_USB_EP_BULK,             /* Bulk endpoint type */
    0x00,0x04,                      /* Max packet size = 1024 bytes */
    0x00,                           /* Servicing interval for data transfers : 0 for Bulk */

    /* Super speed endpoint companion descriptor for consumer EP */
    0x06,                           /* Descriptor size */
    CY_U3P_SS_EP_COMPN_DESCR,       /* SS endpoint companion descriptor type */
    0x00,                           /* Max no. of packets in a burst : 0: burst 1 packet at a time */
    0x00,                           /* Max streams for bulk EP = 0 (No streams) */
    0x00,0x00                       /* Service interval for the EP : 0 for bulk */

   

    /* Endpoint descriptor for consumer EP ADDITIONAL */
    0x07,                           /* Descriptor size */
    CY_U3P_USB_ENDPNT_DESCR,        /* Endpoint descriptor type */
    CY_FX_EP_CONSUMER_ADDITIONAL,              /* Endpoint address and description */
    CY_U3P_USB_EP_BULK,             /* Bulk endpoint type */
    0x00,0x04,                      /* Max packet size = 1024 bytes */
    0x00,                           /* Servicing interval for data transfers : 0 for Bulk */

    /* Super speed endpoint companion descriptor for consumer EP */
    0x06,                           /* Descriptor size */
    CY_U3P_SS_EP_COMPN_DESCR,       /* SS endpoint companion descriptor type */
    0x00,                           /* Max no. of packets in a burst : 0: burst 1 packet at a time */
    0x00,                           /* Max streams for bulk EP = 0 (No streams) */
    0x00,0x00                       /* Service interval for the EP : 0 for bulk */

};
 

   

regards,

   

lumpi

0 Likes
Anonymous
Not applicable

Hello Lumpi,

   

Very clear thanks for your time

   

regards

   

pruthvi raj

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello Guys,

   

I want 2 producer endpoints and 2 consumer endpoints. I have changed the endpoint descriptor file as suggested by you.

   

Please tell me if there are any more changes to be made.

0 Likes
Anonymous
Not applicable

The question continues while configuring endpoints and dma channel, should we create a endpoint configuration and Dma configuration for every endpoint used.

   

   

 

       

   

CyU3PEpConfig_t epCfg_1;CyU3PDmaChannelConfig_t dmaCfg_1;CyU3PEpConfig_t epCfg_2;CyU3PDmaChannelConfig_t dmaCfg_2;

0 Likes