Device-initiated remote wake-up

nRF5340 Product Specification

Assuming the remote wake-up is supported by the USB device and enabled by the USB host, the device can request the USB host to resume from suspend if the wake-up condition is met.

To do so, the HFXO needs to be enabled first. After waking up the HFXO, the software must bring USBD out of Low-power mode and set Normal mode by writing ForceNormal in register LOWPOWER. It can then instruct USBD to drive a RESUME condition (K state) on the USB bus by triggering the DPDMDRIVE task, attempting to wake up the USB host. By choosing Resume in DPDMVALUE, the duration of the RESUME state is under hardware control (tUSB,DRIVEK). By choosing J or K, the duration of that state is under software control (the J or K state is maintained until a DPDMNODRIVE task is triggered) and has to meet TDRSMUP as specified in USB specification chapter 7.

Upon writing the ForceNormal in register LOWPOWER, a USBEVENT event is generated with the USBWUALLOWED bit set in register EVENTCAUSE.

The value in register DPDMVALUE will only be captured and used when the DPDMDRIVE task is triggered. This value defines the state the USB bus will be forced into after the DPDMDRIVE task.

The USB device must not initiate a remote wake-up request before TWTRSM (according to USB specification chapter 7) after the USB bus has entered idle state. Using the recommended resume value in DPDMVALUE (rather than K) takes care of this, and postpones the RESUME state accordingly.