As mentioned in the community thread: PSoC 5LP USB UART interrupt , the USB device once sent to sleep in case of PSoC 5LP will wakeup only when the Host drives the D Plus line of the USB from high to low.
The only time we can suspend the USB and send the device to sleep is when the host stops sending packets. This usually happens when you place the PC in sleep mode (or hibernate).
If the PC is running and the OS is active, it will constantly send packets to the USB device.
Please refer to the USBFS component datasheet, Enter/Exit Low Power Mode Example topic on page 50 to implement entry and exit from low power mode.
Also, can you please let me know how are you sending the device in Sleep mode? Does the host also go to sleep then?
USBFS_v3_20.pdf 1.3 MB
Hi EktaN_26 ,
I'm sending my device to Sleep exactly with the enter/exit low power mode example. And it works OK.
During my Sleep mode (device), PC is running or hibernate, that doens't matter for me.
My question is if is it possible to wake up my device from Sleep if I press a key in a terminal window connected by usb uart.
Thanks for your support!
No, it is not possible.
You can't even go to sleep (with PM_SLEEP_SRC_PICU) if there is activity in the USB. You can only suspend the USB and go to sleep if there is no activity for 3 ms.
If your concern is power, what you can do is to call the following command in the main loop:
Still, if the PC is running, it will periodically send USB packets, therefore it might have an interrupt going on in the background. However, you do save a bit of power, since the CPU will stay idle longer.
You can also disable the SOF interrupts in the component to avoid more interrupts, if your application allows.