<?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 NEXT loopback class with linux testusb util</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/119613/usb-next-loopback-class-with-linux-testusb-util</link><description>HI all, 
 I&amp;#39;m trying to run the USB next stack-based loopback class with Linux testusb. and only very few of them been passed and everything else been timed out. 
 I confirmed that device descriptor is correct and I replaced the loopback.c that been shipped</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 12 Mar 2025 13:54:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/119613/usb-next-loopback-class-with-linux-testusb-util" /><item><title>RE: USB NEXT loopback class with linux testusb util</title><link>https://devzone.nordicsemi.com/thread/526959?ContentTypeID=1</link><pubDate>Wed, 12 Mar 2025 13:54:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0cf176e-cf3c-4f4d-aa85-86e3adad4736</guid><dc:creator>bb_elaDial</dc:creator><description>&lt;p&gt;Hi Hieu,&lt;/p&gt;
&lt;p&gt;USB hell is working to an extent that I can get a better understanding of the loopback.c&amp;nbsp; (Since Shell commands also using content of&amp;nbsp; loopback.c).&amp;nbsp; but as far as linux-testusb goes I cannot get it to working. I will monitor the pull request. Thank you&amp;nbsp;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB NEXT loopback class with linux testusb util</title><link>https://devzone.nordicsemi.com/thread/526591?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 14:55:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8b572199-488b-426b-9c74-1092b9a65405</guid><dc:creator>bb_elaDial</dc:creator><description>&lt;p&gt;sample_usbd_init_device is comming from&amp;nbsp;&lt;span&gt;zephyr\samples\subsys\usb\common\.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;You are right about the zephyr-testusb it,s not using the Next stack.&amp;nbsp; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I found the following commit&amp;nbsp; &amp;nbsp;&lt;a href="https://github.com/zephyrproject-rtos/zephyr/pull/85929"&gt;samples: usb: testusb: use new USB device stack by jfischer-no &amp;middot; Pull Request #85929 &amp;middot; zephyrproject-rtos/zephyr&lt;/a&gt;&amp;nbsp;tring to do exactly what I want. but it was not merged yet.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;let me try the shell example and get back to you, Thanks for assist&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB NEXT loopback class with linux testusb util</title><link>https://devzone.nordicsemi.com/thread/526567?ContentTypeID=1</link><pubDate>Mon, 10 Mar 2025 13:41:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c96184b4-8280-4018-8d42-79e7f326f255</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Is&amp;nbsp;sample_usbd_init_device a custom function from you?&lt;/p&gt;
&lt;p&gt;I looked into the testusb sample, and it doesn&amp;#39;t&amp;nbsp;use the Next stack by default. See&amp;nbsp;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/subsys/usb/testusb/prj.conf"&gt;testusb/prj.conf&lt;/a&gt;.&lt;br /&gt;The USB Shell sample &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/main/samples/subsys/usb/shell/prj.conf"&gt;uses the Next stacks and also supports the Loopback class though&lt;/a&gt;.&amp;nbsp;Could you please give it a try?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB NEXT loopback class with linux testusb util</title><link>https://devzone.nordicsemi.com/thread/526393?ContentTypeID=1</link><pubDate>Fri, 07 Mar 2025 15:29:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa335808-c6c6-4a43-8534-292362478671</guid><dc:creator>bb_elaDial</dc:creator><description>&lt;p&gt;Hi Hieu,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Apiologies for, not properly describing the testing process.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not using any samples provided with zephyr.&lt;/p&gt;
&lt;p&gt;however, I&amp;#39;m using zephyr\samples\subsys\usb\common as my initiating functions.&lt;/p&gt;
&lt;p&gt;with&amp;nbsp;zephyr\subsys\usb\device_next\class\loopback.c by Enabling the CONFIG_USBD_LOOPBACK_CLASS and&amp;nbsp;CONFIG_USB_DEVICE_STACK_NEXT.&lt;/p&gt;
&lt;p&gt;I did replace the ncs2.9 loopback.c file with one in the mainstream. due to missing functions that needed&amp;nbsp;&lt;/p&gt;
&lt;div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;&lt;span&gt;my main.c is&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;static void msg_cb(struct usbd_context *const usbd_ctx,
                   const struct usbd_msg *const msg)
{
        LOG_INF(&amp;quot;USBD message: %s&amp;quot;, usbd_msg_type_string(msg-&amp;gt;type));

        if (usbd_can_detect_vbus(usbd_ctx))
        {
                if (msg-&amp;gt;type == USBD_MSG_VBUS_READY)
                {
                        if (usbd_enable(usbd_ctx))
                        {
                                LOG_ERR(&amp;quot;Failed to enable device support&amp;quot;);
                        }
                }

                if (msg-&amp;gt;type == USBD_MSG_VBUS_REMOVED)
                {
                        if (usbd_disable(usbd_ctx))
                        {
                                LOG_ERR(&amp;quot;Failed to disable device support&amp;quot;);
                        }
                }
        }
}
int main(void)
{
        struct usbd_context *sample_usbd;
        int ret;

        sample_usbd = sample_usbd_init_device(msg_cb);

        if (!usbd_can_detect_vbus(sample_usbd))
        {
                ret = usbd_enable(sample_usbd);
                {
                        if (ret)
                        {
                                LOG_ERR(&amp;quot;Failed to enable usb support !&amp;quot;);
                                return ret;
                        }
                }
        }
        return 0;
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Yes, I&amp;#39;m using the test that you mentioned above.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;even though above test(s) failing ,&amp;nbsp; I managed to do vender request loopback and blk-out transaction with libusb (lusb-1.0) based application&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;before approaching this method I also ran the zephyr-testusb sample that included with ncs2.9&amp;nbsp; against linux-testusb and it passes all the tests. which also based on usb next api (If I correctly understand the sample)&lt;/p&gt;
&lt;p&gt;so I&amp;#39;m curious to know, compatibility of loopback class with linux-testusb.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB NEXT loopback class with linux testusb util</title><link>https://devzone.nordicsemi.com/thread/526328?ContentTypeID=1</link><pubDate>Fri, 07 Mar 2025 11:08:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0d40c97-61ba-4fd3-8e4a-c0c1096f55a6</guid><dc:creator>Hieu</dc:creator><description>&lt;p&gt;Hi bb_elaDial,&lt;/p&gt;
&lt;p&gt;I would like to confirm&amp;nbsp;a few details to&amp;nbsp;figure out a direction with this.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Are you running the&amp;nbsp;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-2.9.0/page/zephyr/samples/subsys/usb/cdc_acm/README.html#usb-cdc-acm"&gt;USB CDC-ACM&lt;/a&gt;&amp;nbsp;sample with &lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v3.7.99-ncs2/samples/subsys/usb/cdc_acm/usbd_next_prj.conf"&gt;usbd_next_prj.conf&lt;/a&gt;? &lt;br /&gt;On the Linux end, by testusb, do you mean this?&amp;nbsp;&lt;a href="https://github.com/torvalds/linux/blob/master/tools/usb/testusb.c"&gt;linux/tools/usb/testusb.c at master · torvalds/linux&lt;/a&gt;&lt;br /&gt;Could you describe the test in more details?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;When you say that only a few of them passed, how are you testing here? Are you testing one nRF device against multiple PCs, or are you testing multiple nRF devices against one PC?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Do you observe this on a Development Kit or on a custom hardware? If it&amp;#39;s on a custom hardware, can you reproduce the issue on a Development Kit?&lt;br /&gt;&lt;br /&gt;&lt;/li&gt;
&lt;li&gt;Do things work without using the USB Next stack?&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Hieu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>