When host sends a suspend request, the device needs to handle it. I do not see your firmware, so I cannot say how you are handling it.
If you download FX3 SDK, we have provided a "LowPowerTest" example. This example shows the correct way to suspend the device. Please check with this firmware, we expect it to work fine. Once you have tested, you can use this as a base for your project to implement suspend request from the host.
EZ-USB FX3 SDK\1.3\firmware\basic_examples\cyfxlowpowertest
I test the sample code SDK\1.3\firmware\basic_examples\cyfxlowpowertest.
There are two main variables in the sample code.
1)glSuspendEnbl : set to CyTrue by the vendor command, CY_FX_LP_VBUS_SUSPEND_RQT or CY_FX_LP_USB_SUSPEND_RQT,
2)glTriggerSuspend : set to CyTrue by USB suspend event, CY_U3P_USB_EVENT_SUSPEND
Once the both variables are set to CyTrue, the suspend flow in the main loop will be executed. I can set the glSuspendEnbl to CyTrue, but I don't know how to set glTriggerSuspend to CyTrue by CY_U3P_USB_EVENT_SUSPEND event. I have tried the Suspend() api in the host software, and it didn't cause corresponding action in the device side.
The attach file is my test code which I only add some debug log to original sample code.
LowPowerTest.zip 472.6 K
I notice that \EZ-USB FX3 SDK\1.3\driver\CyUSB.pdf, and it says IOCTL_ADAPT_SET_DEVICE_POWER_STATE is no longer supported. I think the Suspend() function in the CyAPI is based on this IOCTL, so the function Suspend() has no function. Is that right?
You can set this in the CyFxApplnUSBSetupCB where we have handled vendor commands. we are setting glTriggerSuspend while handling the vendor command to suspend the device. You can also have a similar implementation. You will need to send that particular vendor command, in order to move the device to suspend.
Ok, I know that the Suspend() function in the CyAPI doesn't work. I'll try you mentioned method. Thanks.