<?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>app_usbd_cdc_acm_write takes more time to transfer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83702/app_usbd_cdc_acm_write-takes-more-time-to-transfer</link><description>Hi team, 
 I&amp;#39;m streaming the sensor data through USB (using hterm) every 2.5ms. 
 i have configures USB as CDC and using virtual COM port. 
 In each iteration, i transfer 87 to 95 bytes which varies based on data. 
 The issue i&amp;#39;m facing is that sometimes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 20 Jan 2022 14:42:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83702/app_usbd_cdc_acm_write-takes-more-time-to-transfer" /><item><title>RE: app_usbd_cdc_acm_write takes more time to transfer</title><link>https://devzone.nordicsemi.com/thread/348757?ContentTypeID=1</link><pubDate>Thu, 20 Jan 2022 14:42:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e256fee-69ee-4ef7-8c97-fe4a30c592d3</guid><dc:creator>Turbo J</dc:creator><description>&lt;p&gt;Pretty sure that is just the missing zero packet after a complete 64 Byte packet.&lt;/p&gt;
&lt;p&gt;USB bulk transactions end with a packet that is not the full 64 bytes in size. Most USB CDC examples do not&amp;nbsp; implement this feature (from the USB bulk spec). If you wanted to run a transaction with an integer multiple of 64 bytes, you have to send a &amp;quot;zero packet&amp;quot; in order to properly &amp;quot;finish&amp;quot; the transaction. Otherwise the host will not return the data to the application, and the timeout is several seconds AFAIK.&lt;/p&gt;
&lt;p&gt;The NRF CDC implementation is buffered IIRC, and can thus run multiple full 64 byte packets when the amount of data transmitted happens to be an integer multiple.&lt;/p&gt;
&lt;p&gt;You longer 30ms delay is a result of a long 64 byte packets run, followed by one shorter packet. Should be visible in an USB analyzer app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_usbd_cdc_acm_write takes more time to transfer</title><link>https://devzone.nordicsemi.com/thread/348748?ContentTypeID=1</link><pubDate>Thu, 20 Jan 2022 14:26:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9e4bc41-7383-4c28-9caf-be5aee35b428</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you let me know what kind of device it is that is causing the 30ms delays?&lt;br /&gt;Do you know which USB class it is using?&lt;/p&gt;
&lt;p&gt;If you have a USB sniffer available you might be able to get more information about what is blocking the bus for so long, but this is not something most people have laying around ;)&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: app_usbd_cdc_acm_write takes more time to transfer</title><link>https://devzone.nordicsemi.com/thread/348517?ContentTypeID=1</link><pubDate>Wed, 19 Jan 2022 13:23:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6e437c24-5cb3-4cdc-8559-1a51aee7867b</guid><dc:creator>john.ashok</dc:creator><description>[quote userid="2116" url="~/f/nordic-q-a/83702/app_usbd_cdc_acm_write-takes-more-time-to-transfer/348079#348079"]If so, are you able to&amp;nbsp;run a test without any other connected USB devices to see if the erratic write times disappear?[/quote]
&lt;p&gt;yes when only one usb device is connected it didn&amp;#39;t take 30ms and all but varies from 153 us o 615 us&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: app_usbd_cdc_acm_write takes more time to transfer</title><link>https://devzone.nordicsemi.com/thread/348079?ContentTypeID=1</link><pubDate>Mon, 17 Jan 2022 14:20:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:12e06a97-cdf6-47e5-942a-0ef074706c83</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Do you have any other USB devices connected while running this test?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If so, are you able to&amp;nbsp;run a test without any other connected USB devices to see if the erratic write times disappear?&lt;/p&gt;
&lt;p&gt;The CDC class uses USB bulk transfers, which means you are not guaranteed bandwidth or latency, only data integrity (that all the data you send is received successfully, and in the same order).&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></channel></rss>