FX3 USB2 enumeration fails when TUSB501 re-drivers are connected

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

cross mob
SvLa_874621
Level 1
Level 1

Hi,

we use USB3 re-drivers in our hardware setup to improve the overall signal quality on the USB3 links.
This works fine for USB3 but in case if we connect the host PC over a USB2 cable then the enumeration fails.

Our hardware setup is as following:

[Host PC] - [USB2 cable] - [TUSB501 USB3 re-drivers (RX,TX)] - [USB3 cable] - [FX3]

From firmware debug we can see that all USB related API functions (CyU3PUsbStart, CyU3PUsbSetDesc, CyU3PConnectState)

return success but the at the end no SETCONF or RESET event is detected.

After studying the FX3 TRM and TUSB501 datasheets (see below) we assume that the USB3 re-driver on the RX side (seen from FX3)

makes problems when the FX3 tries to detect the USB interface speed. The re-driver detects the FX3 RX receiver and enables

the terminations and output. On the other hand the FX3 turns on the USB3 PHY and starts the 3.0 receiver detection (2).

We assume that the USB3 receiver is always detected since re-drivers are active all the time. For that reason it waits forever on

USB3 enumeration packets and does not fallback to USB2.

We have the following questions:

1.) Is it possible that the USB2 enumeration is blocked because of our assumptions?

2.) Is a timeout implemented in the FX3 firmware to switch back to USB2 when 3.0 receiver is present but no enumeration USB3 happens

3.) Is there a possible FX3 firmware change to fix this issue? 

Thanks,

Sven

From TUSB501 datasheet:

After power up, the TUSB501 periodically performs receiver detection on the TX pair. If it detects a SuperSpeed USB receiver,

RX termination becomes enabled, and the TUSB501 is ready to redrive.

The FX3 TRM lists a procedure that is used by the FX3 firmware for USB connection negotiation:

1. Wait for a valid VBus voltage (GCTL_IOPWR interrupt).

2. Turn on the USB 3.0 PHY to start 3.0 receiver detection.

a. If receiver detection succeeds, the LNK_LTSSM_CONNECT interrupt will be received. If this interrupt is received, the

device will proceed with enumeration in USB 3.0 mode.

3. If receiver detection fails, the LNK_LTSSM_DISCONNECT interrupt will be received. If this interrupt is received:

a. Turn off USB 3.0 PHY and turn on USB 2.0 PHY.

b. A USB 2.0 bus reset will be received as part of USB 2.0 connection startup.

c. The 3.0 PHY should be re-enabled on receiving the URESET interrupt that is triggered on a 2.0 bus reset. Both the 2.0

and 3.0 PHYs will be active at this time.

d. If the 3.0 receiver detection succeeds (LNK_LTSSM_CONNECT):

i.Turn off the USB 2.0 PHY.

ii.Proceed with enumeration as a USB 3.0 device.

e. If the 3.0 receiver detection fails (LNK_LTSSM_DISCONNECT):

i.Turn off the USB 3.0 PHY.

ii.Check number of times that 3.0 receiver detection has failed. If this count is greater than 3:

4. Proceed with enumeration as a USB 2.0 device.

5. There is no need to attempt 3.0 enumeration on any further bus resets.

0 Likes
1 Solution

Hello,

Please try the following and let us know if it helps:

1. Declare a timer structure. Refer to page 360 of FX3 API guide to understand about Timer structure.

2. Create a Timer using the API CyU3PTimerCreate(). Refer to page 392 of FX3 API guide to understand about this API and the parameters that needs to be passes into it. This API can be called immediately after calling the API CyU3PConnectState(CyTrue, CyTrue) for USB3 enumeration. The last parameter of the API CyU3PTimerCreate() can be set to CYU3P_AUTO_ACTIVATE to start the timer immediately. If this is not used, then the timer needs to be started by using the API CyU3PTimerStart(). More information on CyU3PTimerStart() can be found in page 394 of FX3 API guide.

3. Check if SETCONF event is received before the timer hits. If the SETCONF event is received, then stop the timer using the API CyU3PTimerStop(). The information on this API can also be found in page 394 of FX3 API Guide.

4. If the SETCONF event is not received before the timer hits, then the callback function that was provided while calling the API CyU3PTimerCreate() will be executed. Inside this callback function, you need to do the following:

a. Disable the USB connection by using the API CyU3PConnectState(CyFalse, CyTrue);.

b. Provide a small delay by using the API CyU3PThreadSleep (100);

c. Attempt for USB2 enumeration by using the API CyU3PConnectState (CyTrue, CyFalse);.

d. Stop the timer using the API CyU3PTimerStop();

Please refer to the firmware that comes along with AN75779 if you face any difficulties while implementing timer operations. The link to the same is given below:

https://www.cypress.com/documentation/application-notes/an75779-how-implement-image-sensor-interface...

Also, the default value of one timer tick is 1ms. Please set sufficient timeout while creating the timer to ensure that USB3 enumeration happens without any issues.

Please try this and let us know if it solves the issue or not.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna

View solution in original post

0 Likes
5 Replies
JayakrishnaT_76
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

Hello,

Please find my comments on your questions below:

1. Yes, your assumption could be the reason for the USB2 enumeration to be blocked. Please let us know the following so that we can confirm this:

a. If your custom board has USB boot option, then please configure the PMODE pins for USB boot. Then, for the below setup, please let us know if the device is coming up as USB Bootloader device in control center.

[Host PC] - [USB2 cable] - [TUSB501 USB3 re-drivers (RX,TX)] - [USB3 cable] - [FX3]

As you may know, the FX3 USB Bootloader enumerates in USB 2.0 mode. Hence the re-driver will not be involved in this process.

b. For the same setup, please confirm that the device enumeration in USB 2.0 mode is successful when the second parameter of the API CyU3PConnectState() is CyFalse. As you may know, this is used for enumerating the device in USB 2.0 mode.

2. There is no timeout implemented in FX3 firmware to switch back to USB2 when 3.0 receiver is present but no enumeration USB3 happens.

3. Please let us know the results of the tests mentioned in 1.a and 1.b of this response so that we can think of a possible firmware change to fix this issue.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hi Jayakrishna,

please see the answers to your questions below:

By using this setup: [Host PC] - [USB2 cable] - [TUSB501 USB3 re-drivers (RX,TX)] - [USB3 cable] - [FX3]

1a.) after setting the PMODE pins to USB Boot the Cypress Device appears in lsusb after powerup.

1b.) when the second parameter of the API CyU3PConnectState() is set to CyFalse then the USB2 enumeration happens successfully.

Could you please point us to the SDK function where the timeout could be inserted to fix this issue.

Thanks,

Sven

0 Likes

Hello,

Please try the following and let us know if it helps:

1. Declare a timer structure. Refer to page 360 of FX3 API guide to understand about Timer structure.

2. Create a Timer using the API CyU3PTimerCreate(). Refer to page 392 of FX3 API guide to understand about this API and the parameters that needs to be passes into it. This API can be called immediately after calling the API CyU3PConnectState(CyTrue, CyTrue) for USB3 enumeration. The last parameter of the API CyU3PTimerCreate() can be set to CYU3P_AUTO_ACTIVATE to start the timer immediately. If this is not used, then the timer needs to be started by using the API CyU3PTimerStart(). More information on CyU3PTimerStart() can be found in page 394 of FX3 API guide.

3. Check if SETCONF event is received before the timer hits. If the SETCONF event is received, then stop the timer using the API CyU3PTimerStop(). The information on this API can also be found in page 394 of FX3 API Guide.

4. If the SETCONF event is not received before the timer hits, then the callback function that was provided while calling the API CyU3PTimerCreate() will be executed. Inside this callback function, you need to do the following:

a. Disable the USB connection by using the API CyU3PConnectState(CyFalse, CyTrue);.

b. Provide a small delay by using the API CyU3PThreadSleep (100);

c. Attempt for USB2 enumeration by using the API CyU3PConnectState (CyTrue, CyFalse);.

d. Stop the timer using the API CyU3PTimerStop();

Please refer to the firmware that comes along with AN75779 if you face any difficulties while implementing timer operations. The link to the same is given below:

https://www.cypress.com/documentation/application-notes/an75779-how-implement-image-sensor-interface...

Also, the default value of one timer tick is 1ms. Please set sufficient timeout while creating the timer to ensure that USB3 enumeration happens without any issues.

Please try this and let us know if it solves the issue or not.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes

Hi Jayakrishna,

the fix works for us. Thanks for providing quick and helpful support.

Do you plan to integrate it into the next firmware release?

Thanks,

Sven

0 Likes

Hello,

The issue that is addressed in this thread is application specific. It does not require modifications to be made on the SDK. The suggestions that were given in my previous response needs to be added in the application firmware to fix this issue. We will create a Knowledge Base Article highlighting this issue so that other customers can also use these suggestions if they face the same issue.

Best Regards,

Jayakrishna

Best Regards,
Jayakrishna
0 Likes