Control requests fail after device suspend and resume

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

cross mob
lock attach
Attachments are accessible only for community members.
mialc_1106291
Level 4
Level 4
10 questions asked 50 sign-ins 50 replies posted

Hi,

I've written a custom bootloader for the CYUSB3014-BZXC using the Cypress Boot API. We've been using this bootloader without issue for the past couple of months. However, someone recently plugged the board into a USB 3.1 host controller using a USB 2.0 cable. Upon doing so we discovered that in USB 2.0 mode the device stops responding to standard requests after being suspended and then resumed. The traffic on the USB bus was captured with an Ellisys EX350 and shows the following transactions:

1. get device descriptor (success)
2. set address (success)
3. get device descriptor (success)
4. get configuration descriptor (success)
5. get BOS ddescriptor (success)
6. get serial number descriptor (success)
7. get language ID descriptor (success)
8. get product descriptor (success)
9. set configuration 1 (success)
10. LPM transaction (success)
11. Suspended
12. Resume
13. get language ID descriptor x 6 (failure)
14. get manufacturer descriptor x 6 (failure)
15. get product descriptor x 6 (failure)

UART Debug message prints from the firmware show the following:

Initializing FX3 Boot Firmware 1.6
Boot FW Event: CY_FX3_BOOT_USB_IN_SS_DISCONNECT
Boot FW Event: CY_FX3_BOOT_USB_SUSPEND
Boot FW Event: CY_FX3_BOOT_USB_RESET
Boot FW Event: CY_FX3_BOOT_USB_RESET
Boot FW Event: CY_FX3_BOOT_USB_RESUME

Are there any special actions that the firmware must take when it receives CY_FX3_BOOT_USB_SUSPEND or CY_FX3_BOOT_USB_RESUME in order to get the FX3 to ACK the control requests that take place after the the suspend and resume operations?

We also seem to experience the same problem when running the application firmware (uses Cypress full API) when the device is plugged in with a USB 2.0 cable. The bus activity is similar:

1. get device descriptor (success)
2. set address (success)
3. get device descriptor (success)
4. get configuration descriptor (success)
5. get BOS ddescriptor (success)
6. get serial number descriptor (success)
7. get language ID descriptor (success)
8. get product descriptor (success)
9. LPM transaction (success)
10. Suspended
11. Resume
12. set configuration 1 x 3 (failure)
13. Suspended

So the same question applies for the application firmware: what steps must we take in firmware in order for control transfers to succeed after the device has been suspended and then resumed?

Some other information that you may find useful:

Operating system: Windows 10
Host Controller: Asmedia ASM3142
Hub: none

I appreciate any help you can provide.

Thanks,
Michael

0 Likes
55 Replies
lock attach
Attachments are accessible only for community members.

Hi AliAsgar,

 

I tried the fx3bootappgcc firmware on the CYUSB3KIT-03 and it fails the chapter 9 tests with BESL enabled. I've attached the log.

Thanks,
Michael

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Michael,

Please find attached boot library and fx3BootAppGcc firmware.

Please use the library attached to build the fx3BootAppGcc firmware with UART prints enabled and share with us the UART debug prints.
The test should be run on Asmedia host.

Note that: the UART pins are brought out on GPIO 46-49.

Best Regards,
AliAsgar

0 Likes

Hi AliAsgar,

I tried importing the project you sent but I'm having issues building the firmware. The compiler is complaining that it cannot find some of the library header files.

I tried importing \Fx3BootAppGcc from the SDK folder and am able to build that. I modified the firmware to be identical to the source you sent, but after doing so I'm getting " warning: implicit declaration of function 'CyFxUsbGetEventLogIndex' [-Wimplicit-function-declaration]". Is "CyFxUsbGetEventLogIndex" function you added to the boot library? Also, how do I tell eclipse to use libcyfx3boot.a that you sent, vs the one in the SDK installation directory?

I programmed the CYUSB3KIT with "Fx3BootAppGcc.img" from your zip file but i don't see any activity on the UART TX pin so I don't think it's working.

Thanks,
Michael

 

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Michael,

I have attached a 1_3_5 folder in this interaction. Please paste the folder in the below path : C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\boot_lib.

Make sure the 1_3_5 folder pasted in the boot_lib folder contains include and a lib folder.

Change the FX3SDKVERSION value from 1_3_4 to 1_3_5 in the build settings like below.

AliAsgar_0-1666592636772.png

Could you try to probe the UART lines on the corresponding GPIOs given in the pin configuration in the FX3 datasheet?

Best Regards,
AliAsgar

 

0 Likes
lock attach
Attachments are accessible only for community members.

Hi AliAsgar,

Thanks for sending over the SDK files and the instructions. I manage to get UART logging to work and have attached a zip file that contains both the test suite results and the UART log for the device. It was tested with Asmedia 3.1 host controller. Please let me know if you need any additional information.

Thanks,
Michael

0 Likes

Hi Michael, 

Could you add the below code in the UsbEventCB whenever a resume event is seen.

        if (CyFx3BootUsbGetSpeed () == CY_FX3_BOOT_HIGH_SPEED)
        {
            CyFx3BootUsbSigResume();
        }

Let me know if the issue is seen after making these changes.

Best Regards,
AliAsgar

 
0 Likes
lock attach
Attachments are accessible only for community members.

Hi AliAsgar,

 

I made the change that you suggested and re-ran the test. Unfortunately, it still fails. I've attached the test log and teraterm uart log. Do you have any other suggestions?

Thanks,
Michael

0 Likes

Hi Michael,

From the logs, I see that eventhough UsbSigResume was called,  the contents did not execute because of some conditions.
Could you try using the same API when a SUSPEND callback is registered?

Best Regards,
AliAsgar

0 Likes

Hi AliAsgar,

How do I register a SUSPEND callback? Do you mean perform the same action for CY_FX3_BOOT_USB_SUSPEND in the event callback function? Also, I noticed that the documentation says that CyFx3BootUsbSigResume should not be called directly from an ISR or a callback function. I tried creating a global variable that I set to '1' in response to CY_FX3_BOOT_USB_RESUME and then having main call CyFx3BootUsbSigResume but it still fails the Chapter 9 tests in the same manner as before. Please provide me with more detailed instructions on on the suspend callback.

Thanks,
Michael

0 Likes

Hi Michael, 

Sorry for the miscommunication, I meant when the SUSPEND callback is triggerred. When an LPM-L1 suspend is seen, "CY_FX3_BOOT_USB_SUSPEND" callbackl is triggered in the UsbEvent callback. Call the Usb2Resume API when this callback is seen and check if the issue is seen.
Note that, Usb2Resume should be called before a RESUME event is seen.

We will be receiving the Asmedia host controller PC on Monday. I will try to reproduce the issue.

Best Regards,
AliAsgar

0 Likes
lock attach
Attachments are accessible only for community members.

Hi AliAsgar,

I modified the event callback to set a global variable to a '1' when the event is received. The main loop checks this flag and will call CyFx3BootUsbSigResume if the current speed is USB2. Unfortunately, this does not appear to have solved the problem. Please see the attached logs.

Hopefully the Asmedia host controller is the same as the one on the StarTech PEXUSB312C3 (Asmedia ASM3142).

Thanks,
Michael

 

0 Likes

Hi Michael,

I am able to reproduce the issue at my end on Windows 10.

I shall carry out tests on my end and let you know the update.

Best Regards,
AliAsgar

0 Likes

Hi AliAsgar,

Have you been able to find a solution to this problem?

Thanks,
Michael

0 Likes

Hi Michael,

Sorry for the delay in response. 
I am rarely getting the Asmedia host controller setup for testing, hence it is taking more time for the debugging.
However I have had some progress. I see that the device is processing the host resume signal properly, but it is having issues waking up to USB hardware interrupts later.

I will try to debug this issue and try remote wakeup from device when L1 entry is seen. I will keep you updated on the tests.

Best Regards,
AliAsgar

0 Likes
MariOku
Level 1
Level 1
First reply posted First question asked Welcome!

I'm having problems with resuming usbdevice from susspend state.
I'm working on SDK 15.2 with SD140 (6.1.0). on custom board with nRF52840 IC rev. 2.

My application runs usbd with HID generic profile and Softdevice.
SoftDevice is enabled, than usb is initialized and device is connected to PC usb port.

When host(PC) is requesting suspend to usbdevice, it enters to suspend state, but can not resume when host requests it.
I can see on debug traces that device is reporitng USB_RESUME events, but communication with hosts ends with error (host usb driver can not connect to the device).

After some investigations I've found that requesting of High Frequency Clock is somehow indirectly causing suspend/resume issue.
In my application I'm requesting HFCLK and later on usb device is initialized and opened.
If I remove HFCLK request than device is successfully resuming from suspend state and there is no connection error on usb bus.

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

Hi,

Could you let us know which Infineon IC are you working on?

Best Regards,
AliAsgar

0 Likes