Hello,
We are trying to use the usb wakeup feature while also using the usbd as a serial port (over usb).
The rwu is registered on initialization in our firmware using the:
app_usbd_class_rwu_register(class_cdc_acm); function call.
At that point all serial port communication is flawless. We have worked out a heart beat exchange between the devices to determine when the computer is suspended.
Once the computer is suspended we attempt to wake it up with:
app_usbd_wakeup_req(); function call. This wakes up the computer fine but from that point on the serial port device stops receiving data.
If we unregister the rwu with : app_usbd_class_rwu_unregister(class_cdc_acm); function call after the computer wakes up, bidirectional communication is restored on the serial port device"
However the wakeup feature is no longer is able to wakeup the computer again even if the rwu is re-registerd. It seems the (usb serial port) enters an invalid state.
Three Questions
1) Can the rwu feature be dynamically registered and unregistered at runtime without any issues. (It seems to adversely affect the serial port operation)
2) Is there an api to allow us to determine whether the connected computer is suspended or awake?
3) Is there an implementation example for best practices where the usbd is used for both serial communication and wakeup feature.
Thank you