<?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>Exit CLI and start Logging</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69210/exit-cli-and-start-logging</link><description>I have a working project that uses the NRF_LOG module to send debug outputs over the UART backend. When just using the logging module everything works correctly. 
 I added the CLI module for use in a manufacturing mode and I&amp;#39;d like to disable the CLI</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Dec 2020 14:00:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69210/exit-cli-and-start-logging" /><item><title>RE: Exit CLI and start Logging</title><link>https://devzone.nordicsemi.com/thread/284347?ContentTypeID=1</link><pubDate>Thu, 10 Dec 2020 14:00:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23bded6f-7270-410b-aaff-69a93dc50102</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for uploading a project demonstrating the issue, and sorry for the delayed response.&lt;/p&gt;
&lt;p&gt;It took me a while to narrow down the problem. Turns out the UARTE keeps triggering the NRF_DRV_UART_EVT_ERROR event even though the logger backend is initializing UARTE in TX only mode. This is a problem because it causes the&amp;nbsp; &amp;quot;m_xfer_done&amp;quot;&amp;nbsp; in nrf_log_backend_uart.c:uart_evt_handler() to always be set to &amp;#39;true&amp;#39;, which again causes the blocking serial_tx() function to become non-blocking.&lt;/p&gt;
&lt;p&gt;I do not know why the ERROR events are raised. It is strange considering the receiver is not enabled. The nrf_cli_uninit() function is also disabling UARTE as a part its uninit routine. I was however able to work around the problem by power-cycling the peripheral it before it was re-enabled by the logger backend again. Could you please try the same? &lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;    ret = nrf_cli_stop(&amp;amp;m_cli_uart);
    APP_ERROR_CHECK(ret);

    ret = nrf_cli_uninit(&amp;amp;m_cli_uart);
    APP_ERROR_CHECK(ret);
    
    *(volatile uint32_t *)(NRF_UART0_BASE + 0xFFC) = 0; // Workaround: power-cycle peripheral to make sure it is fully reset. 
    *(volatile uint32_t *)(NRF_UART0_BASE + 0xFFC) = 1;
    nrf_delay_ms(500);
#endif
    NRF_LOG_INIT(NULL);
    NRF_LOG_DEFAULT_BACKENDS_INIT();  //need to init log backend after un-initting CLI
    NRF_LOG_INFO(&amp;quot;CLI exit complete.&amp;quot;);
    NRF_LOG_FLUSH();&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Exit CLI and start Logging</title><link>https://devzone.nordicsemi.com/thread/284180?ContentTypeID=1</link><pubDate>Wed, 09 Dec 2020 18:22:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb113ff5-c134-4fef-9124-9f17412c0d01</guid><dc:creator>cbrown_cdi</dc:creator><description>&lt;p&gt;In the example project, send the command &amp;quot;exit&amp;quot; to exit manufacturing mode and continue onto the main program where the logging module is used.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>