Search for CY_U3P_SYS_PPORT_WAKEUP_SRC, CY_U3P_SYS_UART_WAKEUP_SRC, etc in cyu3system.h. You will find the values to be passed in for the wakeup sources in CyU3PSysEnterSuspendMode API.
Thanks a ton! It's right there at the top of the header file.
Thanks for the quick response time too.
I have another related question.
I'm trying to Suspend the CPU after a USB disconnect from my PC, using the same CyU3PSysEnterSuspendMode function.
Right now, they way I am testing this is setting an event flag in the CyFxBulkSrcSinkApplnUSBEventCB callback when the event type is CY_U3P_USB_EVENT_DISCONNECT. This event flag is then identified in the BulkSrcSinkAppThread_Entry loop using the CyU3PEventGet function. Then I call suspend with this:
status = CyU3PSysEnterSuspendMode(CY_U3P_SYS_USB_VBUS_WAKEUP_SRC, 1, &wakeup_source);
However, it seems that it will always return CY_U3P_ERROR_BAD_ARGUMENT when the device has been disconnected. I have since discovered that it will successfully sleep the device if called for a different reason when USB is still connected.
Any ideas why? I have been slowly stripping the application of all other functionality to make sure that nothing else is going on. I've been testing with other wakeup sources too - CY_U3P_SYS_USB_BUS_ACTVTY_WAKEUP_SRC has the same error.
I did notice that in the docs, it mentions that this error is thrown... "if the wakeup sources specified are invalid." The For some reason, when the USB is disconnected, the specified source is no longer valid.
I've already done a fair bit of testing to make sure that the event is called in at the right time only once. It definitely is only called on a physical disconnect event, and it's only getting called once per disconnect.
Your help is greatly appreciated!
I have not made any progress on the above issue: getting the FX3 to go into suspend mode after USB disconnect.
In the mean time, I have started looking at standby mode.
Our application is self powered and always on. We want to put everything in the lowest power state possible while disconnected and power down most of the rail supplies.
I have been looking into the standby power state (L3) in the datasheet and the programmers manual.
The datasheet says that standby is entered through a register control in the CPU. It also says that it can be exited by the detection of VBUS, and that the program counter is reset.
The programmer's guide says something similar.
The API Guide says nothing. There is explanation of how to enter this mode. The programmers manual mentions a few registers related to device warm reset, but not enough to do anything.
I did notice a function in cyu3system.h called CyU3PSysEnterStandby. The description suggests that this is what I am looking for. I've added a call to my application, and now the application won't compile. It says 'undefined reference to CyU3PSysEnterStandby'. I'm guessing that's why it's not in the API guide. I'm using SDK 1.2. I've checked the release notes for 1.2.1, but there is no mention of standby.
Also, the h file mentions that the functions this: "This function does not return until the device has already resumed normal operation."
This implies that the function returns eventually. I find this unusual since the program counter is reset.
1. Is there any way to currently get the processor into standby, and how?
2. How can I make sure it powers back on from VBUS connection (or any other source)?
3. Can the function mentioned above actually return after power up, and if so, how does it store the stack, etc?
I'm meeting with Triton (FAE) tomorrow and I will ask him then too.
Please create a tech support case at www.cypress.com -> support -> Technical Support. One of our engineers will look into your queries.