<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>Zephyr ProjectのトピックRe: FRDM-RW612 USB_DEVICE_STACK_NEXT support</title>
    <link>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2065796#M283</link>
    <description>&lt;P&gt;Hi Daniel ,&lt;/P&gt;&lt;P&gt;Thank you for getting back to me .&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; use the hid-mouse example as it is with usbd_next_proj.conf&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. use with loopback class&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1.&amp;nbsp; proj.conf&amp;nbsp;&lt;/P&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;CONFIG_LOG=y&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;CONFIG_USB_DEVICE_STACK_NEXT=y&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;CONFIG_USBD_LOOPBACK_CLASS=y&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;2.&amp;nbsp; main.c&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="c"&gt;#include "sample_usbd.h" 
/*located on zephyrproject/zephyr/samples/subsys/usb/common*/

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/usb/usbd.h&amp;gt;

#include &amp;lt;zephyr/logging/log.h&amp;gt;

LOG_MODULE_REGISTER(app, LOG_LEVEL_DBG);

static void msg_cb(struct usbd_context *const usbd_ctx,
                   const struct usbd_msg *const msg) {
  LOG_INF("USBD message: %s", 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("Failed to enable device support");
      }
    }

    if (msg-&amp;gt;type == USBD_MSG_VBUS_REMOVED) {
      if (usbd_disable(usbd_ctx)) {
        LOG_ERR("Failed to disable device support");
      }
    }
  }
}
int main(void) {
  struct usbd_context *sample_usbd;
  int ret;

  sample_usbd = sample_usbd_init_device(msg_cb);
  if (sample_usbd == NULL) {
    k_msleep(100);
    return 0;
  }

  if (!usbd_can_detect_vbus(sample_usbd)) {
    ret = usbd_enable(sample_usbd);
    {
      if (ret) {
        LOG_ERR("Failed to enable usb support !");
        return ret;
      }
    }
  }
  return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;in both cases I got&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&amp;lt;err&amp;gt; usbd_core: Failed to init device driver . &lt;/STRONG&gt;to be little more specific -12(-ENOMEM)&amp;nbsp;&lt;/P&gt;&lt;P&gt;after tracing the issue back I pin point the error to udc_mcux_init(...) function located in drivers/usb/udc/udc_mcux_ehci.c&lt;/P&gt;&lt;P&gt;to narrow it further&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        /* Init MCUX USB device driver. */
        status = mcux_if-&amp;gt;deviceInit(priv-&amp;gt;controller_id,
                &amp;amp;priv-&amp;gt;mcux_device, &amp;amp;(priv-&amp;gt;mcux_device.controllerHandle));
        if (status != kStatus_USB_Success) {
                return -ENOMEM;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 20 Mar 2025 19:22:05 GMT</pubDate>
    <dc:creator>wima88</dc:creator>
    <dc:date>2025-03-20T19:22:05Z</dc:date>
    <item>
      <title>FRDM-RW612 USB_DEVICE_STACK_NEXT support</title>
      <link>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2064972#M280</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using zephyr 4.0.0 an tried to run some samples with USB device stack next an encounter following error&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;lt;err&amp;gt; usbd_core: Failed to init device driver&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;however I ran some samples with old usb device stack.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to know if this is the expected behavior as of this zephyr version or am I missing something&amp;nbsp; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Mar 2025 20:54:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2064972#M280</guid>
      <dc:creator>wima88</dc:creator>
      <dc:date>2025-03-19T20:54:13Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-RW612 USB_DEVICE_STACK_NEXT support</title>
      <link>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2065718#M282</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;What example are you testing?&lt;/P&gt;
&lt;P&gt;Could you please share some reproduction steps?&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 16:59:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2065718#M282</guid>
      <dc:creator>DanielRuvalcaba</dc:creator>
      <dc:date>2025-03-20T16:59:23Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-RW612 USB_DEVICE_STACK_NEXT support</title>
      <link>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2065796#M283</link>
      <description>&lt;P&gt;Hi Daniel ,&lt;/P&gt;&lt;P&gt;Thank you for getting back to me .&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried the following&amp;nbsp;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; use the hid-mouse example as it is with usbd_next_proj.conf&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2. use with loopback class&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 1.&amp;nbsp; proj.conf&amp;nbsp;&lt;/P&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;CONFIG_LOG=y&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;CONFIG_USB_DEVICE_STACK_NEXT=y&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;CONFIG_USBD_LOOPBACK_CLASS=y&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-60px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;2.&amp;nbsp; main.c&lt;/DIV&gt;&lt;DIV class="lia-indent-padding-left-30px"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;LI-CODE lang="c"&gt;#include "sample_usbd.h" 
/*located on zephyrproject/zephyr/samples/subsys/usb/common*/

#include &amp;lt;zephyr/kernel.h&amp;gt;
#include &amp;lt;zephyr/usb/usbd.h&amp;gt;

#include &amp;lt;zephyr/logging/log.h&amp;gt;

LOG_MODULE_REGISTER(app, LOG_LEVEL_DBG);

static void msg_cb(struct usbd_context *const usbd_ctx,
                   const struct usbd_msg *const msg) {
  LOG_INF("USBD message: %s", 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("Failed to enable device support");
      }
    }

    if (msg-&amp;gt;type == USBD_MSG_VBUS_REMOVED) {
      if (usbd_disable(usbd_ctx)) {
        LOG_ERR("Failed to disable device support");
      }
    }
  }
}
int main(void) {
  struct usbd_context *sample_usbd;
  int ret;

  sample_usbd = sample_usbd_init_device(msg_cb);
  if (sample_usbd == NULL) {
    k_msleep(100);
    return 0;
  }

  if (!usbd_can_detect_vbus(sample_usbd)) {
    ret = usbd_enable(sample_usbd);
    {
      if (ret) {
        LOG_ERR("Failed to enable usb support !");
        return ret;
      }
    }
  }
  return 0;
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;in both cases I got&amp;nbsp;&amp;nbsp;&lt;STRONG&gt;&amp;nbsp;&amp;lt;err&amp;gt; usbd_core: Failed to init device driver . &lt;/STRONG&gt;to be little more specific -12(-ENOMEM)&amp;nbsp;&lt;/P&gt;&lt;P&gt;after tracing the issue back I pin point the error to udc_mcux_init(...) function located in drivers/usb/udc/udc_mcux_ehci.c&lt;/P&gt;&lt;P&gt;to narrow it further&lt;/P&gt;&lt;LI-CODE lang="c"&gt;        /* Init MCUX USB device driver. */
        status = mcux_if-&amp;gt;deviceInit(priv-&amp;gt;controller_id,
                &amp;amp;priv-&amp;gt;mcux_device, &amp;amp;(priv-&amp;gt;mcux_device.controllerHandle));
        if (status != kStatus_USB_Success) {
                return -ENOMEM;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Mar 2025 19:22:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2065796#M283</guid>
      <dc:creator>wima88</dc:creator>
      <dc:date>2025-03-20T19:22:05Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-RW612 USB_DEVICE_STACK_NEXT support</title>
      <link>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2067551#M286</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you use the HID mouse example as is, does it work?&lt;/P&gt;
&lt;P&gt;Could you please try using Zephyr 4.1.0?&lt;/P&gt;
&lt;P&gt;Is this custom code? If not, could you please point me where did you get it?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Mar 2025 21:37:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2067551#M286</guid>
      <dc:creator>DanielRuvalcaba</dc:creator>
      <dc:date>2025-03-24T21:37:20Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-RW612 USB_DEVICE_STACK_NEXT support</title>
      <link>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2068791#M291</link>
      <description>&lt;P&gt;Hi Daniel,&lt;/P&gt;&lt;P&gt;I tried it with zephyr 4.1.0,&amp;nbsp;&lt;/P&gt;&lt;P&gt;still seen the same error code, according to &lt;A href="https://docs.zephyrproject.org/latest/releases/migration-guide-4.1.html" target="_self"&gt;4.1.0 migration guide&amp;nbsp;&lt;/A&gt;&amp;nbsp; not much been change in zephyr USB side&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I use HID-mouse as it is USB stack is initializing properly and I can see device enumeration on host.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wimansha&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 15:08:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2068791#M291</guid>
      <dc:creator>wima88</dc:creator>
      <dc:date>2025-03-26T15:08:17Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-RW612 USB_DEVICE_STACK_NEXT support</title>
      <link>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2068896#M292</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I found the following issue in the Github repo&amp;nbsp;&lt;A href="https://github.com/zephyrproject-rtos/zephyr/issues/86409" target="_blank"&gt;NXP USB drivers don't work with usb_next · Issue #86409 · zephyrproject-rtos/zephyr&lt;/A&gt;. Looks like this has already been reported.&lt;/P&gt;
&lt;P&gt;Could you please confirm is the same issue?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Daniel&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 17:49:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2068896#M292</guid>
      <dc:creator>DanielRuvalcaba</dc:creator>
      <dc:date>2025-03-26T17:49:12Z</dc:date>
    </item>
    <item>
      <title>Re: FRDM-RW612 USB_DEVICE_STACK_NEXT support</title>
      <link>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2069034#M293</link>
      <description>&lt;P&gt;Thanks Daniel, I follow the issue. I was about to create a issue on git&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wimansha&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Mar 2025 23:24:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Zephyr-Project/FRDM-RW612-USB-DEVICE-STACK-NEXT-support/m-p/2069034#M293</guid>
      <dc:creator>wima88</dc:creator>
      <dc:date>2025-03-26T23:24:18Z</dc:date>
    </item>
  </channel>
</rss>

