<?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>USB disconnect causing system reset</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38659/usb-disconnect-causing-system-reset</link><description>Software : C / GCC - SDK 15.0.0 - SD140 6.0.0 - building on multiple platforms. Hardware : nRF52840-DK (Q1AAC0) - and secondary testing on custom board using the Fanstel BT840 Module Whenever the chip is in low-power, and the USB is disconnected there</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Nov 2019 22:11:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38659/usb-disconnect-causing-system-reset" /><item><title>RE: USB disconnect causing system reset</title><link>https://devzone.nordicsemi.com/thread/220186?ContentTypeID=1</link><pubDate>Thu, 14 Nov 2019 22:11:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6c388958-0b47-41c7-bd19-2d8dae0a3b2c</guid><dc:creator>Mihal</dc:creator><description>&lt;p&gt;hi. looks like i have a similar problem on&amp;nbsp;SDKv15.2&amp;nbsp;&lt;/p&gt;
&lt;p&gt;NRF_DRV_POWER_EVT_DETECTED is presented and i can process it BUT only when firmware is active.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;my code is super simple.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;switch (event)
{
case NRF_DRV_POWER_USB_EVT_DETECTED:
    NRF_LOG_INFO(&amp;quot;USB power detected&amp;quot;);
    if (!nrf_drv_usbd_is_enabled()) {
        if ( !POWER_ON() ) sleep_mode_enter();
    }
    break;
case NRF_DRV_POWER_USB_EVT_REMOVED:
    NRF_LOG_INFO(&amp;quot;USB power removed&amp;quot;);
    if (!nrf_drv_usbd_is_enabled()) {
    if ( true ) sleep_mode_enter();
    }
break;
default:
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;it supposed to check whether program have been already running before the event.&lt;/p&gt;
&lt;p&gt;NRF_DRV_POWER_USB_EVT_DETECTED works perfect&lt;/p&gt;
&lt;p&gt;but NRF_DRV_POWER_USB_EVT_REMOVED&amp;nbsp;can not be processed from sys_off even if there is always true as i put in example&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;UPD: your link in a comment above is broken&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB disconnect causing system reset</title><link>https://devzone.nordicsemi.com/thread/149414?ContentTypeID=1</link><pubDate>Wed, 19 Sep 2018 11:43:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91f8bd05-b149-47e7-b40b-210a99884a00</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello, can this be the case:&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev1/ERR/nRF52840/Rev1/latest/anomaly_840_197.html?cp=4_0_1_2_1_29"&gt;https://infocenter.nordicsemi.com/topic/errata_nRF52840_Rev1/ERR/nRF52840/Rev1/latest/anomaly_840_197.html?cp=4_0_1_2_1_29&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Also please update to SDKv15.2 for various bug fixes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>