<?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>NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/42044/nrf-cli-thread-safe</link><description>In SDK 15.2 is the nrf_cli module completely thread safe? I was thinking of developing a wrapper to use the CLI module for both application logging as well as a general CLI interface. Since I&amp;#39;m using a freeRTOS arhcitecture I didn&amp;#39;t know my wrapper have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Mar 2019 21:33:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/42044/nrf-cli-thread-safe" /><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/175791?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 21:33:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae10302a-1bcd-4405-9f66-4ba1b64a7545</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;With SDK15.3 this will not matter - both will work fine. I&amp;#39;ve simplified it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/175784?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 19:52:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf982e45-174a-44e4-8ee9-8ba8d949cf47</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;Issue was using &amp;#39;\n&amp;#39; instead of &amp;#39;\r&amp;#39; in the Definition macro&lt;/p&gt;
&lt;p&gt;NRF_CLI_DEF(m_cli_uart,&lt;br /&gt; CLI_UART_PREFIX,&lt;br /&gt; &amp;amp;m_cli_uart_transport.transport,&lt;br /&gt; &amp;#39;\r&amp;#39;,&lt;br /&gt; CLI_LOG_QUEUE_SIZE);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/173164?ContentTypeID=1</link><pubDate>Wed, 27 Feb 2019 07:53:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8b62813-c1e5-4386-9441-435ba3afafea</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;I did not face this problem so it is hard to comment. Are you able to share some code where I could reproduce it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/172898?ContentTypeID=1</link><pubDate>Mon, 25 Feb 2019 22:21:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f66d6ba-597a-43cc-9f31-fbfb23e0b302</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;Wanted to re-address this issue.&amp;nbsp; I&amp;#39;ve been finding with extensive testing that the CLI module will randomly assert.&amp;nbsp; If occurs on line 270 of nrfx_uarte.c results from a NULL pointer passed for p_data.&amp;nbsp; This seems to occur randomly, whether the Softdevice/BLE Thread is running or not.&amp;nbsp; The Thread trace shows the following:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1551133217947v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/163860?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 23:36:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e34a8887-258a-4b0c-860d-1bef4ab6a568</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;You are allowed to use a backend for both. Example can be found in peripherals\cli&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/163847?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 20:44:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4748bc5e-7f55-4d5b-bf42-a5e1c23ec641</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;I thought you weren&amp;#39;t allowed to use a backend for both logging and cli.&amp;nbsp; I guess this is where you&amp;#39;d set the&amp;nbsp;#define NRF_CLI_LOG_BACKEND 1 ?&amp;nbsp; &amp;nbsp;To be able to use Logging -&amp;gt; thur CLI -&amp;gt; to whatever backend is configured for CLI (e.g. RTT or UART)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/163744?ContentTypeID=1</link><pubDate>Thu, 03 Jan 2019 12:27:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:304d6ba4-e7cc-4418-a0d5-36970eef6012</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;You can create as many CLI backends as possible: BT,&amp;nbsp;UART0/UARTE0, UARTE1 (nrf52840),&amp;nbsp;RTT or&amp;nbsp;USB.&lt;/p&gt;
&lt;p&gt;Each backend is independant and you can use them &amp;quot;at the same time&amp;quot;. Each CLI backend &lt;strong&gt;can be&lt;/strong&gt; at the same time a Logger backend. What is more you can configure each backend to show different log levels and it can be changed at runtime.&lt;/p&gt;
&lt;p&gt;So I think the answer for your question is simply: yes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/163589?ContentTypeID=1</link><pubDate>Wed, 02 Jan 2019 22:24:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf346e06-ef2d-4e41-9b05-9fd7cd5a5500</guid><dc:creator>Dave_couling</dc:creator><description>&lt;p&gt;1. Understood, I&amp;#39;ll wrap this into its own thread with a Semaphore&lt;/p&gt;
&lt;p&gt;2. The usage of the term backend is quite confusing.&amp;nbsp; I use RTT backend on my CLI (may change to UART depending on the application).&amp;nbsp; So as I understand, there is a setting which hooked the Logging into the CLI as the backend which then uses whatever backend is configured for the CLI?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF CLI Thread Safe?</title><link>https://devzone.nordicsemi.com/thread/163329?ContentTypeID=1</link><pubDate>Tue, 01 Jan 2019 19:03:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4852c73-1e82-452c-bc5f-19134912ffe4</guid><dc:creator>Jakub Rzeszutko</dc:creator><description>&lt;p&gt;Basically it is not thread safe. However you can safely use it with RTOS under following conditions:&lt;/p&gt;
&lt;p&gt;1. CLI commands will be not executed from from multiple contexts (to avoid executing commands at the same time).&lt;/p&gt;
&lt;p&gt;2. nrf_cli_fprintf function will be used only inside command handler. If you wish to print something on the screen from different context you can use Logger module with CLI backend.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>