<?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>USBD CDC ACM issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/33300/usbd-cdc-acm-issue</link><description>I am using SDK 15.0 with the Nordic NRF52840 development board. I wrote my own custom bootloader using CDC ACM as the transport. I am using app_usbd_cdc_acm_read_any to read the data read from the USB. The client on the other side is sending data to the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Apr 2018 18:13:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/33300/usbd-cdc-acm-issue" /><item><title>RE: USBD CDC ACM issue</title><link>https://devzone.nordicsemi.com/thread/129043?ContentTypeID=1</link><pubDate>Thu, 19 Apr 2018 18:13:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:822d44ed-e210-44b6-9431-44c6ffc74eb2</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Is your project based on the USB CDC ACM bootloader in SDK 15?&lt;br /&gt;What version of the nRF52840-PDK do you have?&lt;/p&gt;
&lt;p&gt;Maybe the nrf_logs could reveal something useful. &lt;br /&gt;Let&amp;rsquo;s try to output the logs over UART, and use e.g. Putty as terminal.&lt;/p&gt;
&lt;p&gt;Please make sure that you are using the bootloader project with _debug, and that you have the following configuration in sdk_config.h :&lt;/p&gt;
&lt;p&gt;NRF_LOG_ENABLED 1&lt;br /&gt;NRF_LOG_DEFAULT_LEVEL 4&lt;br /&gt;NRF_LOG_BACKEND_UART_ENABLED 1&lt;br /&gt;NRF_LOG_BACKEND_RTT_ENABLED 0&lt;br /&gt;USBD_CONFIG_LOG_ENABLED 1&lt;br /&gt;USBD_CONFIG_LOG_LEVEL 4&lt;br /&gt;APP_USBD_CDC_ACM_CONFIG_LOG_ENABLED 1&lt;br /&gt;APP_USBD_CDC_ACM_CONFIG_LOG_LEVEL 4&lt;br /&gt;NRF_LOG_ALLOW_OVERFLOW 0&lt;/p&gt;
&lt;p&gt;Then compare the logs with, and without the delay added.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD CDC ACM issue</title><link>https://devzone.nordicsemi.com/thread/128709?ContentTypeID=1</link><pubDate>Tue, 17 Apr 2018 23:48:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:213392fc-575f-4903-bc11-7435553fcd36</guid><dc:creator>Jyoti Bhayana</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I didn&amp;#39;t add the check for NRF_ERROR_IO_PENDING because the code I showed is called when we get the event APP_USBD_CDC_ACM_USER_EVT_RX_DONE. I would think that you don&amp;#39;t want to be stuck in while loop inside the APP_USBD_CDC_ACM_USER_EVT_RX_DONE&amp;nbsp; event if the data is not available. we would only process the data which is already available in the buffer and then wait for the event APP_USBD_CDC_ACM_USER_EVT_RX_DONE&amp;nbsp; when it is IO_PENDING. That&amp;#39;s what the logic of the code above is. Let me know if there is something I misunderstood.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Jyoti&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD CDC ACM issue</title><link>https://devzone.nordicsemi.com/thread/128596?ContentTypeID=1</link><pubDate>Tue, 17 Apr 2018 09:40:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0df79785-938f-4d29-834b-6d9c074adfd4</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;First note that you can just call the read function where you expect the data - you do not have to do it inside the &lt;em&gt;APP_USBD_CDC_ACM_USER_EVT_RX_DONE&lt;/em&gt; event.&lt;/p&gt;
&lt;p&gt;Also note that calling &lt;em&gt;app_usbd_cdc_acm_read_any()&lt;/em&gt; inside a do-while loop like that is not ideal. You can also get a &lt;em&gt;NRF_ERROR_IO_PENDING&lt;/em&gt; returned. So you should at least add that to the loop ending condition.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;}while(ret == NRF_SUCCESS || ret == NRF_ERROR_IO_PENDING);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;NRF_SUCCESS - we have data in the buffer already&lt;/p&gt;
&lt;p&gt;NRF_ERROR_IO_PENDING - we would wait for another APP_USBD_CDC_ACM_USER_EVT_RX_DONE for the data&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD CDC ACM issue</title><link>https://devzone.nordicsemi.com/thread/128124?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 17:28:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5b61f83d-08f7-4bcc-b891-7210edc5b4d7</guid><dc:creator>Jyoti Bhayana</dc:creator><description>&lt;p&gt;In the previous SDK 14.2 when I used &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/group__app__usbd__cdc__acm.html?cp=4_0_0_6_11_58_8_16#ga561b9ae251955558f2439cfc4230cbe1"&gt;app_usbd_cdc_acm_read&lt;/a&gt;&amp;nbsp;I didn&amp;#39;t see any issue. But with SDk 15.0 I don&amp;#39;t want to use &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/group__app__usbd__cdc__acm.html?cp=4_0_0_6_11_58_8_16#ga561b9ae251955558f2439cfc4230cbe1"&gt;app_usbd_cdc_acm_read&lt;/a&gt;&amp;nbsp; as I don&amp;#39;t want to read just one byte at a time or fix the number of bytes to be read before&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: USBD CDC ACM issue</title><link>https://devzone.nordicsemi.com/thread/128088?ContentTypeID=1</link><pubDate>Thu, 12 Apr 2018 13:50:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3ee0d02-4a1e-4072-b3b2-5b8fbcf8d174</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Do you get the same behavior if you use &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/group__app__usbd__cdc__acm.html?cp=4_0_0_6_11_58_8_16#ga561b9ae251955558f2439cfc4230cbe1"&gt;app_usbd_cdc_acm_read&lt;/a&gt;&amp;nbsp;instead of &lt;span&gt;app_usbd_cdc_acm_read_any&lt;/span&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>