<?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 not enumerating without JLinkExe running</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/37812/usb-not-enumerating-without-jlinkexe-running</link><description>Hi, 
 I am having a problems with USB enumerating with a custom board based on the nRF52840. The board is self powered by LiPo battery. I am developing by connecting to the board with a J-Link Pro over SWD. I am using the armgcc toolchain. My application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 28 Aug 2018 05:53:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/37812/usb-not-enumerating-without-jlinkexe-running" /><item><title>RE: USB not enumerating without JLinkExe running</title><link>https://devzone.nordicsemi.com/thread/146025?ContentTypeID=1</link><pubDate>Tue, 28 Aug 2018 05:53:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82ed81ea-0c68-44d7-aca1-0aab59b66ea7</guid><dc:creator>jeremysf</dc:creator><description>&lt;p&gt;Good question, and now I feel dumb for not trying that!!&lt;/p&gt;
&lt;p&gt;So, as it turns out I do not see these issues with the usbc_cdc_acm example in&amp;nbsp;SDK 15.1. I am able to successfully plug/un-plug&amp;nbsp;the USB cable (through a hub, without a hub, through two hubs) and the Mac enumerates my custom board as a /dev/tty.usbmodem**** regardless of if JLinkExe is connected or not. Yay, it&amp;#39;s not the&amp;nbsp;hardware!&lt;/p&gt;
&lt;p&gt;Next, I tried the usbd_ble_uart sample with the same&amp;nbsp;(working) results. Hub or no hub, JLinkExe or not, it works! Also, shedding further light onto the issue, the USB enumeration is *instant*. In the best case scenario with my app, the enumeration takes maybe two seconds, worst case (no hub, no JLinkExe) it takes like 7 seconds.&lt;/p&gt;
&lt;p&gt;My app is refreshing&amp;nbsp;an OLED screen via ~8MHz SPI on a timer interrupt. &lt;strong&gt;When I boosted the priority of the USBD above the SPI (i.e. to a lower number than the SPI code)&amp;nbsp;everything started working reliably.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Sigh :)&lt;/p&gt;
&lt;p&gt;Thanks for&amp;nbsp;the advice!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB not enumerating without JLinkExe running</title><link>https://devzone.nordicsemi.com/thread/145934?ContentTypeID=1</link><pubDate>Mon, 27 Aug 2018 12:35:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9680fc3-4f91-488d-bf3b-a37a43d7b92c</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The device answers some of the USB transactions, so it could be some timing issues with your application.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do you see the same behavior if you test the unmodified &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.1.0/usbd_cdc_acm_example.html?cp=4_0_0_4_5_50_3"&gt;usbd_cdc_acm example&lt;/a&gt; in SDK 15.1?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB not enumerating without JLinkExe running</title><link>https://devzone.nordicsemi.com/thread/145748?ContentTypeID=1</link><pubDate>Sat, 25 Aug 2018 05:42:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3913b7ab-44bf-42ec-9379-dc6c4f3a1f7f</guid><dc:creator>jeremysf</dc:creator><description>&lt;p&gt;I&amp;nbsp;bodged another 4.7uF decoupling cap onto VBUS just in case, but no change. I also found if I plug my device directly into a USBC port (via a USBC-&amp;gt;USB3 &amp;quot;adaptor&amp;quot;) then I am able to get the&amp;nbsp;USB to enumerate after 7s or so. If I go through a USBC-&amp;gt;USB3 hub, it will never enumerate&amp;nbsp;unless I am connected via JLinkExe. If I am connected via JLinkExe, enumeration happens in about 1s, regardless of through a hub or direct to the MacBook Pro USBC.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB not enumerating without JLinkExe running</title><link>https://devzone.nordicsemi.com/thread/145743?ContentTypeID=1</link><pubDate>Sat, 25 Aug 2018 03:19:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59f88954-8fc4-40ee-acb2-21e9da17a294</guid><dc:creator>jeremysf</dc:creator><description>&lt;p&gt;So I hooked up my Packet-Master USB500AG and grabbed the traffic between the Mac and the device.&amp;nbsp;Here&amp;#39;s what the capture for a failed&amp;nbsp;enumeration looks like. Firstly, I have filtered out all the NAK&amp;nbsp;packets,&amp;nbsp;to make it easier to see the big picture.&lt;/p&gt;
&lt;p&gt;Below you can see the &amp;quot;Get Device Descriptor&amp;quot;&amp;nbsp;never completes. The setup&amp;nbsp;is ACK&amp;#39;d by the nRF52840, but then all attempts by the host to&amp;nbsp;continue with the control transfer fail with NAK:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="783" src="https://devzone.nordicsemi.com/resized-image/__size/1380x1616/__key/communityserver-discussions-components-files/4/Failed-Overview.png" width="670" /&gt;&lt;/p&gt;
&lt;p&gt;Now&amp;nbsp;zooming in on the &amp;quot;Get Device Descriptor&amp;quot; transaction with&amp;nbsp;NAKs (which repeat on in the thousands, interrupted with some SOFs):&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="634" src="https://devzone.nordicsemi.com/resized-image/__size/1286x1182/__key/communityserver-discussions-components-files/4/Failed-with-NAKs.png" width="690" /&gt;&lt;/p&gt;
&lt;p&gt;For&amp;nbsp;completeness, this is what it&amp;#39;s like when the JLinkExe is connected. Here we can see successful enumeration. I can plug/unplug and re-trigger this enumeration as long as JLinkExe is running. If I quit the JLinkExe software (leaving the J-Link Pro connected to SWD), enumeration will fail...until I&amp;nbsp;re-run and type &amp;quot;connect&amp;quot; in JLinkExe in which case, enumeration will succeed:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " height="619" src="https://devzone.nordicsemi.com/resized-image/__size/1092x480/__key/communityserver-discussions-components-files/4/Screen-Shot-2018_2D00_08_2D00_24-at-8.32.29-PM.png" width="537" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB not enumerating without JLinkExe running</title><link>https://devzone.nordicsemi.com/thread/145739?ContentTypeID=1</link><pubDate>Sat, 25 Aug 2018 01:23:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f60a92bc-f933-4a4a-968e-13561deedc4f</guid><dc:creator>jeremysf</dc:creator><description>&lt;p&gt;So my&amp;nbsp;custom board has an OLED screen. I am printing out status to it, and I can see that&amp;nbsp;when JLinkExe is not connected, and my device fails to enumerate USB, it is still getting&amp;nbsp;all the way to the &amp;#39;APP_USBD_EVT_POWER_READY&amp;#39; event in my&amp;nbsp;usbd_user_ev_handler() despite failing to enumerate. I correctly see &amp;#39;APP_USBD_EVT_POWER_REMOVED&amp;#39; through &amp;#39;&lt;span&gt;APP_USBD_EVT_POWER_READY&amp;#39; events when I unplug and plug back in the USB cable, but no device enumeration (i.e. /dev/tty.usbmodem*** does not show up)...until...I connect again with JLinkExe, then I get device enumeration.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In the working case,&amp;nbsp;the last event I get after successful enumeration is &amp;quot;APP_USBD_EVT_DRV_RESET&amp;quot;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In the case where JLinkExe is disconnected (and it fails to enumerate), I alternate between getting &amp;quot;APP_USBD_EVT_DRV_SUSPEND&amp;quot; and &amp;quot;APP_USBD_EVT_DRV_RESUME&amp;quot; events but never get to the &amp;quot;APP_USBD_EVT_DRV_RESET&amp;quot; state.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB not enumerating without JLinkExe running</title><link>https://devzone.nordicsemi.com/thread/145732?ContentTypeID=1</link><pubDate>Fri, 24 Aug 2018 21:11:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9e334a8-8669-46da-bde9-ad44da195997</guid><dc:creator>jeremysf</dc:creator><description>&lt;p&gt;I just upgraded to SoftDevice 140v6.1 and SDK 15.1 and redid my sdk_config.h and Makefile from scratch using a blend of&amp;nbsp;buttonless_dfu, ble_hrs and usb_cdc configs.&lt;/p&gt;
&lt;p&gt;Sadly, no change in&amp;nbsp;behavior. Works great if JLinkExe is actively &amp;quot;connected&amp;quot;,&amp;nbsp;no enumeration if JLinkExe&amp;nbsp;is disconnected. As soon as I re-connect JLinkExe, within a few seconds, USB gets enumerated by&amp;nbsp;my Mac.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>