This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Can nRF24LU1P USB Dongle can auto resume after suspend?

Hi, Nordic

Now I have one nRF24LU1P USB Dongle, if sometimes there is no data in/out usb(maybe 3ms), USB Dongle will enter suspend state.

Can USB Dongle support to resume after suspend?

And my USB Dongle receive data via ESB/Gazell, USB Dongle need to connect to PC all the time, sometimes, there is no data from ESB/Gazell, but after ESB/Gazell received, I need USB Dongle send data to PC, but this time, USB Dongle is suspend, it need to resume.

How can I do? Thanks.

  • Hi Chaw,

    At section 7.8.1 in the nRF24LU1P spec, you can find that you can wake the USB up by setting bit 6 in USBCON SFR register.

  • Thanks for your reply. How can I set USBCON SFR register? I do like below, but it do not work:

    if (hal_usb_get_state() == SUSPENDED)
    {            
            USBCON = 0x40;
    }
    

    above code is exist in my program while(true), it can not work.

  • I'm not sure why it doesn't work. But you may want to check if it's allowed from the host that the device can wake up on its own USB_BM_STATE_ALLOW_REMOTE_WAKEUP.

    I would suggest you to have a look at our reference code in our nRFDesktop example code. Here is what inside our wake-up code:

    void hal_usb_wakeup()
    {
      // We can only issue a wakeup if the host has allowed us to do so
      if((g_hal_usb.bm_state & USB_BM_STATE_ALLOW_REMOTE_WAKEUP) == USB_BM_STATE_ALLOW_REMOTE_WAKEUP)
      {
        USBCON = 0x40;  // Wakeup the USB controller via remote pin
        delay_ms(1);    // Wait until the USB clock starts
        USBCON = 0x00;
      }
    }
    

    If you don't have access to the nRFReady Desktop code, please create a case on MyPage on our website and give me the case number.

  • P/S: Also please make sure you enable wake up on USBWU by setting bit 2 in WUCONF.

Related