There is one more field in the descriptors that is "Serial Number String Descriptors". In CyFxUSB30DeviceDscr structure make the Serial Number String descriptor index to 0X03. Also add the serial number string descriptor at the end of "dscr.c" file.
Don't forget to register this descriptor in "AppInit" function. To add please use of "CyU3PUsbSetDesc" API.
For example it is already used to set the product descriptor:
apiRetStatus = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 2,
(uint8_t *) CyFxUSBProductDscr);
You can add String descriptor as:
apiRetStatus = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 3,
(uint8_t *) CyFxUSBSerialDscr);
Thanks & Regards
Could you please tell me how you can read this info using python.
I tried using the serial.tools.list_ports.comports() property in python and printed the parameter serial_number, but it gave the result as '6'. But the description of it mentioned the 'serial_number' to be a string.
Are you able to get the serial number in Control Center window? See the attached snip of control center window.
Serial Number = "FX3"
If not then you have to follow the following steps to add it properly in the firmware:
1. Add the following piece of code in descr.c file.
/* Standard Serial string descriptor */
const uint8_t CyFxUSBSerialDscr __attribute__ ((aligned (32))) =
0x08, /* Descriptor size */
CY_U3P_USB_STRING_DESCR, /* Device descriptor type */
2. Add "extern const uint8_t CyFxUSBSerialDscr;" in Cyfxbulksrcsink.h file.(I am taking bulksrcsink example, you can choose your's).
3. Add the following line in "CyFxBulkSrcSinkApplnInit (void)" function before DMA buffer allocation for USB event logs:
/* String descriptor 3 */
apiRetStatus = CyU3PUsbSetDesc(CY_U3P_USB_SET_STRING_DESCR, 3, (uint8_t *)CyFxUSBSerialDscr);
if (apiRetStatus != CY_U3P_SUCCESS)
CyU3PDebugPrint (4, "USB set string descriptor failed, Error code = %d\n", apiRetStatus);
Then check it in control center. You will get "FX3" in String Descriptor section as shown in attached image.
Same procedure you can follow for CX3.
I can't comment about Python libraries. I haven't use it for CX3.
Thanks & Regards
Serialnumber.JPG 25.9 K
Thanks for the solution.
It worked for me.
I couldn't see the serial number in the control center but i could see it in the Device manager -> Details -> Property - Parent.
Also in linux when you read the descriptor that string is shown.