<?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>device initialization problems</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69596/device-initialization-problems</link><description>Hi everyone, I made a custom class composite device. The firmware seems to work except for one thing I can&amp;#39;t fix. If I initialize the USB in the following way:

 If instead I initialize by doing: the part relating to the custom class device works but</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 Jun 2022 11:03:20 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69596/device-initialization-problems" /><item><title>RE: device initialization problems</title><link>https://devzone.nordicsemi.com/thread/372103?ContentTypeID=1</link><pubDate>Mon, 13 Jun 2022 11:03:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:712ac123-119c-4fff-b7bb-9f4b4fc6d72f</guid><dc:creator>Deep_Bang</dc:creator><description>&lt;p&gt;so, cant we use both together ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB device initialization problems</title><link>https://devzone.nordicsemi.com/thread/285685?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 15:28:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd881690-e1cc-4ae1-965e-0122047b2e6e</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;So if you call&amp;nbsp;&lt;span&gt;nrf_drv_usbd_init() in your application, the app_usbd library will not receive any events from the USBD peripheral, as the driver are only sending the events to the handler you defined in your application. The internal handler in app_usbd will not receive any events, and thus the library will not function correctly.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Similar, if you only call app_usbd_init, the handler in your application where you expect to receive events from the driver will not receive any events.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB device initialization problems</title><link>https://devzone.nordicsemi.com/thread/285623?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 12:40:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:766b6c0d-7844-470f-876f-7c40ccaf20b1</guid><dc:creator>alexl&amp;#246;ddek&amp;#246;pinge</dc:creator><description>[quote userid="14926" url="~/f/nordic-q-a/69596/usb-device-initialization-problems/285621#285621"]I assumed that you was using the CDC ACM implementation through the app_usbd (&lt;a title="USB CDC ACM module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_usbd_class_cdc.html?cp=7_1_3_56_8_3"&gt;USB CDC ACM module&lt;/a&gt;), while the custom class device was implemented through the driver directly, but I may have misunderstood you.[/quote]
&lt;p&gt;Yes, I use CDC ACM implementation through the app_usbd and the custom class implementetion through driver directly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB device initialization problems</title><link>https://devzone.nordicsemi.com/thread/285621?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 12:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71e86d16-8139-4975-be52-b0c72023d1ad</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;I assumed that you was using the CDC ACM implementation through the app_usbd (&lt;a title="USB CDC ACM module" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_usbd_class_cdc.html?cp=7_1_3_56_8_3"&gt;USB CDC ACM module&lt;/a&gt;), while the custom class device was implemented through the driver directly, but I may have misunderstood you. Is the custom device also implemented through the app_usbd library?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USB device initialization problems</title><link>https://devzone.nordicsemi.com/thread/285611?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 12:22:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ba6f07e-b421-43d1-85ab-554c84d1501b</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;app_usbd_init() will internally call&amp;nbsp;nrf_drv_usbd_init() with the library&amp;#39;s own event handler. If you call&amp;nbsp;nrf_drv_usbd_init() again outside of the library, the function will return an error code.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you need to use both, you need to initialize the USBD driver outside of the app_usbd library and pass the events from the driver to the library yourself. I have not tested this, so I cannot comment on how easy it is to achieve and how well it will work. The handler you pass to the app_usbd config is for the library to send events back to the application, it is not related to the handler you pass to the driver, which pass events from the driver back to the application. app_usbd has its own internal handler where it receives events from the USBD driver.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>