<?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>CLI interface. Backend flushed warning. SDK 16.0</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58903/cli-interface-backend-flushed-warning-sdk-16-0</link><description>Hi devs! 
 I just evaluating CLI library with nRF52 USB Dongle. Really easy to use and nice example code in SDK. 
 While everything is working fine for me still I can&amp;#39;t deal with issue getting &amp;quot;Backend flushed&amp;quot; warning. 
 I do have in main loop: 
 
 And</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Mar 2020 13:35:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58903/cli-interface-backend-flushed-warning-sdk-16-0" /><item><title>RE: CLI interface. Backend flushed warning. SDK 16.0</title><link>https://devzone.nordicsemi.com/thread/239128?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 13:35:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9df5d8cc-c241-4308-802f-c7e0b5076524</guid><dc:creator>Rasul Kishov</dc:creator><description>&lt;p&gt;Thank you very much for your answer.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using 16.0 SDK together with Segger Studio.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I pretty sure and just tested it again. Code below gives compile error &amp;quot;&amp;#39;else&amp;#39; without previous if&amp;quot;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    if (&amp;#39;H&amp;#39; == sendingMsg[0]) NRF_LOG_RAW_INFO(&amp;quot;\r\n&amp;quot;);
    else NRF_LOG_RAW_INFO(&amp;quot;, DATA 0x%X\r\n&amp;quot;, *(uint32_t *) (sendingMsg + 13));
    &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;And this code compiles without errors:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    if (&amp;#39;H&amp;#39; == sendingMsg[0]) {
        NRF_LOG_RAW_INFO(&amp;quot;\r\n&amp;quot;);
    }
    else NRF_LOG_RAW_INFO(&amp;quot;, DATA 0x%X\r\n&amp;quot;, *(uint32_t *) (sendingMsg + 13));
    &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;(Regarding if statements without brackets. It is actually in general a bad idea. But sometimes you really want to save some extra vertical space to get a better code reading experience, espessically for programs with complex logic and especcially at the early develepment stage).&lt;/p&gt;
&lt;p&gt;Anyway I don&amp;#39;t want to abuse engineer&amp;#39;s time since original problem is resolved. Even though&amp;nbsp;I still don&amp;#39;t understand how those small changes can be related to warning I got. I&amp;#39;m pretty sure the&amp;nbsp;&lt;strong&gt;cli_process()&amp;nbsp;&lt;/strong&gt;was&amp;nbsp;processed fast enough.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CLI interface. Backend flushed warning. SDK 16.0</title><link>https://devzone.nordicsemi.com/thread/239083?ContentTypeID=1</link><pubDate>Tue, 10 Mar 2020 11:43:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f3823a34-df0d-4128-a2a1-a63b192f1901</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Regarding the original issue, &amp;quot;Backends flushed&amp;quot; is typically logged when the buffer is full due to not running cli_process() in time. For instance, if you call&amp;nbsp;cli_process() in the main loop, but do a lot of logging before the main loop runs.&lt;/p&gt;
&lt;p&gt;Regarding the other issue,&amp;nbsp;NRF_LOG_RAW_INFO() should not cause problems without brackets. It will insert a few if&amp;#39;s etc, but everything is on a single line (which is always the case with macros). I did a quick test on my end and was not able to reproduce an issue with it. Which toolchain and SDK version do you use? (That said, if statements without brackets are generally a bad idea, as it is easy to make the mistake of adding one line when debugging or similar, and forgetting that only the first will be conditional).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CLI interface. Backend flushed warning. SDK 16.0</title><link>https://devzone.nordicsemi.com/thread/238944?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 20:31:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc84c543-0396-410b-bccb-8dd9bc6b6e1e</guid><dc:creator>Rasul Kishov</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    NRF_LOG_RAW_INFO(&amp;quot;Sending mes: &amp;#39;%c&amp;#39;, MID 0x%X, NID 0x%X, UID 0x%X%X, TTL %i&amp;quot;, 
            sendingMsg[0], 
            *(uint16_t *)(sendingMsg+1), 
            sendingMsg[3], 
            *(uint32_t *)(sendingMsg+4), 
            *(uint32_t *)(sendingMsg+8), 
            sendingMsg[12]);
    if (&amp;#39;H&amp;#39; == sendingMsg[0]) {
        NRF_LOG_RAW_INFO(&amp;quot;\r\n&amp;quot;);
    }
    else {
        NRF_LOG_RAW_INFO(&amp;quot;, DATA 0x%X\r\n&amp;quot;, *(uint32_t *) (sendingMsg + 13));
    }&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This version is working fine too and btw doesn&amp;#39;t compile without brackets, while it should.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To me it looks like problem somehow related to&amp;nbsp;&lt;strong&gt;NRF_LOG_RAW_INFO&amp;nbsp;&lt;/strong&gt;macro.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CLI interface. Backend flushed warning. SDK 16.0</title><link>https://devzone.nordicsemi.com/thread/238942?ContentTypeID=1</link><pubDate>Mon, 09 Mar 2020 20:16:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:298f7874-39ae-4f7e-b638-83ce20ae9843</guid><dc:creator>Rasul Kishov</dc:creator><description>&lt;p&gt;I found the solution. But I still don&amp;#39;t understand what is going on.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This code gives me warnings:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    NRF_LOG_RAW_INFO(&amp;quot;Sending mes: &amp;#39;%c&amp;#39;, MID 0x%X, NID 0x%X, UID 0x%X%X, &amp;quot;, 
            sendingMsg[0], 
            *(uint16_t *)(sendingMsg+1), 
            sendingMsg[3], 
            *(uint32_t *)(sendingMsg+4), 
            *(uint32_t *)(sendingMsg+8));
    if (&amp;#39;P&amp;#39; == sendingMsg[0] || &amp;#39;C&amp;#39; == sendingMsg[0] || &amp;#39;D&amp;#39; == sendingMsg[0] || &amp;#39;N&amp;#39; == sendingMsg[0] || &amp;#39;A&amp;#39; == sendingMsg[0]) {
        NRF_LOG_RAW_INFO(&amp;quot;TTL %i, DATA 0x%X \r\n&amp;quot;, 
            sendingMsg[12], 
            *(uint32_t *) (sendingMsg + 13));
    }
    if (&amp;#39;H&amp;#39; == sendingMsg[0]) NRF_LOG_RAW_INFO(&amp;quot;TTL %i\r\n&amp;quot;, sendingMsg[12]);&lt;/pre&gt;Rewriting this code&amp;nbsp;by this way solved the problem:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    NRF_LOG_RAW_INFO(&amp;quot;Sending mes: &amp;#39;%c&amp;#39;, MID 0x%X, NID 0x%X, UID 0x%X%X, TTL %i, &amp;quot;, 
            sendingMsg[0], 
            *(uint16_t *)(sendingMsg+1), 
            sendingMsg[3], 
            *(uint32_t *)(sendingMsg+4), 
            *(uint32_t *)(sendingMsg+8), 
            sendingMsg[12]);
    NRF_LOG_RAW_INFO(&amp;quot;DATA 0x%X\r\n&amp;quot;, *(uint32_t *) (sendingMsg + 13));&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>