Getting CY_U3P_USB_EVENT_SETCONF event in CX3 while switching between the resolution

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

cross mob
ViKu_2048416
Level 4
Level 4
50 sign-ins 25 replies posted 25 sign-ins

Hi,

We are getting CY_U3P_USB_EVENT_SETCONF event in some CX3 chips while switching between resolutions inconsistently so that USB reset occurs. We have added  CyU3PUsbLPMDisable ()  API in CyCx3UvcAppInit(), even after this we are getting a USB reset issue, however, the number of occurrences is low. Please guide us to overcome this issue as earlier as possible.

Reagrds,

Vignesh Kumar R. 

0 Likes
1 Solution

EDITTED

Hello Vignesh,

FX3 SDK 1.3.4 has a fix for the Errata 7 mentioned in CX3 datasheet. The problem and workaround provided in SDK 1.3.4 is briefly explained in the following thread:

https://community.cypress.com/t5/USB-Superspeed-Peripherals/Implemented-firmware-issue-for-Ver1-3-3-...

We suspect that the failure seen is related to this issue. An alternative workaround is to disable the LPM permanently. This can be done by calling the API CyU3PUsbLPMDisable() after the API CyU3PConnectState() is called. It is recommended to add a delay of few microseconds between CyU3PConnectState() and CyU3PUsbLPMDisable(). Also, the API CyU3PUsbLPMEnable() should not be called anywhere in the firmware. But, this method will cause the device to fail the compliance tests.

So, a better and recommended method is to use FX3 SDK 1.3.4 and disabling LPM while performing data transfers for building production firmware.

Best Regards,
Jayakrishna

View solution in original post

0 Likes
13 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Vignesh,

Could you confirm if SDK v1.3.4 is being used?

Best Regards,
AliAsgar

0 Likes

Hi Ali,

We are using SDK 1.3.3 for our product development. If I build the same firmware with SDK 1.3.4 the issue seems to be resolved, but yet to try more times with various devices to confirm this. As far as we tested the issue doesn't occurred. 
But we have done all our development and testing with SDK 1.3.3 only we cannot move to SDK version suddenly, could you please provide a solution to solve this issue with SDK 1.3.3 itself.

Thanks in advance,

Vignesh Kumar R. 

 

0 Likes

EDITTED

Hello Vignesh,

FX3 SDK 1.3.4 has a fix for the Errata 7 mentioned in CX3 datasheet. The problem and workaround provided in SDK 1.3.4 is briefly explained in the following thread:

https://community.cypress.com/t5/USB-Superspeed-Peripherals/Implemented-firmware-issue-for-Ver1-3-3-...

We suspect that the failure seen is related to this issue. An alternative workaround is to disable the LPM permanently. This can be done by calling the API CyU3PUsbLPMDisable() after the API CyU3PConnectState() is called. It is recommended to add a delay of few microseconds between CyU3PConnectState() and CyU3PUsbLPMDisable(). Also, the API CyU3PUsbLPMEnable() should not be called anywhere in the firmware. But, this method will cause the device to fail the compliance tests.

So, a better and recommended method is to use FX3 SDK 1.3.4 and disabling LPM while performing data transfers for building production firmware.

Best Regards,
Jayakrishna
0 Likes

Hi Krishna,

I have added CyU3PUsbLPMDisable() as you mentioned, but still, we are facing a USB reset issue with the firmware built-in SDK 1.3.3.

Unfortunately with the firmware built-in SDK 1.3.4 also we are getting USB reset issues randomly. Please let me know if you need any information from my side.

Thanks,

Vignesh Kumar R.

0 Likes

Hello Vignesh.

Please share the UART debug logs and Wireshark traces for us to check. Please use FX3 SDK 1.3.4 for building the firmware. Also, please ensure that the LPM is disabled while streaming the video. You can call the API CyU3PUsbLPMDisable() before starting the video stream. You can call CyU3PUsbLPMEnable() when the video streaming is stopped.

Best Regards,
Jayakrishna
0 Likes

Hi Krishna,

Whenever there is a USB reset we are getting these LTSSM transitions continuously, 

ViKu_2048416_0-1631808496148.png

I have taken the traces through Beagle USB protocol analyzer, please find the trace file from the following link https://drive.google.com/file/d/1jnlPHTwILOjXRX5EuYV6_219K8H2SWFe/view?usp=sharing

Also, I have attached the CX3 log with this, please download the same. We are getting these series of events below during the USB reset.

1. CY_U3P_USB_EVENT_RESET
2. CY_U3P_USB_EVENT_EP0_STAT_CPLT
3. CY_U3P_USB_EVENT_SET_SEL
4. CY_U3P_USB_EVENT_SETCONF

ViKu_2048416_1-1631808829588.png

Please guide us to solve this issue as soon as possible.

Thanks,

Vignesh Kumar R.

 

 

 

0 Likes

Hello Vignesh,

Please let me know with which SDK was the firmware built for testing? Also, please share the source code of the project for us to check. This is because I found that the device entered U1 state at the start of the trace.

Best Regards,
Jayakrishna
0 Likes

Hi Krishna,

I have built the source code with SDK version 1.3.3, with CyU3PUsbLPMDisable (); added in Appinit as below.

ViKu_2048416_0-1631859648026.png

As I said earlier after adding CyU3PUsbLPMDisable () the number of occurrences was reduced but still we are facing this issue. Also, I have confirmed that CyU3PUsbLPMEnable () is not called anywhere in the project. 

The device might be entered U1 state before calling CyU3PUsbLPMDisable () API I guess.

Regards,

Vignesh Kumar R.

 

0 Likes

Hello Vignesh,

As mentioned before, we have seen failures in some devices when it exit from U1 to U0 with the firmware built using SDK 1.3.3. The workarounds for this issue are:

1. Disable LPM permanently in the firmware built with SDK 1.3.3. If you are using this approach, then the device will fail the compliance test. Also, you need to ensure that the device will not go to U1 power state. You can try to reducing the delay between the connect state and lpm disable calls. You can add us delay by using the API CyU3PBusyWait(). 

2. The best option is to use SDK 1.3.4 and disable LPM while performing the data transfers. We strongly recommend you to use this second option. 

Best Regards,
Jayakrishna
0 Likes

Hi Krishna,

I will try the first one and update you, but as I said earlier I built the same source code with SDK 1.3.4 at that time also faced issues. I have just copied the source code that was built in SDK version 1.3.3 to SDK 1.3.4 while building. Is that approach is okay, is there anything else that needs to be done to build a source code in SDK 1.3.4. 

Regards,

Vignesh Kumar R.

 

0 Likes

Hello Vignesh,

You can refer to the Section 5.6.7 of the document "Getting Started with FX3 SDK" to understand how to port an Application in FX3 SDK 1.3.3 to FX3 SDK 1.3.4. The document comes along with FX3 SDK and can be found in the following location:

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

Also, please ensure that the FX3SDKVERSION string is set to 1_3_4. This string can be found in Build Variables section of C/C++ Build settings in project properties. A snapshot for reference is given below:

JayakrishnaT_76_0-1631866917548.png

Best Regards,
Jayakrishna
0 Likes

Hi Krishna,

Is that mandatory to put CyU3PUsbLPMDisable () after receiving the CY_U3P_USB_EVENT_SETCONF event in USB call back? Because if I put it like that the issue doesn't occur in SDK 1.3.3 version itself. Can you please comment on it?

Regards,

Vignesh Kumar R. 

 

0 Likes

Hello Vignesh,

Based on our discussion till this point, the issue that is seen at your end is related to the one discussed in the following thread:

https://community.cypress.com/t5/USB-Superspeed-Peripherals/Implemented-firmware-issue-for-Ver1-3-3-...

And as mentioned before, the solutions to this problem are:

1. Disable LPM permanently in the firmware built with SDK 1.3.3. If you are using this approach, then the device will fail the compliance test. Also, you need to ensure that the device will not go to U1 power state. You can try to reducing the delay between the connect state and lpm disable calls. You can add us delay by using the API CyU3PBusyWait(). 

2. The best option is to use SDK 1.3.4 and disable LPM while performing the data transfers. We strongly recommend you to use this second option. 

So, to work around this problem using SDK 1.3.3, you need to permanently disable LPM by using the API CyU3PUsbLPMDisable(). The best possible place to call this API is immediately after the API CyU3PConnectState() is called with a small delay between them. Other possible ways are:

1. Under CY_U3P_USB_EVENT_CONNECT when the evData = 1 (superspeed connection). The callback function will be generated with this event as soon as a USB 3 connection is made with the host.

2. CY_U3P_USB_EVENT_SETCONF. The callback function is invoked with this event when the set configuration request is received from the host. This approach is not much recommended because there are chances for the device to enter U1 power state before receiving this event. In this case, failures will be seen.

After disabling LPM, you need to ensure that the device never enters a low power state by performing sufficient tests. But, please note that the compliance tests will fail if you use this method. 

Best Regards,
Jayakrishna
0 Likes