<?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>nRF5340: issue with USB CDC ACM and UART driver running in parallel</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/105599/nrf5340-issue-with-usb-cdc-acm-and-uart-driver-running-in-parallel</link><description>Hello, guys. 
 We need USB CDC ACM and UART driver with DMA to run in parallel as two different nodes in the device tree. 
 For that purpose, here is what we have in the prj.conf file: 
 
 and the .overlay file 
 
 UART2 is used for USB CDC ACM driver</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Nov 2024 09:54:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/105599/nrf5340-issue-with-usb-cdc-acm-and-uart-driver-running-in-parallel" /><item><title>RE: nRF5340: issue with USB CDC ACM and UART driver running in parallel</title><link>https://devzone.nordicsemi.com/thread/511255?ContentTypeID=1</link><pubDate>Wed, 20 Nov 2024 09:54:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd7b1fb9-3e71-4fae-a0ef-28734a433d4e</guid><dc:creator>Sanscho325</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;&lt;br /&gt;&lt;span&gt;I have the same problem, was a solution found here?&lt;br /&gt;&lt;br /&gt;Sincerely,&lt;br /&gt;&lt;/span&gt;&lt;span&gt;Sanscho&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340: issue with USB CDC ACM and UART driver running in parallel</title><link>https://devzone.nordicsemi.com/thread/458163?ContentTypeID=1</link><pubDate>Wed, 29 Nov 2023 15:51:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e33aac02-ab35-4500-95b1-ea6962761d99</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I will continue to help with this case.&lt;/p&gt;
&lt;p&gt;I tried to run your sample with nRF Connect SDK v1.9.1, but got no logs from the normal port on my nRF5340DK.&lt;/p&gt;
&lt;p&gt;Did I misunderstand something here?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340: issue with USB CDC ACM and UART driver running in parallel</title><link>https://devzone.nordicsemi.com/thread/457407?ContentTypeID=1</link><pubDate>Sat, 25 Nov 2023 11:30:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecc8d146-7e6d-4240-a659-6915a68b4860</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello,&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/members/ovrebekk"&gt;ovrebekk&lt;/a&gt;&amp;nbsp;.&lt;/p&gt;
&lt;p&gt;Sorry for the late reply from my side.&lt;/p&gt;
&lt;p&gt;Attached you can find the part of the project that you can use to explore the conflict between regular UART and virtual CDC ACM UART. We used nRF5340-DK for testing.&lt;/p&gt;
&lt;p&gt;If in the &lt;span style="background-color:#ccffff;"&gt;&lt;em&gt;&lt;strong&gt;prj.conf&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; file the following lines are set to&lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;&lt;strong&gt; =n&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#BME280
CONFIG_USE_BME280=n

#USB transfer
CONFIG_USB_DEVICE_STACK=n &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;virtual CDC ACM UART will be disabled and regular UART will work as expected.&lt;/p&gt;
&lt;p&gt;If the above lines are set to &lt;span style="background-color:#ccffcc;"&gt;&lt;em&gt;&lt;strong&gt;=y&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; (virtual CDC ACM UART enabled), the regular UART will not work.&lt;/p&gt;
&lt;p&gt;&lt;span style="background-color:#ff99cc;"&gt;&lt;em&gt;&lt;strong&gt;uart_callback_set()&lt;/strong&gt;&lt;/em&gt;&lt;/span&gt; function will return &lt;strong&gt;134&lt;/strong&gt; (&lt;strong&gt;ENOTSUP&lt;/strong&gt;).&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1700912086852v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Please let me know if you need anything else from my side. Thanks in advance for taking a look into the codebase and let us know your opinion.&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;br /&gt;Bojan.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/cpuapp.zip"&gt;devzone.nordicsemi.com/.../cpuapp.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340: issue with USB CDC ACM and UART driver running in parallel</title><link>https://devzone.nordicsemi.com/thread/456015?ContentTypeID=1</link><pubDate>Thu, 16 Nov 2023 15:09:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5294f9fc-4761-424c-b096-981f0d9f7f2a</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi Bojan&lt;/p&gt;
&lt;p&gt;Any chance you can share your example with me so I can try to reproduce the issue on my end?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If so, please just zip the project folder and attach it to your reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you don&amp;#39;t want to share your code in a public case just let me know, and I can make the case private.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340: issue with USB CDC ACM and UART driver running in parallel</title><link>https://devzone.nordicsemi.com/thread/455837?ContentTypeID=1</link><pubDate>Wed, 15 Nov 2023 18:59:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb0c5495-0cae-463f-ae27-d77a4dfb2315</guid><dc:creator>bojan</dc:creator><description>&lt;p&gt;Hello, &lt;a href="https://devzone.nordicsemi.com/members/ovrebekk"&gt;ovrebekk&lt;/a&gt; .&lt;/p&gt;
&lt;p&gt;Thanks for your feedback.&lt;/p&gt;
&lt;p&gt;uart_dev is installed the following way:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    uart_dev =  device_get_binding(DT_LABEL(DT_NODELABEL(uart3)));
	if (uart_dev == NULL) {
		LOG_ERR(&amp;quot;Could not find  %s!\n\r&amp;quot;,DT_LABEL(DT_NODELABEL(uart3)));
        return -1;		
	}

    ret = uart_callback_set(uart_dev, &amp;amp;uart_cb, NULL);
    if (ret != 0) {
		LOG_ERR(&amp;quot;uart_callback_set: %d&amp;quot;, ret);
        return ret;
	}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;On the other side, here is the part of CDC ACM UART initialization:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;uart_irq_callback_user_data_set(dev, interrupt_handler, NULL);

dev = DEVICE_DT_GET_ONE(zephyr_cdc_acm_uart);
if (!device_is_ready(dev)) {
	LOG_ERR(&amp;quot;CDC ACM device not ready&amp;quot;);
	return;
}

ret = usb_enable(NULL);
if (ret != 0) {
	LOG_ERR(&amp;quot;Failed to enable USB&amp;quot;);
	return;
}
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;CDC ACM UART is using interrupt-driven UART. Should I have the following line in the prj.conf:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_UART_INTERRUPT_DRIVEN=y&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;?&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have it at the moment.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sincerely,&lt;br /&gt;Bojan.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF5340: issue with USB CDC ACM and UART driver running in parallel</title><link>https://devzone.nordicsemi.com/thread/455422?ContentTypeID=1</link><pubDate>Mon, 13 Nov 2023 22:01:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dc52f892-864e-4a2c-b1e5-11e32b849db9</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It should be possible to combine regular UART&amp;#39;s with virtual CDC ACM UART&amp;#39;s at the same time.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is there any chance that the uart_dev device could be the CDC ACM UART?&lt;br /&gt;The CDC ACM driver does not support the ASYNC API, and will return ENOTSUP if you try to enable the callback.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;How is uart_dev initialized?&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>