<?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>Custom USB device shows up as 2 separate devices when driver not installed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/91815/custom-usb-device-shows-up-as-2-separate-devices-when-driver-not-installed</link><description>Hi there, 
 As mentioned in an earlier ticket I&amp;#39;m developing a successor to one of our products based on the nRF9160. Since it doesn&amp;#39;t have USB we&amp;#39;ve added the nRF52820 as a USB-to-UART bridge. Since our old product uses 2 USB interfaces with 2 endpoints</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Sep 2022 14:51:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/91815/custom-usb-device-shows-up-as-2-separate-devices-when-driver-not-installed" /><item><title>RE: Custom USB device shows up as 2 separate devices when driver not installed</title><link>https://devzone.nordicsemi.com/thread/385783?ContentTypeID=1</link><pubDate>Mon, 12 Sep 2022 14:51:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6a219c3-3a84-40c6-b020-4fa6878bfafc</guid><dc:creator>JoEi</dc:creator><description>&lt;p&gt;Hi H&lt;span&gt;&amp;aring;&lt;/span&gt;kon,&lt;/p&gt;
&lt;p&gt;I just found the culprit.&lt;/p&gt;
&lt;p&gt;The problem was that bDeviceClass was set to 0. This resulted in this strange behaviour.&lt;br /&gt;After changing &lt;span&gt;bDeviceClass&lt;/span&gt;&amp;nbsp;to 0xFF it works fine, even installing the device driver works smoothly now.&lt;/p&gt;
&lt;p&gt;When initially developing the bridge we knew about this difference but didn&amp;#39;t think that it would cause such a problem.&lt;br /&gt;Back then we also didn&amp;#39;t want to modify the SDK but as it seems we need to do just that.&lt;/p&gt;
&lt;p&gt;Thanks for the tip with lsusb. Because of this we saw that bDeviceClass is the only difference&lt;span&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My solution is the following:&lt;br /&gt;Changing&amp;nbsp;APP_USBD_CODE_DEVICE_DESCRIPTOR in app_usbd_core.c to:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#define APP_USBD_CORE_DEVICE_DESCRIPTOR  {                                                               \
   .bLength = sizeof(app_usbd_descriptor_device_t),    /* descriptor size */                             \
   .bDescriptorType = APP_USBD_DESCRIPTOR_DEVICE,      /* descriptor type */                             \
   .bcdUSB = APP_USBD_BCD_VER_MAKE(2,0,0),             /* USB BCD version: 2.0 */                        \
   .bDeviceClass = APP_USBD_DEVICE_CLASS,              /* device class */                                \
   .bDeviceSubClass = APP_USBD_DEVICE_SUB_CLASS,       /* device subclass */                             \
   .bDeviceProtocol = APP_USBD_DEVICE_PROTOCOL,        /* device protocol */                             \
   .bMaxPacketSize0 = NRF_DRV_USBD_EPSIZE,             /* endpoint size: fixed to: NRF_DRV_USBD_EPSIZE*/ \
   .idVendor = APP_USBD_VID,                           /* Vendor ID*/                                    \
   .idProduct = APP_USBD_PID,                          /* Product ID*/                                   \
   .bcdDevice = APP_USBD_BCD_VER_MAKE(                 /* Device version BCD */                          \
       APP_USBD_DEVICE_VER_MAJOR,                                                                        \
       APP_USBD_DEVICE_VER_MINOR,                                                                        \
       APP_USBD_DEVICE_VER_SUB),                                                                         \
   .iManufacturer = APP_USBD_STRING_ID_MANUFACTURER,   /* String ID: manufacturer */                     \
   .iProduct = APP_USBD_STRING_ID_PRODUCT,             /* String ID: product */                          \
   .iSerialNumber = APP_USBD_STRING_ID_SERIAL,         /* String ID: serial */                           \
   .bNumConfigurations = 1                             /* Fixed value: only one configuration supported*/\
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;and adding these lines to sdk_config.h:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifndef APP_USBD_DEVICE_CLASS
#define APP_USBD_DEVICE_CLASS 0xFF
#endif

#ifndef APP_USBD_DEVICE_SUB_CLASS
#define APP_USBD_DEVICE_SUB_CLASS 0x00
#endif

#ifndef APP_USBD_DEVICE_PROTOCOL
#define APP_USBD_DEVICE_PROTOCOL 0x00
#endif&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Johannes&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom USB device shows up as 2 separate devices when driver not installed</title><link>https://devzone.nordicsemi.com/thread/385687?ContentTypeID=1</link><pubDate>Mon, 12 Sep 2022 10:47:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4457c40e-7f68-4a64-982c-17f880eee0a6</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]Instead of showing up as one device it shows up as 2 devices with the name of the interfaces.[/quote]
&lt;p&gt;Could you share more details on what happens?&lt;/p&gt;
&lt;p&gt;On linux, you can enable verbose mode using lsusb to see the full descriptor:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;lsusb -d VID:PID -v&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>