cancel
Showing results for 
Search instead for 
Did you mean: 

USB Superspeed Peripherals

mili_3435776
New Contributor

Hi,

I want to generate a unique serial number for each my  cx3 device,I have set according to the instructions on the following pages,but i can not get the serial num from device instance path,is there any place should i change?

Adding serial number descriptor to FX3 firmware

Re: CX3 UVC-CDC - Identifying the CDC COM port

i have change code as follow:

1. set serial num to 0x03 in descripter:

const uint8_t CyCx3USB30DeviceDscr[] =

{

    0x12,                               /* Descriptor size */

    CY_U3P_USB_DEVICE_DESCR,            /* Device descriptor type */

    0x00, 0x03,                         /* USB 3.0 */

    0xEF,                               /* Device class */

    0x02,                               /* Device Sub-class */

    0x01,                               /* Device protocol */

    0x09,                               /* Maxpacket size for EP0 : 2^9 */

    0xB4, 0x04,                         /* Vendor ID */

    0xC3, 0x00,                         /* Product ID */

    0x00, 0x00,                         /* Device release number */

    0x01,                               /* Manufacture string index */

    0x02,                               /* Product string index */

    0x03,                               /* Serial number string index */

    0x01                                /* Number of configurations */

};

2.define serial num in firmware:

const uint8_t CyFxUSBSerialNumDesc [] =

{

    0x1A,                           /* Descriptor size */

    CY_U3P_USB_STRING_DESCR,        /* Device descriptor type */

    '0',0,'0',0,'0',0,'0',0,'0',0,'0',0,

    '0',0,'0',0,'0',0,'A',0,'A',0,'A',0,

    0,0,                            /* long word align */

};

3. set descriptor in firmware

    /* String descriptor 0 */

    status = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 0, (uint8_t *)CyCx3USBStringLangIDDscr);

    if (status != CY_U3P_SUCCESS)

    {

        CyU3PDebugPrint (4, "\n\rAppInit:Set_STRNG_Dscr0 Err = 0x%x", status);

        CyCx3AppErrorHandler(status);

    }

    /* String descriptor 1 */

    status = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 1, (uint8_t *)CyCx3USBManufactureDscr);

    if (status != CY_U3P_SUCCESS)

    {

        CyU3PDebugPrint (4, "\n\rAppInit:Set_STRNG_Dscr1 Err = 0x%x", status);

        CyCx3AppErrorHandler(status);

    }

    /* String descriptor 2 */

    status = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 2, (uint8_t *)CyCx3USBProductDscr);

    if (status != CY_U3P_SUCCESS)

    {

        CyU3PDebugPrint (4, "\n\rAppInit:Set_STRNG_Dscr2 Err = 0x%x", status);

        CyCx3AppErrorHandler(status);

    }

    status = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 3, (uint8_t *)CyFxUSBSerialNumDesc); //add this line

device.png

BR,

0 Likes
Reply
1 Solution
Hemanth
Moderator
Moderator

Hi,

I have tested using the following example:

C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxusbuart

My Serial Number Descriptor is as follows:

pastedImage_0.png

Using the above, below is the result:

pastedImage_1.png

You can see that the serial number is updated.

Please try with this example first.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
Reply
1 Reply
Hemanth
Moderator
Moderator

Hi,

I have tested using the following example:

C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples\cyfxusbuart

My Serial Number Descriptor is as follows:

pastedImage_0.png

Using the above, below is the result:

pastedImage_1.png

You can see that the serial number is updated.

Please try with this example first.

Regards,

Hemanth

Hemanth

View solution in original post

0 Likes
Reply