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

cross mob

FAQ on Operating Speeds of USB in FX3/CX3/FX3S/SD3/SD2 – KBA219491

FAQ on Operating Speeds of USB in FX3/CX3/FX3S/SD3/SD2 – KBA219491

Community-Team
Employee
Employee
50 questions asked 10 questions asked 5 questions asked

Version: *A

Author: KandlaguntaR_3

 

Translation - Japanese: USB 3.0アプリケーションでのみFX3を有効にする – KBA219491 - Community Translated (JA)

The FX3 family of peripheral controller support SuperSpeed, Hi-Speed, and Full-Speed transfers. Some designs may use the FX3 device in Full-Speed or Hi-speed or SuperSpeed alone. This KBA answers what changes need to be done in the firmware to operate the FX3 in Full-Speed or Hi-Speed or SuperSpeed alone.

1. How do you enable only the USB 3.0 (SuperSpeed) functionality in the FX3 device?

Answer: USB 3.0 consists of both SuperSpeed lines (SS_TX_P, SS_TX_M, SS_RX_P, and SS_RX_M) and Hi-Speed lines (DM and DP). Some designs may use the FX3 device in USB 3.0 mode alone; that is, only SuperSpeed lines are used by the FX3 and Hi-Speed lines are used by another controller. For example, Cypress USB 3.0 hub controllers, CYUSB3328 and CYUSB3326, have a SharedLinkfeature. This enables the USB 3.0 port to be split into an embedded SuperSpeed port and a standard USB 2.0 port. To connect the FX3 to the embedded USB 3.0 port, it should be programmed such that it operates only in USB 3.0 and does not fall back to USB 2.0. There can be other applications besides SharedLink where this may be useful. This question addresses the implementation of enabling only the SuperSpeed functionality in the FX3 application firmware.

The boot options for FX3 are documented in AN76405. When FX3 is configured for the USB boot option through PMODE [2:0] = Z11, it will appear as a Cypress USB bootloader device, which can be only operated in USB 2.0 mode. Because there is no D+/D- associated with the embedded SuperSpeed port, FX3 cannot be detected in the host. In this scenario, we cannot program the application firmware to the FX3 through USB. Therefore, it is mandatory to use other boot options instead of USB.

Be cautious when using the boot options: I2C boot with USB fallback and SPI boot with USB fallback. In these boot options, FX3 will appear as a USB 2.0 bootloader device in the following scenarios:

  • I2C or SPI address cycle or data cycle error
  • Invalid signature in FX3 firmware image
  • Invalid image type

After starting the USB device mode driver using the CyU3PUsbStart API function, registering the USB call back requests and USB descriptors with the USB driver, follow these steps in the application firmware to enable USB 3.0-only functionality in FX3.

  1. Disable the USB 2.0 connection using CyU3PUsbControlUsbSupport before calling the CyU3PConnectState API.
  2. Call CyU3PConnectState repeatedly to retry the USB 3.0 connection in case of failure.

Refer to the FX3 API Guide for more details about these APIs. The code snippet of the steps is as follows:

/*Disable the USB 2.0 connection*/
CyU3PUsbControlUsb2Support(CyFalse);
do
{
    /* Connect the USB Pins with super speed operation enabled. */
    apiRetStatus = CyU3PConnectState(CyTrue, CyTrue);
    if (apiRetStatus != CY_U3P_SUCCESS)
    {
        CyU3PDebugPrint (4, "USB Connect failed, Error code = %d\n", apiRetStatus);

    }

else
    {
         CyU3PDebugPrint (4, "USB Connect passed, Error code = %d\n", apiRetStatus);
    }
}while(apiRetStatus != CY_U3P_SUCCESS);

2. How do you enable USB 2.0 (Hi-Speed or Full-Speed) functionality in the FX3 device?

When you call CyU3PConnectState API function with both arguments as CyTrue, FX3 is set to establish a USB connection in SuperSpeed mode. If it fails to establish a SuperSpeed connection for three times, it will fall back to USB 2.0 mode. On a 2.0 connection, the device uses the highest speed that the host supports; and this will be Hi-Speed in most cases. If the host supports only Full-Speed mode, it will connect in Full-Speed mode. This is also applicable to the USB 2.0 versions of FX3 devices: FX2G2 (CYUSB2014) and SD2 (CYUSB2024 and CYUSB2025).

If you want only USB 2.0 mode, do the following in the firmware.

After starting the USB device mode driver using the CyU3PUsbStart API function, registering the USB call back requests and USB descriptors with the USB driver, disable the SuperSpeed operation using the CyU3PConnectState API function.

The code snippet is as follows:

                             /* Connect the USB Pins with super speed operation disabled. */

apiRetStatus = CyU3PConnectState(CyTrue, CyFalse);

        if (apiRetStatus != CY_U3P_SUCCESS)

        {

            CyU3PDebugPrint (4, "USB Connect failed, Error code = %d\n", apiRetStatus);

            CyFxAppErrorHandler(apiRetStatus);

        }

3. How do you enable only the USB Full-Speed functionality in the FX3 device?

The FX3 device in USB 2.0 mode uses the highest speed that the host supports; and this will be Hi-Speed in most cases. To set FX3 to establish only Full-Speed connection with a USB 2.0 or USB 3.0 supported host, do the following.

After starting the USB device mode driver using the CyU3PUsbStart API function, registering the USB call back requests, and USB descriptors with the USB driver, follow these steps in the application firmware.

  1. Enable the “Forced Full-Speed” operation using CyU3PUsbForceFullSpeed API function before calling the CyU3PConnectState API function.
  2. Disable the SuperSpeed operation using CyU3PConnectState.

 Refer to the FX3 API Guide for more details about these APIs. The code snippet of the steps is as follows:

           /* Enable the Forced Full Speed Operation */

           CyU3PUsbForceFullSpeed(CyTrue);

           /* Connect the USB Pins with super speed operation disabled. */

           apiRetStatus = CyU3PConnectState(CyTrue, CyFalse);

           if (apiRetStatus != CY_U3P_SUCCESS)

           {

             CyU3PDebugPrint (4, "USB Connect failed, Error code = %d\n", apiRetStatus);

             CyFxAppErrorHandler(apiRetStatus);

            }

0 Likes
1765 Views