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

USB superspeed peripherals Forum Discussions

Linda
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi, 

I am using CYUSB3KIT-003. I am using a custom made firmware, and I enumerate my device as a USB super speed device. When I use the control center to upload my img file, sometimes everything works fine. However, sometimes the device is not recognized (when I try to upload the firmware, the device disappears from control center and also is not recognized anymore  from 'device manager').

Any help?

I figure this may be an HW problem since sometimes everything works fine while sometimes it does not?

I cannot figure out what the problem is. 

Thank you

0 Likes
1 Solution
Ajeethkumar
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 10 likes received

Hi Linda,

In the main function, I could see the following lines in your project:

    CyU3PSysClockConfig_t clkCfg;

    clkCfg.setSysClk400 = CyTrue;

    /* Initialize the device */
    apiRetStatus = CyU3PDeviceInit (&clkCfg);

All the clock config parameters are not properly configured. For example, clkCfg.cpuClkDiv should be in the range of 2 - 16. So, Please refer to the CyU3PSysClockConfig_t definition and configure all the members of the structure properly before passing it to the CyU3PDeviceInit function.

I updated your code to the following and your code enumerated for me.

    CyU3PSysClockConfig_t clkCfg;

    clkCfg.clksrc=CY_U3P_SYS_CLK;
    clkCfg.setSysClk400 = CyTrue;
    clkCfg.cpuClkDiv = 2;
    clkCfg.dmaClkDiv = 2;
    clkCfg.mmioClkDiv = 2;
    clkCfg.useStandbyClk = CyFalse;


    /* Initialize the device */
    apiRetStatus = CyU3PDeviceInit (&clkCfg);

 

Thanks,
Ajeeth

View solution in original post

0 Likes
11 Replies
Ajeethkumar
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 10 likes received

Hi Linda,

Please answer the following:

1. Are you using USBBoot i.e., PMODE Jumper J4 is Closed?

2. Whether the device disappears or it is detected as an unknown device after?

3. Is your custom-made firmware have any enumeration issues?

4. Can you look at the Troubleshooting section in the Superspeed explorer Kit User guide?

5. Can you check if the USB connector is damaged?

6. Is the device enumerated properly after the Hardware reset?

Thanks,
Ajeeth

0 Likes

Hi Ajeeth, 

1. Yes, PMODE J4 is closed 

2. It disappears, I can't find it in 'device manager' too

3. No, when the process ends correctly the device is enumarated as  a USB SS device (Cypress FX3 USB StreamerExample Device). Enumeration is the same as another device which works completely fine. The only difference is that the other device is a CX3, while the one we are using now is an FX3. Should the enumeration of the device change then?

4. I couldn't find any useful info there 

5. We tried 2 different boards, 2 USB cables, 2 PCs - in all cases we have problems

6. Sometimes. It ALWAYS works correctly when I do the following steps:

Open PMODE J4. HW reset. Automatic boot of preset FW. Close PMODE J4. HW reset. Open Control Center and boot custom FW 

 

Any ideas?

Thanks,
Linda

0 Likes
Ajeethkumar
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 10 likes received

Hi Linda,

Can you please share the Steps to reproduce the issue?

Please share the *.img file of your custom application so that we can try to reproduce your issue here.

Please also share the USBTreeView XML report when the device is enumerated and disconnected states.

Thanks,
Ajeeth

0 Likes

Dear Ajeeth, 

Can you please share the Steps to reproduce the issue?

I just connect the board and the device is not recognized - sometimes it work, sometimes (when I unplug and plug again the USB cable ) it doesn't work.

Please find attached USBTreeView XML reports of disconnected states and correct enumeration, and the .img file.

 

Thank you, 

Linda

0 Likes
Ajeethkumar
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 10 likes received

Hi Linda,

I could see that FX3 is enumerated as "Cypress FX3 USB StreamerExample Device" and not as a bootloader device after connecting (Reset). Hence, PMODE is not a USB boot. Please check the PMODE jumper or the Jumper connectors.

Also, I could not see FX3 enumeration after downloading your custom firmware. Please check your custom firmware source if it has any problem in enumerating.

Thanks,
Ajeeth

0 Likes
Linda
Level 2
Level 2
10 replies posted 10 sign-ins 5 replies posted

Hi Ajeeth, 

I could see that FX3 is enumerated as "Cypress FX3 USB StreamerExample Device" and not as a bootloader device after connecting (Reset). Hence, PMODE is not a USB boot. Please check the PMODE jumper or the Jumper connectors 

I sent you 2 USBTreeView reports:

- one report when device is enumerated correctly when custom firmware works fine

- one report when, after uploading my firmware, the device is not recognized anymore

 

Also, I could not see FX3 enumeration after downloading your custom firmware. Please check your custom firmware source if it has any problem in enumerating. 

Did you follow the steps I explained at number 6 of last reply? (Open PMODE J4. HW reset. Automatic boot of preset FW. Close PMODE J4. HW reset. Open Control Center and boot custom FW ). If you perform these steps, you should be able to load my fw. 

Plus, which board did you use?

 

Thanks,
linda

0 Likes
Ajeethkumar
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 10 likes received

Hi Linda,

Yes, I followed your steps, but could not see your firmware enumerating. I used the same kit you are using(CYUSB3KIT-003). 

Please check your firmware for any issues before  USB enumeration.

Thanks,
Ajeeth

0 Likes

Hi Ajeeth,

Here my descriptors. Do you see any problem?

 

 

#define CY_FX_BOS_DSCR_TYPE             15
#define CY_FX_DEVICE_CAPB_DSCR_TYPE     16
#define CY_FX_SS_EP_COMPN_DSCR_TYPE     48

/* Device Capability Type Codes */
#define CY_FX_WIRELESS_USB_CAPB_TYPE    1
#define CY_FX_USB2_EXTN_CAPB_TYPE       2
#define CY_FX_SS_USB_CAPB_TYPE          3
#define CY_FX_CONTAINER_ID_CAPBD_TYPE   4


/* Standard Device Descriptor */

const uint8_t CyFxUSBDeviceDscr[] __attribute__ ((aligned (32)))=
{
	    0x12,                           /* Descriptor size */
	    CY_U3P_USB_DEVICE_DESCR,        /* Device descriptor type */
	    0x10,0x02,                      /* USB 2.10 */
	    0x00,                           /* Device class */
	    0x00,                           /* Device sub-class */
	    0x00,                           /* Device protocol */
	    0x40,                           /* Maxpacket size for EP0 : 64 bytes */
	    0xB4,0x04,                      /* Vendor ID */
	    0xF1,0x00,                      /* Product ID */
	    0x00,0x00,                      /* Device release number */
	    0x01,                           /* Manufacture string index */
	    0x02,                           /* Product string index */
	    0x00,                           /* Serial number string index */
	    0x01                            /* Number of configurations */
};
const uint8_t CyFxUSBDeviceDscrSS[] __attribute__ ((aligned (32))) =
{
	    0x12,                           /* Descriptor size */
	    CY_U3P_USB_DEVICE_DESCR,        /* Device descriptor type */
	    0x10,0x03,                      /* USB 3.0 */
	    0x00,                           /* Device class */
	    0x00,                           /* Device sub-class */
	    0x00,                           /* Device protocol */
	    0x09,                           /* Maxpacket size for EP0 : 2^9 */
	    0xB4,0x04,                      /* Vendor ID */
	    0xF1,0x00,                      /* Product ID */
	    0x00,0x00,                      /* Device release number */
	    0x01,                           /* Manufacture string index */
	    0x02,                           /* Product string index */
	    0x00,                           /* Serial number string index */
	    0x01                            /* Number of configurations */
};
/* Standard Device Qualifier Descriptor */
const uint8_t CyFxUSBDeviceQualDscr[] __attribute__ ((aligned (32))) =
{
    0x0A,                           /* Descriptor size */
    CY_U3P_USB_DEVQUAL_DESCR,       /* 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 */
};
/* Standard Full Speed Configuration Descriptor */
const uint8_t CyFxUSBFSConfigDscr[] __attribute__ ((aligned (32))) =
{
		/* Configuration descriptor */
		0x09,                           /* Descriptor size */
		CY_U3P_USB_CONFIG_DESCR,        /* Configuration descriptor type */
		0x19,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 2mA unit) : 100mA */

		/* Interface descriptor */
		0x09,                           /* Descriptor size */
		CY_U3P_USB_INTRFC_DESCR,        /* Interface descriptor type */
		0x00,                           /* Interface number */
		0x00,                           /* Alternate setting number */
		0x01,                           /* Number of endpoints */
		0xFF,                           /* Interface class */
		0x00,                           /* Interface sub class */
		0x00,                           /* Interface protocol code */
		0x00,                           /* Interface descriptor string index */

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

};
/* Standard High Speed Configuration Descriptor */
const uint8_t CyFxUSBHSConfigDscr[] __attribute__ ((aligned (32))) =
{

	/* Configuration descriptor */
	0x09,                           /* Descriptor size */
	CY_U3P_USB_CONFIG_DESCR,        /* Configuration descriptor type */
	0x19,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 2mA unit) : 100mA */

	/* Interface descriptor */
	0x09,                           /* Descriptor size */
	CY_U3P_USB_INTRFC_DESCR,        /* Interface Descriptor type */
	0x00,                           /* Interface number */
	0x00,                           /* Alternate setting number */
	0x01,                           /* Number of endpoints */
	0xFF,                           /* Interface class */
	0x00,                           /* Interface sub class */
	0x00,                           /* Interface protocol code */
	0x00,                           /* Interface descriptor string index */

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

};


const uint8_t CyFxUSBBOSDscr[] __attribute__ ((aligned (32))) =
{
    0x05,                           /* Descriptor size */
    CY_U3P_BOS_DESCR,               /* Device descriptor type */
    0x16,0x00,                      /* Length of this descriptor and all sub descriptors */
    0x02,                           /* Number of device capability descriptors */

    /* USB 2.0 extension */
    0x07,                           /* Descriptor size */
    CY_U3P_DEVICE_CAPB_DESCR,       /* Device capability type descriptor */
    CY_U3P_USB2_EXTN_CAPB_TYPE,     /* USB 2.0 extension capability type */
    0x02,0x00,0x00,0x00,            /* Supported device level features: LPM support  */

    /* SuperSpeed device capability */
    0x0A,                           /* Descriptor size */
    CY_U3P_DEVICE_CAPB_DESCR,       /* Device capability type descriptor */
    CY_U3P_SS_USB_CAPB_TYPE,        /* SuperSpeed device capability type */
    0x00,                           /* Supported device level features  */
    0x0E,0x00,                      /* Speeds supported by the device : SS, HS and FS */
    0x03,                           /* Functionality support */
    0x0A,                           /* U1 Device Exit latency */
    0xFF,0x07                       /* U2 Device Exit latency */
};

/* Super Speed Configuration Descriptor */
const uint8_t CyFxUSBSSConfigDscr[] __attribute__ ((aligned (32))) = {
		/* Configuration descriptor */
		0x09,                           /* Descriptor size */
		CY_U3P_USB_CONFIG_DESCR,        /* Configuration descriptor type */
		0x1F,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 */
		0x01,                           /* Number of end points */
		0xFF,                           /* Interface class */
		0x00,                           /* Interface sub class */
		0x00,                           /* Interface protocol code */
		0x00,                           /* Interface descriptor string index */

		/* Endpoint descriptor for consumer EP */
		0x07,                           /* Descriptor size */
		CY_U3P_USB_ENDPNT_DESCR,        /* Endpoint descriptor type */
		0x83,              				/* 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 */
		(16 - 1),    					/* Max no. of packets in a burst(0-15) - 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 */

};

/* Standard Language ID String Descriptor */
const uint8_t CyFxUSBStringLangIDDscr[] __attribute__ ((aligned (32))) =
    {
        0x04,                           /* Descriptor Size */
        CY_U3P_USB_STRING_DESCR,        /* Device Descriptor Type */
        0x09,0x04                       /* Language ID supported */
    };

/* Standard Manufacturer String Descriptor */
const uint8_t CyFxUSBManufactureDscr[] __attribute__ ((aligned (32))) =
    {
        0x10,                           /* Descriptor Size */
        CY_U3P_USB_STRING_DESCR,        /* Device Descriptor Type */
        'C',0x00,
        'y',0x00,
        'p',0x00,
        'r',0x00,
        'e',0x00,
        's',0x00,
        's',0x00
    };

/* Microsoft OS Descriptor. */
const uint8_t CyFxUsbOSDscr[] __attribute__ ((aligned (32))) =
{
    0x0E,
    CY_U3P_USB_STRING_DESCR,
    'O', 0x00,
    'S', 0x00,
    ' ', 0x00,
    'D', 0x00,
    'e', 0x00,
    's', 0x00,
    'c', 0x00
};

/* Standard Product String Descriptor */
const uint8_t CyFxUSBProductDscr[] __attribute__ ((aligned (32))) =
    {
        0x08,                           /* Descriptor Size */
        CY_U3P_USB_STRING_DESCR,        /* Device Descriptor Type */
        'F',0x00,
        'X',0x00,
        '3',0x00
    };

const uint8_t CyFxUsbDscrAlignBuffer[32] __attribute__ ((aligned (32)));

​

 

0 Likes
Ajeethkumar
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 10 likes received

Hi Linda,

As you mentioned your device is enumerating correctly at times, this won't be a Descriptor issue.

Your FW did not start enumerating i.e., no terminations were made in the USB data lines. If it is a descriptor problem, you will see a device in the device manager with failed enumeration.

If not confidential, can you share your custom firmware source?

Thanks,
Ajeeth

0 Likes

Dear Ajeet, 

 

here is my project  - let me know if you find any bugs

 

Thanks, 
Linda

0 Likes
Ajeethkumar
Moderator
Moderator
Moderator
250 sign-ins 50 solutions authored 10 likes received

Hi Linda,

In the main function, I could see the following lines in your project:

    CyU3PSysClockConfig_t clkCfg;

    clkCfg.setSysClk400 = CyTrue;

    /* Initialize the device */
    apiRetStatus = CyU3PDeviceInit (&clkCfg);

All the clock config parameters are not properly configured. For example, clkCfg.cpuClkDiv should be in the range of 2 - 16. So, Please refer to the CyU3PSysClockConfig_t definition and configure all the members of the structure properly before passing it to the CyU3PDeviceInit function.

I updated your code to the following and your code enumerated for me.

    CyU3PSysClockConfig_t clkCfg;

    clkCfg.clksrc=CY_U3P_SYS_CLK;
    clkCfg.setSysClk400 = CyTrue;
    clkCfg.cpuClkDiv = 2;
    clkCfg.dmaClkDiv = 2;
    clkCfg.mmioClkDiv = 2;
    clkCfg.useStandbyClk = CyFalse;


    /* Initialize the device */
    apiRetStatus = CyU3PDeviceInit (&clkCfg);

 

Thanks,
Ajeeth

0 Likes