<?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>Fast data transfer through USB</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/123672/fast-data-transfer-through-usb</link><description>Hello 
 Im trying to send data[3000] using USB, problem is I need to finish transfer within 13ms because after that period new data is ready to be sent. In this Interrupt Im using first or second half of baffer to be send in main faction This is communication_send_adc_data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Aug 2025 12:43:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/123672/fast-data-transfer-through-usb" /><item><title>RE: Fast data transfer through USB</title><link>https://devzone.nordicsemi.com/thread/546630?ContentTypeID=1</link><pubDate>Mon, 25 Aug 2025 12:43:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9c6346c-df40-495e-9ce4-caee4917a18c</guid><dc:creator>Petar02</dc:creator><description>&lt;p&gt;Everything is working fine i just forgot when u start transfer if serial monitor is not open fifo cant &amp;quot;drain&amp;quot;, cant send data to PC, so i just added this to my code to wait until serial monitor is open.&lt;pre class="ui-code" data-mode="text"&gt;uint32_t dtr = 0;
    while (!dtr) {
        uart_line_ctrl_get(usb_uart_device, UART_LINE_CTRL_DTR, &amp;amp;dtr);  //nije radilo dok ne drzis port otvorenim.
        k_sleep(K_MSEC(100)); //12.8ms novi podaci
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fast data transfer through USB</title><link>https://devzone.nordicsemi.com/thread/545790?ContentTypeID=1</link><pubDate>Fri, 15 Aug 2025 13:23:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7490ee57-49ea-4f4b-955d-3bd28bdaf9fd</guid><dc:creator>Petar02</dc:creator><description>&lt;p&gt;Yes Im using code ftom those examples for USB CDC-ACM and im trying to send 3000B every 13ms, and i should get 200kB/s, but for some reasone Im only getting sizeof(RING_BUF_SIZE)B/s. I modife a little bit a&amp;nbsp;interrupt_handler by changing part for uart_irq_tx_ready&amp;nbsp;&lt;pre class="ui-code" data-mode="text"&gt;if (uart_irq_tx_ready(dev)) {
            do {
                int rb_len, send_len;
                uint8_t *blk;

                
                rb_len = ring_buf_get_claim(&amp;amp;ringbuf_tx, &amp;amp;blk, 256);
                if (rb_len == 0) {
                    uart_irq_tx_disable(dev);
                    break; 
                }

                
                send_len = uart_fifo_fill(dev, blk, rb_len);

                
                ring_buf_get_finish(&amp;amp;ringbuf_tx, send_len);

                sent_counter += send_len;

                
                if (send_len &amp;lt; rb_len) {
                    break; // FIFO full
                }

            } while (uart_irq_tx_ready(dev)); // prazni dok ima mesta u FIFO-u
        }
    }&lt;/pre&gt; Im using send_len to check how many B did I send after 1s.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fast data transfer through USB</title><link>https://devzone.nordicsemi.com/thread/545769?ContentTypeID=1</link><pubDate>Fri, 15 Aug 2025 10:56:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3cf07103-51cd-42c0-811c-f3073fdf03e3</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Yes, that should not be a problem no.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fast data transfer through USB</title><link>https://devzone.nordicsemi.com/thread/545761?ContentTypeID=1</link><pubDate>Fri, 15 Aug 2025 10:32:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:32b86146-ced9-403d-8f3d-cec2877944d4</guid><dc:creator>Petar02</dc:creator><description>&lt;p&gt;Can I use uart for logging and USB CDC ACM for data transfer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fast data transfer through USB</title><link>https://devzone.nordicsemi.com/thread/545701?ContentTypeID=1</link><pubDate>Thu, 14 Aug 2025 15:31:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da17338d-6cc1-4a29-8d93-1d4b514e7f05</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry, I don&amp;#39;t understand the debugging messages or comments.&lt;/p&gt;
&lt;p&gt;I think the best suggestion I have is to look at the existing USB examples that already exists:&lt;br /&gt;&lt;a href="https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/index.html#usb_device_support"&gt;https://docs.nordicsemi.com/bundle/ncs-latest/page/zephyr/samples/index.html#usb_device_support&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The USB CDC ACM examples are usually a good starting point since the use bulk transfer, which overall is a quick way to transfer data. Do be aware logging itself can impact execution time depending on interface and configuration.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>