<?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>Changing the interface number of devices of a composite device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123117/changing-the-interface-number-of-devices-of-a-composite-device</link><description>I have a project am I working on which is 3 HID devices and 1 CDC device. That is working just fine. It is a composite device so everything has its own interface(3 for HID, and 2 for CDC) however the problem I have been having is that I need a specific</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Jul 2025 16:51:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123117/changing-the-interface-number-of-devices-of-a-composite-device" /><item><title>RE: Changing the interface number of devices of a composite device</title><link>https://devzone.nordicsemi.com/thread/543241?ContentTypeID=1</link><pubDate>Tue, 22 Jul 2025 16:51:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d40b6b3-b2e9-4d96-a04c-5630c077fdae</guid><dc:creator>tommybdog</dc:creator><description>&lt;p&gt;Perfect thanks that was it! One thing to note if people find this because I was unable to find it in documentation anywhere. When using:&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;span&gt;usbd_register_class&lt;/span&gt;&lt;span&gt;(&lt;/span&gt;&lt;span&gt;struct&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;usbd_context&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;uds_ctx&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;char&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;*&lt;/span&gt;&lt;span&gt;name&lt;/span&gt;&lt;span&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;enum&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;usbd_speed&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;speed&lt;/span&gt;&lt;span&gt;, &lt;/span&gt;&lt;span&gt;const&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;uint8_t&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;cfg&lt;/span&gt;&lt;span&gt;)&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;The name part will always be the type of device and instance. So for me declaring HID stuff, the first name is &amp;quot;hid_0&amp;quot; then &amp;quot;hid_1&amp;quot; and so on. CDC is then &amp;quot;cdc_acm_0&amp;quot;. It does not matter what they are named in the devicetree.&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing the interface number of devices of a composite device</title><link>https://devzone.nordicsemi.com/thread/543093?ContentTypeID=1</link><pubDate>Tue, 22 Jul 2025 06:22:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:64f7391d-39af-4275-8e76-d327509ffe57</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I received this suggestion from one of our developers:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;span style="font-family:Arial, Helvetica, sans-serif;"&gt;&amp;quot;&lt;/span&gt;sample_usbd_init_device()&lt;/code&gt;should not be used in this case. Copy the contents of &lt;code&gt;sample_usbd_init_device()&lt;/code&gt; to the application, and replace &lt;code&gt;usbd_register_all_classes()&lt;/code&gt; with the individual class registrations in the desired order.&lt;/p&gt;
&lt;p&gt;Class removal after calling &lt;code&gt;sample_usbd_init_device()&lt;/code&gt; does not work because the interfaces and endpoints are assigned in &lt;code&gt;usbd_init()&lt;/code&gt; -&amp;gt; &lt;code&gt;usbd_device_init_core()&lt;/code&gt; -&amp;gt; &lt;code&gt;usbd_init_configurations()&lt;/code&gt; -&amp;gt; &lt;code&gt;init_configuration()&lt;/code&gt;, and &lt;code&gt;usbd_init()&lt;/code&gt; is called inside &lt;code&gt;sample_usbd_init_device()&amp;quot;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Changing the interface number of devices of a composite device</title><link>https://devzone.nordicsemi.com/thread/542976?ContentTypeID=1</link><pubDate>Mon, 21 Jul 2025 09:22:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcfa6d30-5fd2-4310-881d-2e93e4fb31de</guid><dc:creator>tommybdog</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_USB_DEVICE_STACK_NEXT=y
CONFIG_USB_DEVICE_STACK=n
CONFIG_USBD_HID_SUPPORT=y

CONFIG_LOG=y
CONFIG_USBD_LOG_LEVEL_WRN=y
CONFIG_USBD_HID_LOG_LEVEL_WRN=y
CONFIG_UDC_DRIVER_LOG_LEVEL_WRN=y

CONFIG_SAMPLE_USBD_MANUFACTURER=&amp;quot;xxx&amp;quot;
CONFIG_SAMPLE_USBD_PRODUCT=&amp;quot;xxxx&amp;quot;
CONFIG_SAMPLE_USBD_MAX_POWER=250
CONFIG_SAMPLE_USBD_20_EXTENSION_DESC=y
CONFIG_SAMPLE_USBD_SELF_POWERED=n

CONFIG_GPIO=y
CONFIG_INPUT=y

# Enhanced ShockBurst configuration
CONFIG_ESB=y
CONFIG_UART_CONSOLE=n
CONFIG_USBD_CDC_ACM_CLASS=y
##CONFIG_USBD_HID_INIT_PRIORITY=01 this didn&amp;#39;t do anything

# Prevent CDC ACM from auto-registering at boot
CONFIG_CDC_ACM_SERIAL_INITIALIZE_AT_BOOT=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;here is my prj.conf btw. I also tried setting&amp;nbsp;&lt;span&gt;CONFIG_USBD_CDC_ACM_CLASS&lt;/span&gt;&lt;span&gt;=n and then registering with what I declared in my device tree but&amp;nbsp;CDC won&amp;#39;t work at all that way&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>