You are here

User defined descriptors | Cypress Semiconductor

User defined descriptors

Summary: 3 Replies, Latest post by kineses on 27 Dec 2013 07:27 AM PST
Verified Answers: 0
Last post
Log in to post new comments.
HiZ's picture
28 posts


I have a PSoC Creator project with USBFS component. How can I use my own descriptors, with this project?



HIMA's picture
Cypress Employee
389 posts

 User can provide descriptor for the USBFS component. If you place a USBFS component you will get USBFS_descr.c. In this file you have section to provide user supplied descriptor. In that section you can add the statement

and then add your descriptor. Similar to the default descriptor you can give

and give the values inside.

TheThinker's picture
37 posts

 Let me elaborate more on what PSoCRulez was trying to say:

After you add the USBFS component to a project and you compile it. You will see the following in the USBFS_descr.c file


*  User supplied descriptors.  If you want to specify your own descriptors,

*  remove the comments around the define USER_SUPPLIED_DESCRIPTORS below and

*  add your descriptors.


/* `#START USER_DESCRIPTORS_DECLARATIONS` Place your declaration here */

/* `#END` */

So simply remove the above comments. Write the Code:


and then define all the descriptors - i.e. Device descriprtors, Configuration descriptors and String descriptors, HID descriptors.

But there is one very important thing. The whole code between #if !defined(USER_SUPPLIED_DESCRIPTORS) and #endif is no more defined. So you will have to:

1. Define all the descriptors that you will need, as none of these variables get defined.

2. Besides the descriptors there are many important LUTs - Look Up Tables that are defined after the descriptors. These LUTs are very crucial. They are being used by the APIs internally to get pointers to the descriptors when needed (eg: the setupcommand requires the LUT to point to the device descriptor).

You will require to define these LUTs as well.

Making the LUTs can be tedious and tricky.

It is better that you use the configuration window only to define the descriptors which will generate the proper LUT.

In case if you want to add something like an IAD (interface association descriptor), then generate the whole descriptors first, and then copy and paste them, do the changes here and there. You will not need any change in the LUTs in such a case and you can simply copy them.

Look once into the extra arrays in the end, other than the descriptors; you will understand my point.


user_107572780's picture
12 posts

Hi there,

I am trying to add my own descriptor too and got stuck there. This is the extra descriptor:


/* Standard Device Qualifier Descriptor */

const uint8 CyFxUSBDeviceQualDscr[10u] =
        0x0A,                           /* Descriptor Size */
        0x06,       /* Device Qualifier Descriptor Type */
        0x00,0x02,                      /* USB 2.0 */
        0x00,                           /* Device Class */
        0x00,                           /* Device Sub-class */
        0x00,                           /* Device protocol */
        0x40,                           /* Maxpacket size for EP0 : 64 bytes */
        0x01,                           /* Number of configurations */
        0x00                            /* Reserved */
// #endif


So my questions are, first of all is this code correct? Is the #endif important, should I un-comment it? Is there any way I can add the Device Qualifier Descriptor from the configuration window? If not do I need to add LUTs for this descriptor too, and how? Thanks a bunch. Looking forward for your replies.

Log in to post new comments.