<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103029/gazell-host-callback-function-not-being-call-back-when-usb-turn-into-suspend</link><description>I try to use Gazell and USB HID to remote wake up my computer. But after compter turns into sleep, the callback function on the Gazell Host Device doesn&amp;#39;t being called back anymore. The callback function will start work again after I wake my computer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 22 Jul 2024 09:15:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103029/gazell-host-callback-function-not-being-call-back-when-usb-turn-into-suspend" /><item><title>RE: Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/thread/494986?ContentTypeID=1</link><pubDate>Mon, 22 Jul 2024 09:15:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bce0b73-c6c7-405a-b561-b35504626a91</guid><dc:creator>buglovebug</dc:creator><description>&lt;p&gt;Hi, Kenneth, Pls allow me to jump in, if gzll not initiated right after USB_init(), bss above discussions, it is good to run nrf_drv_clock_hfclk_request(NULL); before gzll initializaion?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/thread/442764?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 11:49:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a20277a5-19e7-4cdc-9f93-a24ccaf5b8cd</guid><dc:creator>Brian_Chen</dc:creator><description>&lt;p&gt;It works, thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/thread/442748?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 10:54:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8c74224b-985e-402e-b278-8825c9810e11</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Can you try a different workaround:&lt;br /&gt;&lt;br /&gt;After calling app_usbd_init() in main, can you add following line:&lt;br /&gt;&lt;br /&gt;nrf_drv_clock_hfclk_request(NULL);&lt;br /&gt;&lt;br /&gt;I believe this should ensure hfclk is running.&lt;br /&gt;&lt;br /&gt;Kenneth&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/thread/442732?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 10:26:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:230d1cc7-06e0-4687-ad08-10ac76d48137</guid><dc:creator>Brian_Chen</dc:creator><description>&lt;p&gt;I have check the instructions in&amp;nbsp;app_usbd_suspend_req() and the description of the&amp;nbsp;&lt;span&gt;APP_USBD_EVT_DRV_SUSPEND, both of them indicate that it will release(stop) the hfclk.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So, I add an code in the while loop in mian() function, use an LED to indicate the status of the hfclk (as my laptop is sleeping, I cannot check the Log). the LED indicate when the USB suspend, the hfclk will turn off. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I put nrfx_clock_hfclk_start() just after the&amp;nbsp;app_usbd_suspend_req(). the problem is solved, but I don&amp;#39;t know if there&amp;nbsp;are any problems may caused by the restart of the hfclk.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/thread/442709?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 08:25:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a74877a7-ebeb-49fb-be7d-87ea0a9a6bad</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Sounds like you are closing on to the problem yes, how/where did you find that hfclk is stopped?&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/thread/442667?ContentTypeID=1</link><pubDate>Wed, 23 Aug 2023 04:26:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9862e92d-3d2d-4c25-b567-28bbf65d5e85</guid><dc:creator>Brian_Chen</dc:creator><description>&lt;p&gt;I have noticed that, the problem is because the&amp;nbsp;&lt;span&gt;APP_USBD_EVT_DRV_SUSPEND event will turn off the hfclk, and the gzll timer is not function. Is there anyway to keep hfclk active when&amp;nbsp;APP_USBD_EVT_DRV_SUSPEND event happened?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/thread/442592?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2023 13:41:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddc6742f-c417-44e2-9145-5d799938c7bb</guid><dc:creator>Brian_Chen</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, the usbd_user_ev_handler will go APP_USBD_EVT_DRV_SUSPEND event. I just copy this part fo code from the SDK keyboard example. I have tried to remove the app_usbd_suspend_req(), but the gzll device still cannot communicate with the host.&lt;/p&gt;
&lt;p&gt;regards,&lt;/p&gt;
&lt;p&gt;Letian.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static void usbd_user_ev_handler(app_usbd_event_type_t event)
{
    switch (event)
    {
    case APP_USBD_EVT_DRV_SOF:
        break;
    case APP_USBD_EVT_DRV_SUSPEND:
        app_usbd_suspend_req(); // Allow the library to put the peripheral into sleep mode
        // bsp_board_leds_off();
        break;
    case APP_USBD_EVT_DRV_RESUME:
        // LED_On(BSP_LED_3);
        //  kbd_status(); /* Restore LED state - during SUSPEND all LEDS are turned off */
        break;
    case APP_USBD_EVT_STARTED:
        // LED_On(BSP_LED_3);
        break;
    case APP_USBD_EVT_STOPPED:
        app_usbd_disable();
        break;
    case APP_USBD_EVT_POWER_DETECTED:
        NRF_LOG_INFO(&amp;quot;USB power detected&amp;quot;);

        if (!nrf_drv_usbd_is_enabled())
        {
            app_usbd_enable();
        }
        break;
    case APP_USBD_EVT_POWER_REMOVED:
        NRF_LOG_INFO(&amp;quot;USB power removed&amp;quot;);
        app_usbd_stop();
        break;
    case APP_USBD_EVT_POWER_READY:
        NRF_LOG_INFO(&amp;quot;USB ready&amp;quot;);
        app_usbd_start();
        break;
    default:
        break;
    }
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Gazell Host Callback function not being call back when USB turn into suspend</title><link>https://devzone.nordicsemi.com/thread/442581?ContentTypeID=1</link><pubDate>Tue, 22 Aug 2023 13:15:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25baa787-46d6-4728-8d17-e4f29bab1d18</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;What is the implementation of&amp;nbsp;usbd_user_ev_handler? Likely you are going to system off mode or similar on&amp;nbsp;APP_USBD_EVT_DRV_SUSPEND event.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>