USB Remote Wakeup not waking up host

I have a USB HID device using the 'old' USB stack in Zephyr. I have configured the 'CONFIG_USB_DEVICE_REMOTE_WAKEUP'

1. I put the HOST to Suspend

2. The NRF52 USB goes into Suspend.

3. A 'usb_wakeup_request' is called, and I see it calls into the

nrf_usbd_common_wakeup_req , which results in a 'ev_usbevent_handler' call to the USBD_EVENTCAUSE_USBWUALLOWED_Msk section.

It does call the

'            NRF_USBD->DPDMVALUE = USBD_DPDMVALUE_STATE_Resume
                << USBD_DPDMVALUE_STATE_Pos;
            NRF_USBD->TASKS_DPDMDRIVE = 1;

and the USBD reports a 'Resume' and the resulting log:

usb_hid: Device resumed
usb_hid: from suspend

but then results back in a Suspended state: usb_hid: Device suspended, and the HOST does not wakeup. I have other USB hardware (non NRF52) which is capable of waking up this HOST.

Using ncs 2.7.0.

I've also tried putting in the errata_171_end section into the USBWUALLOWED section. ie.

if (event & USBD_EVENTCAUSE_USBWUALLOWED_Msk) {

unsigned int irq_lock_key = irq_lock();

if (*((volatile uint32_t *)(0x4006EC00)) == 0x00000000) {
*((volatile uint32_t *)(0x4006EC00)) = 0x00009375;
*((volatile uint32_t *)(0x4006EC14)) = 0x00000000;
*((volatile uint32_t *)(0x4006EC00)) = 0x00009375;
} else {
*((volatile uint32_t *)(0x4006EC14)) = 0x00000000;
}

irq_unlock(irq_lock_key);

LOG_DBG("USBD event: WUREQ (%s)", m_bus_suspend ? "In Suspend" : "Active");
if (m_bus_suspend) {
__ASSERT_NO_MSG(!nrf_usbd_common_suspend_check());
m_bus_suspend = false;

NRF_USBD->DPDMVALUE = USBD_DPDMVALUE_STATE_Resume
<< USBD_DPDMVALUE_STATE_Pos;
NRF_USBD->TASKS_DPDMDRIVE = 1;

const nrf_usbd_common_evt_t evt = {.type = NRF_USBD_COMMON_EVT_WUREQ};

m_event_handler(&evt);
}
}

However I still cannot get the HOST to Remote Wake up.

Thanks for any help!

Related