<?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>Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92979/add-cdc-class-to-the-usb-device-example</link><description>I am developing a USB keyboard + mouse using a NRF52833. I have use the USB Device Example from nRF5 SDK v17.1.0. I chose this example because my project is in C++ and had problems compiling the USB HID Composite Example regarding to &amp;quot;designator order</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 09 Nov 2022 12:39:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92979/add-cdc-class-to-the-usb-device-example" /><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/394908?ContentTypeID=1</link><pubDate>Wed, 09 Nov 2022 12:39:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2207c7a-6852-4e2d-8d96-17dcb0371fc3</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Is it still printing like this?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; cdc_acm: EPOUT_DATA: 04 done
&amp;lt;info&amp;gt; app: -&amp;gt; Rx 3 Bytes = 23&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you sure it is not the logger itself that is blocked or otherwise showing the incorrect data? Since the amount of bytes is correct, it might be that the logger is having buffering issues when printing, while the actual data is present in a normalized format.&lt;/p&gt;
&lt;p&gt;Try catching the scenario by parsing the data (ie. check for content &amp;quot;231&amp;quot;) instead of plain printing it.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/394222?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2022 15:18:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff00be9c-0829-4756-aa98-19bca209e53b</guid><dc:creator>driverGuy</dc:creator><description>&lt;p&gt;Those variables are already static volatile and yes I have tried reading all the buffer at once with the same results and then switch to reading Byte by Byte as this es the most common way seen in the forum examples.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/394210?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2022 14:59:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a80e1949-6394-481c-a848-a25139aaa1b6</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Have you tried just reading the whole buffer instead of byte-by-byte?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;There seems to be something that goes wrong in the&amp;nbsp;main.c logic, as seen by your results by looking at the internal buffers as well, so it might be beneficial to declare your variables used in different scopes as volatile (ie. flag_rx_done and num_bytes)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/393935?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 14:13:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea10956c-dde1-49eb-af4a-f5bc74c41719</guid><dc:creator>driverGuy</dc:creator><description>&lt;p&gt;That flag is already enabled:&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1667484065916v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;Also I have deleted all the logs inside the event handler and print the Rx buffer in the main but it still does not work:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void usb_cdc_ev_handler(app_usbd_class_inst_t const *p_inst, app_usbd_cdc_acm_user_event_t event)
{
    app_usbd_cdc_acm_t const * p_cdc_acm = app_usbd_cdc_acm_class_get(p_inst);

    switch (event)
    {
        case APP_USBD_CDC_ACM_USER_EVT_PORT_OPEN:
            /*
                Setup first transfer.
                If it does not do this, no Bytes can be received later.
            */
            app_usbd_cdc_acm_read(&amp;amp;serial_cdc_class, serial_rx_buffer, 1);
            break;

        case APP_USBD_CDC_ACM_USER_EVT_PORT_CLOSE:
            break;

        case APP_USBD_CDC_ACM_USER_EVT_TX_DONE:
            break;

        case APP_USBD_CDC_ACM_USER_EVT_RX_DONE:
            {
                ret_code_t ret;
                num_bytes = 0;
                do
                {
                    ret = app_usbd_cdc_acm_read(&amp;amp;serial_cdc_class, &amp;amp;serial_rx_buffer[num_bytes++], 1);
                } while (ret == NRF_SUCCESS);  // Fetch data until internal buffer is empty.

                serial_rx_buffer[num_bytes] = &amp;#39;\0&amp;#39;;

                flag_rx_done = true;
            }
            break;

        default:
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is the log:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Rx 3 Bytes = 23

&amp;lt;info&amp;gt; app: Rx 3 Bytes = 231

&amp;lt;info&amp;gt; app: Rx 3 Bytes = 231

&amp;lt;info&amp;gt; app: Rx 3 Bytes = 231&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The same result, the first Byte is missing and the third character of the first transmission is the null character &amp;#39;\0&amp;#39;.&lt;/p&gt;
&lt;p&gt;If I enable the log for the USBD_CDC_ACM module I get these messages:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; cdc_acm: Received 3 bytes. Stored in internal buffer.

&amp;lt;info&amp;gt; cdc_acm: EPOUT_DATA: 04 done

&amp;lt;info&amp;gt; app: -&amp;gt; Rx 3 Bytes = 23

&amp;lt;debug&amp;gt; cdc_acm: Received 3 bytes. Stored in internal buffer.

&amp;lt;info&amp;gt; cdc_acm: EPOUT_DATA: 04 done

&amp;lt;info&amp;gt; app: -&amp;gt; Rx 3 Bytes = 231

&amp;lt;debug&amp;gt; cdc_acm: Received 3 bytes. Stored in internal buffer.

&amp;lt;info&amp;gt; cdc_acm: EPOUT_DATA: 04 done

&amp;lt;info&amp;gt; app: -&amp;gt; Rx 3 Bytes = 231

&amp;lt;debug&amp;gt; cdc_acm: Received 3 bytes. Stored in internal buffer.

&amp;lt;info&amp;gt; cdc_acm: EPOUT_DATA: 04 done

&amp;lt;info&amp;gt; app: -&amp;gt; Rx 3 Bytes = 231&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#ff0000;"&gt;&lt;strong&gt;Update:&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;I have added this log in the cdc_acm_consumer() function from the app_usbd_cdc_acm.c file to print the rx buffer:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; char *cstr = (char *)p_next-&amp;gt;p_data.rx;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NRF_LOG_DEBUG(&amp;quot;Rx: %s&amp;quot;, cstr);&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="color:#000000;"&gt;&lt;/span&gt;&lt;/strong&gt;&lt;span style="color:#000000;"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**
 * @brief CDC ACM consumer.
 *
 * @note See @ref nrf_drv_usbd_consumer_t
 */
static bool cdc_acm_consumer(nrf_drv_usbd_ep_transfer_t * p_next,
                             void *                       p_context,
                             size_t                       ep_size,
                             size_t                       data_size)
{
    app_usbd_cdc_acm_ctx_t * p_cdc_acm_ctx = (app_usbd_cdc_acm_ctx_t *) p_context;
    p_next-&amp;gt;size = data_size;

    if (data_size &amp;lt;= p_cdc_acm_ctx-&amp;gt;rx_transfer[0].read_left)
    {
        p_next-&amp;gt;p_data.rx = p_cdc_acm_ctx-&amp;gt;rx_transfer[0].p_buf;

        p_cdc_acm_ctx-&amp;gt;rx_transfer[0].p_buf     += data_size;
        p_cdc_acm_ctx-&amp;gt;bytes_read               += data_size;
        p_cdc_acm_ctx-&amp;gt;rx_transfer[0].read_left -= data_size;
        NRF_LOG_DEBUG(&amp;quot;Received %d bytes. Space left in user buffer: %d bytes.&amp;quot;,
                      data_size,
                      p_cdc_acm_ctx-&amp;gt;rx_transfer[0].read_left);
        return (p_cdc_acm_ctx-&amp;gt;rx_transfer[0].read_left) != 0;
    }
    else
    {
        p_next-&amp;gt;p_data.rx = p_cdc_acm_ctx-&amp;gt;internal_rx_buf;
        p_cdc_acm_ctx-&amp;gt;cur_read = data_size;
        NRF_LOG_DEBUG(&amp;quot;Received %d bytes. Stored in internal buffer.&amp;quot;, data_size);
        
        char *cstr = (char *)p_next-&amp;gt;p_data.rx;
        NRF_LOG_DEBUG(&amp;quot;Rx: %s&amp;quot;, cstr);
        
        return false;
    }
}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;And up to this point the Bytes are really being received well. This is the log:&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;debug&amp;gt; cdc_acm: Received 3 bytes. Stored in internal buffer.

&amp;lt;debug&amp;gt; cdc_acm: Rx: 123

&amp;lt;info&amp;gt; cdc_acm: EPOUT_DATA: 04 done

&amp;lt;info&amp;gt; app: -&amp;gt; Rx 3 Bytes = 23

&amp;lt;debug&amp;gt; cdc_acm: Received 3 bytes. Stored in internal buffer.

&amp;lt;debug&amp;gt; cdc_acm: Rx: 123

&amp;lt;info&amp;gt; cdc_acm: EPOUT_DATA: 04 done

&amp;lt;info&amp;gt; app: -&amp;gt; Rx 3 Bytes = 231&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/393878?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 12:58:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:03c7afea-d302-4c36-b167-91f58d558b14</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Don&amp;#39;t log directly in your event handlers.&lt;/p&gt;
&lt;p&gt;You can push log messages, but only if deferred logging is enabled. This means that if sdk_config.h::NRF_LOG_DEFERRED = 1, you can log in the event handler, but you cannot call NRF_LOG_FLUSH then.&lt;/p&gt;
&lt;p&gt;This will cause issues.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In your sdk_config.h, can you try to set &amp;quot;#define APP_USBD_CDC_ACM_ZLP_ON_EPSIZE_WRITE 1&amp;quot; and see if this helps as well?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/393756?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 21:51:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:719cbfd9-be5e-4479-ae33-804425153973</guid><dc:creator>driverGuy</dc:creator><description>&lt;p&gt;I&amp;#39;m sorry, I think I didn&amp;#39;t express myself well, I was referring to sending the USB HID report of the keyboard as I did with the legacy driver, anyway I was able to solve the problem.&lt;/p&gt;
&lt;p&gt;Now I am having problems with the CDC class, it does not receive the first Byte. I&amp;#39;ve seen this problem come up several times on the forum but I still can&amp;#39;t fix it. This is my code, I am using the nRF5 SDK v17.1.0:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void usb_cdc_ev_handler(app_usbd_class_inst_t const *p_inst, app_usbd_cdc_acm_user_event_t event)
{
    app_usbd_cdc_acm_t const * p_cdc_acm = app_usbd_cdc_acm_class_get(p_inst);

    switch (event)
    {
        case APP_USBD_CDC_ACM_USER_EVT_PORT_OPEN:
            NRF_LOG_INFO(&amp;quot;USB serial port open&amp;quot;);

            uint32_t n = app_usbd_cdc_acm_bytes_stored(p_cdc_acm);
            NRF_LOG_INFO(&amp;quot;Bytes waiting: %d&amp;quot;, n);
            NRF_LOG_FLUSH();

            /*
                Setup first transfer.
                If it does not do this, no Bytes can be received later.
            */
            app_usbd_cdc_acm_read(&amp;amp;serial_cdc_class, serial_rx_buffer, 1);
            break;

        case APP_USBD_CDC_ACM_USER_EVT_PORT_CLOSE:
            NRF_LOG_INFO(&amp;quot;USB serial port close&amp;quot;);
            NRF_LOG_FLUSH();
            break;

        case APP_USBD_CDC_ACM_USER_EVT_TX_DONE:
            /*NRF_LOG_INFO(&amp;quot;Tx done&amp;quot;);
            NRF_LOG_FLUSH();*/
            break;

        case APP_USBD_CDC_ACM_USER_EVT_RX_DONE:
            {     
                NRF_LOG_INFO(&amp;quot; &amp;quot;);                          
                NRF_LOG_INFO(&amp;quot;---- New Rx ----------------------&amp;quot;);
                
                uint32_t n = app_usbd_cdc_acm_bytes_stored(p_cdc_acm);
                NRF_LOG_INFO(&amp;quot;Bytes waiting: %d&amp;quot;, n);
                NRF_LOG_INFO(&amp;quot;----&amp;quot;);
                
                ret_code_t ret;
                num_bytes = 0;
                do
                {
                    n = app_usbd_cdc_acm_rx_size(p_cdc_acm);
                    NRF_LOG_INFO(&amp;quot;app_usbd_cdc_acm_rx_size() = %d&amp;quot;, n);
 
                    ret = app_usbd_cdc_acm_read(&amp;amp;serial_cdc_class, &amp;amp;serial_rx_buffer[num_bytes], 1);
                    /*
                        ret = 0   -&amp;gt; NRF_SUCCESS
                        ret = 146 -&amp;gt; NRF_ERROR_IO_PENDING
                    */
                    char _ret[30];
                    if (ret == NRF_SUCCESS)
                    {
                        strcpy(_ret, &amp;quot;NRF_SUCCESS&amp;quot;);
                    }
                    else if (ret == NRF_ERROR_IO_PENDING)
                    {
                        strcpy(_ret, &amp;quot;NRF_ERROR_IO_PENDING&amp;quot;);
                    }
                    else if (ret == NRF_ERROR_BUSY)
                    {
                        strcpy(_ret, &amp;quot;NRF_ERROR_BUSY&amp;quot;);
                    }
                    else
                    {
                        strcpy(_ret, &amp;quot;OTHER&amp;quot;);
                    }
                    NRF_LOG_INFO(&amp;quot;ret = %d -&amp;gt; %s&amp;quot;, ret, _ret);
                    NRF_LOG_INFO(&amp;quot;serial_rx_buffer[%d] = (int)%d -&amp;gt; (char)%c&amp;quot;, num_bytes, serial_rx_buffer[num_bytes], serial_rx_buffer[num_bytes]);
                    NRF_LOG_INFO(&amp;quot;----&amp;quot;);
                    NRF_LOG_FLUSH();

                    num_bytes++;
                } while (ret == NRF_SUCCESS);  // Fetch data until internal buffer is empty.
            }
            break;

        default:
            break;
    }
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And this is the log screen when I send &amp;quot;123&amp;quot; from another serial terminal:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: USB serial port open

&amp;lt;info&amp;gt; app: Bytes waiting: 0

&amp;lt;info&amp;gt; app:  

&amp;lt;info&amp;gt; app: ---- New Rx ----------------------

&amp;lt;info&amp;gt; app: Bytes waiting: 2

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 0 -&amp;gt; NRF_SUCCESS

&amp;lt;info&amp;gt; app: serial_rx_buffer[0] = (int)50 -&amp;gt; (char)2

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 0 -&amp;gt; NRF_SUCCESS

&amp;lt;info&amp;gt; app: serial_rx_buffer[1] = (int)51 -&amp;gt; (char)3

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 146 -&amp;gt; NRF_ERROR_IO_PENDING

&amp;lt;info&amp;gt; app: serial_rx_buffer[2] = (int)0 -&amp;gt; (char)

&amp;lt;info&amp;gt; app:  

&amp;lt;info&amp;gt; app: ---- New Rx ----------------------

&amp;lt;info&amp;gt; app: Bytes waiting: 2

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 0 -&amp;gt; NRF_SUCCESS

&amp;lt;info&amp;gt; app: serial_rx_buffer[0] = (int)50 -&amp;gt; (char)2

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 0 -&amp;gt; NRF_SUCCESS

&amp;lt;info&amp;gt; app: serial_rx_buffer[1] = (int)51 -&amp;gt; (char)3

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 146 -&amp;gt; NRF_ERROR_IO_PENDING

&amp;lt;info&amp;gt; app: serial_rx_buffer[2] = (int)49 -&amp;gt; (char)1

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app:  

&amp;lt;info&amp;gt; app: ---- New Rx ----------------------

&amp;lt;info&amp;gt; app: Bytes waiting: 2

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 0 -&amp;gt; NRF_SUCCESS

&amp;lt;info&amp;gt; app: serial_rx_buffer[0] = (int)50 -&amp;gt; (char)2

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 0 -&amp;gt; NRF_SUCCESS

&amp;lt;info&amp;gt; app: serial_rx_buffer[1] = (int)51 -&amp;gt; (char)3

&amp;lt;info&amp;gt; app: ----

&amp;lt;info&amp;gt; app: app_usbd_cdc_acm_rx_size() = 1

&amp;lt;info&amp;gt; app: ret = 146 -&amp;gt; NRF_ERROR_IO_PENDING

&amp;lt;info&amp;gt; app: serial_rx_buffer[2] = (int)49 -&amp;gt; (char)1

&amp;lt;info&amp;gt; app: ----&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can see that on the first try it only receives &amp;quot;23&amp;quot; and then the null character when ret == NRF_ERROR_IO_PENDING.&lt;br /&gt;On subsequent attempts it always receive &amp;quot;231&amp;quot;.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s weird that the app_usbd_cdc_acm_bytes_stored() function always returns 2 Bytes when actually I&amp;#39;m sending 3 Bytes.&lt;/p&gt;
&lt;p&gt;I have also tried with app_usbd_cdc_acm_read_any() getting the same result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/392520?ContentTypeID=1</link><pubDate>Wed, 26 Oct 2022 06:54:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eccc2d75-2304-4a69-b3ca-57b65e1fcfc9</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I am not sure what you mean by sending single letters. Both _read and _write functions have the ability to provide a size.&lt;/p&gt;
&lt;p&gt;To send data from the device to the host, you can use the function &amp;quot;app_usbd_cdc_acm_write()&amp;quot;.&lt;/p&gt;
&lt;p&gt;For reading, you can use the function &amp;quot;app_usbd_cdc_acm_read()&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/392490?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 22:53:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:88193b09-fd71-4961-8d92-b5fd134bdd03</guid><dc:creator>driverGuy</dc:creator><description>&lt;p&gt;I was able to add the CDC class with the USB device library from SDK 17.1.0 it works fine.&lt;/p&gt;
&lt;p&gt;Now I need some way to send the USB reports to the computer myself since the functions provided by the API only allow me to send single letters. Is there any way of doing this?&lt;/p&gt;
&lt;p&gt;With the legacy USB driver I used the nrfx_usbd_ep_transfer() function and everything worked fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/391621?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 11:20:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8ec7dba2-8871-4f19-85b5-2b19f5b07b28</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="bevma01"]Update. I have been able to compile the USB HID Composite Example in C++ and the computer correctly recognizes it as keyboard + mouse. Now I need to add CDC class to have serial port as well.[/quote]
&lt;p&gt;That is good news.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately, we do not have any example that combines CDC_ACM directly with other usb classes, but the project that you are currently working with has two HID classes in one project.&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll have to perform similar steps as done in this sample to add the usbd_cdc_acm into your project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Add CDC class to the USB Device Example</title><link>https://devzone.nordicsemi.com/thread/391513?ContentTypeID=1</link><pubDate>Wed, 19 Oct 2022 16:26:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5198502f-79ce-4a72-8fbf-025e5275f741</guid><dc:creator>driverGuy</dc:creator><description>&lt;p&gt;Update. I have been able to compile the USB HID Composite Example in C++ and the computer correctly recognizes it as keyboard + mouse. Now I need to add CDC class to have serial port as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>