<?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>Data mixing with CDC ACM &amp;amp; CLI</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/93029/data-mixing-with-cdc-acm-cli</link><description>Hello, 
 
 I have a problem when I send data with CDC ACM and using CLI interface my data is mixing. If I put a delay between sending data I have no problem but this solution is not very clean. 
 
 Have you got an idea of why I can fix this problem? </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Nov 2022 07:48:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/93029/data-mixing-with-cdc-acm-cli" /><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/394317?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 07:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9280b624-c930-4166-8af0-9e4cd4b0f660</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi André&lt;/p&gt;
&lt;p&gt;We&amp;#39;re moving outside of the subject of this DevZone ticket, so please create a new one where you explain your issue and what your end goal is there, so we have all necessary information there.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/394246?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2022 23:43:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac2dab5b-1c4c-4c30-aff8-e866381879fd</guid><dc:creator>Andre N</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;My problem is that I need to send a buffer of data (ranging from 0 to 255) that contains the null character (\0).&lt;/p&gt;
&lt;p&gt;The function &lt;em&gt;nrf_cli_print&lt;/em&gt;,&amp;nbsp;requires a formatted string (which can&amp;#39;t contain null characters).&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/393811?ContentTypeID=1</link><pubDate>Thu, 03 Nov 2022 08:59:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f9663e1-904f-4326-abed-d951f3ae0078</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;You can use &lt;strong&gt;nrf_cli_print&lt;/strong&gt; instead of the &amp;quot;stream&amp;quot; function.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/393640?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 12:29:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2ff5dee-d4c8-448f-86bf-b86ca1b753ad</guid><dc:creator>Andre N</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Thanks for your reply.&lt;/p&gt;
&lt;p&gt;I am trying to send a buffer of raw data which is why i used&amp;nbsp;&lt;em data-renderer-mark="true"&gt;nrf_cli_print_stream.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;What function should I use to send a buffer of raw data through&amp;nbsp;&lt;/span&gt;&lt;em data-renderer-mark="true"&gt;nrf_cli&lt;/em&gt;&lt;span&gt;&amp;nbsp;?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;If there is no alternative, can you confirm that&amp;nbsp;&lt;em data-renderer-mark="true"&gt;nrf_cli_print_stream&lt;/em&gt;&amp;nbsp;is indeed a blocking function?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/393209?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 11:38:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:290afa35-2ab7-432b-9bcd-a5ae35a7ec0a</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;In its declaration, it says specifically that you should not use the nrf_cli_print_stream() function directly, as it is required by the nrf_fprintf module, so we don&amp;#39;t have a specified behavior of what will happen if you use this function directly.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/393105?ContentTypeID=1</link><pubDate>Sat, 29 Oct 2022 11:24:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5c6efd6-dabd-419c-86f8-59d9a696866c</guid><dc:creator>Andre N</dc:creator><description>&lt;p&gt;Hi&lt;br /&gt;&lt;br /&gt;I&amp;#39;m facing the same problem.&lt;br /&gt;I&amp;#39;m using &lt;span&gt;&lt;em&gt;nrf_cli_print_stream()&lt;/em&gt; from&amp;nbsp;&lt;/span&gt;the nrf_cli library (which uses CDC ACM library) to send chunks of raw data.&lt;br /&gt;&lt;br /&gt;The problem is that when I try to send several chunks, some data is lost, as if I didn&amp;#39;t wait for the buffer to be ready.&lt;br /&gt;&lt;br /&gt;I noticed that the function &lt;em&gt;cli_write&lt;/em&gt; waits for the &lt;em&gt;tx_rdy&lt;/em&gt; flag, which is set by the&amp;nbsp;&lt;em&gt;cli_transport_evt_handler &lt;/em&gt;which is called by&amp;nbsp;&lt;em&gt;cdc_acm_user_ev_handler &lt;/em&gt;when&amp;nbsp;&lt;span&gt;APP_USBD_CDC_ACM_USER_EVT_TX_DONE event is detected.&lt;br /&gt;&lt;br /&gt;That being said, I should be able to call&amp;nbsp;&lt;em&gt;nrf_cli_print_stream()&lt;/em&gt;&amp;nbsp;several times in a row without having my data mixed up or lost, right?&lt;br /&gt;&lt;br /&gt;Also I am using SDK 17.1&lt;br /&gt;&lt;br /&gt;Thanks for your help&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/392064?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2022 08:55:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb598543-94e8-4543-833f-972b1f030197</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;After discussing this with a colleague, I think we need some more details, as there shouldn&amp;#39;t be a problem running multiple CDC ACM com ports. I guess it could have something to do with how you transmit the data. Can you show some details of how this is done exactly? Are you for example transmitting from an interrupt?&lt;/p&gt;
&lt;p&gt;Also, what do you mean by&amp;nbsp;&lt;span&gt;APP_USBD_CDC_ACM_USER_EVT_TX_DONE&amp;nbsp; always being 1? This is an event, and not a variable. How are you using this event exactly? As&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Fgroup__app__usbd__cdc__acm.html&amp;amp;anchor=ga01f02199ff963085225751057f4d9e5d"&gt;app_usbd_cdc_acm_write&lt;/a&gt;&amp;nbsp;says, you should wait for the&amp;nbsp;APP_USBD_CDC_ACM_USER_EVT_TX_DONE&amp;nbsp;&amp;nbsp;when writing to make sure that all data has been set and the input buffer can be accessed again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/391687?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 13:16:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9e1ab2e-7d3c-4e87-b634-09c34d77abb5</guid><dc:creator>teodf</dc:creator><description>&lt;p&gt;I try to use&amp;nbsp;APP_USBD_CDC_ACM_USER_EVT_TX_DONE but it &amp;#39;s always at 1 the transmission is always finish.&amp;nbsp;I find this&amp;nbsp;strange&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/391668?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 12:45:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0de4046d-fc8b-49a9-b965-02aa684a9767</guid><dc:creator>teodf</dc:creator><description>&lt;p&gt;I use SDK 17.1.0, the goal is to communicate with my tracker with USB port. I have no error just my data are mixed when I receive&amp;nbsp;it. I use&amp;nbsp;nrf_cli_print_stream(&amp;amp;m_cli_cdc_acm, (char *) buf, size) to write my data and my cli is define with this&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_CLI_DEF(m_cli_cdc_acm,
            &amp;quot;&amp;quot;,
            &amp;amp;m_cli_cdc_acm_transport.transport,
            &amp;#39;\r&amp;#39;,
            CLI_EXAMPLE_LOG_QUEUE_SIZE);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;When I&amp;#39;m debugging I have&amp;nbsp;0 error it&amp;#39;s work correctly but when I send lot off data it&amp;#39;s mixed. The small transfer of data work nice but when I send multiple packet data is mixed.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Data mixing with CDC ACM &amp; CLI</title><link>https://devzone.nordicsemi.com/thread/391618?ContentTypeID=1</link><pubDate>Thu, 20 Oct 2022 11:16:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c4a18dd-3927-4638-a871-ddce2981dc1b</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi Téo&lt;/p&gt;
&lt;p&gt;Can you share some additional information regarding your application/project? What SDK and SDK version are you using? How exactly is your data mixing, do the bytes/logging info weave together in-between each other or do you get any errors of some kind?&lt;/p&gt;
&lt;p&gt;It should be possible to have several USB classes on the same USB peripheral, as long as you initialize them before enabling USB. Have you done any debugging to see if the application throws any errors that might give us an idea of what&amp;#39;s going wrong here. It might be some issues with the two creating a race condition of some kind if they have the same interrupt priority for example.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>