<?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>Implement UART to example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/92411/implement-uart-to-example</link><description>Hi, 
 I have example nrf/samples/esb/prx. Now I want to add UART0 (in ASYNC mode - DMA) for TX and RX communication with another device. 
 I just tried to proceed according to this: https://docs.zephyrproject.org/3.1.0/hardware/peripherals/uart.html#</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Oct 2022 10:21:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/92411/implement-uart-to-example" /><item><title>RE: Implement UART to example</title><link>https://devzone.nordicsemi.com/thread/388948?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2022 10:21:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df22ac16-7791-452c-940a-58df8eb98a6f</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="witc"]I found&amp;nbsp; CONFIG_LOG_BACKEND_RTT and&amp;nbsp; CONFIG_USE_SEGGER_RTT - what is a difference?[/quote]
&lt;p&gt;CONFIG_USE_SEGGER_RTT enables the functionality for Segger RTT.&lt;/p&gt;
&lt;p&gt;CONFIG_LOG_BACKEND_RTT makes it so that the logger module use RTT as a backend.&lt;/p&gt;
[quote user="witc"]Also I found&amp;nbsp;&amp;nbsp;&lt;span&gt;CONFIG_LOG and&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;CONFIG_CONSOLE I found out that I need to set booth of them to =y - what is the differnce?&lt;/span&gt;[/quote]
&lt;p&gt;CONFIG_CONSOLE is for general output from the chip. CONFIG_LOG is to enable the Logger module.&lt;/p&gt;
[quote user="witc"]For LOG output on uart I need to set also&amp;nbsp; CONFIG_SERIAL,&amp;nbsp; CONFIG_UART_CONSOLE - why booth of them?[/quote]
&lt;p&gt;Here is an example to log on uart with only CONFIG_LOG set manually:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/hello_5F00_world_5F00_with_5F00_log.zip"&gt;devzone.nordicsemi.com/.../hello_5F00_world_5F00_with_5F00_log.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement UART to example</title><link>https://devzone.nordicsemi.com/thread/388869?ContentTypeID=1</link><pubDate>Sat, 01 Oct 2022 19:24:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0f1d385-040b-44ed-849b-aec5d1f0f94e</guid><dc:creator>witc</dc:creator><description>&lt;p&gt;Thank you!&lt;/p&gt;
&lt;p&gt;When implementing LOG_xx module I tried to understand how to set up it for uart and RTT output.&lt;/p&gt;
&lt;p&gt;I found&amp;nbsp; CONFIG_LOG_BACKEND_RTT and&amp;nbsp; CONFIG_USE_SEGGER_RTT - what is a difference?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Also I found&amp;nbsp;&amp;nbsp;&lt;span&gt;CONFIG_LOG and&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span&gt;CONFIG_CONSOLE I found out that I need to set booth of them to =y - what is the differnce?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;For LOG output on uart I need to set also&amp;nbsp; CONFIG_SERIAL,&amp;nbsp; CONFIG_UART_CONSOLE - why booth of them?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you, Jan.&lt;/p&gt;
&lt;div id="gtx-anchor" style="height:13.3565px;left:7.99304px;position:absolute;top:178.163px;width:22.3496px;"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble gtx-bubble" style="left:4px;top:64px;"&gt;
&lt;div id="bubble-2" class="jfk-bubble-content-id"&gt;
&lt;div id="gtx-host" style="max-width:400px;"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="jfk-bubble-closebtn-id jfk-bubble-closebtn"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrow-id jfk-bubble-arrow jfk-bubble-arrowdown" style="left:15px;"&gt;
&lt;div class="jfk-bubble-arrowimplbefore"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrowimplafter"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement UART to example</title><link>https://devzone.nordicsemi.com/thread/388679?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2022 07:58:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:968ef91d-d356-4c01-b5f8-a19a91039b72</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can have logging use several backends at once. So if you want to make logging use RTT and disable UART logging, do:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;CONFIG_LOG_BACKEND_RTT=y
CONFIG_LOG_BACKEND_UART=n&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The VS Code Kconfig extension is nice to figure out which alternatives you have with Kconfig.&lt;br /&gt;Also see our &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/kconfig/index.html"&gt;Kconfig search&lt;/a&gt; and &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/ug_logging.html"&gt;Logging in nRF Connect SDK&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Another alternative is to send logging to another uart. This is done using the &lt;a href="https://academy.nordicsemi.com/topic/configuration-files/"&gt;devicetree&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;/ {
    zephyr,console = &amp;amp;uart1;
};
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;PS: I remembered that we also have this &lt;a href="https://academy.nordicsemi.com/topic/uart-driver/"&gt;tutorial on UART&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement UART to example</title><link>https://devzone.nordicsemi.com/thread/388639?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 19:19:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:68a1857a-af8d-4868-92c4-b3a7e032ab4d</guid><dc:creator>witc</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;thank you for pointing me. I could not find this sample in VS code (when browsing examples):&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1664474804362v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;OK, never mind - I found it on the github.&lt;/p&gt;
&lt;p&gt;In the example I can not see major difference in using of uart.&lt;/p&gt;
&lt;p&gt;I found out that the error (see above in my previous post) occurs already if I try to remove using uart0 for functions like LOG_ERR,...&amp;nbsp;So&amp;nbsp;Is there any &amp;quot;smart&amp;quot; way how to&amp;nbsp;get LOG_ERR,...&amp;nbsp;to stop using the&amp;nbsp;uart0?&amp;nbsp;Let say that now LOG_ERR uses uart0, but we could let LOG_ERR use only e.g. RTT, and uart0 could be then free for another purpose.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;How I tried to&amp;nbsp;&lt;span&gt;to&amp;nbsp;get LOG_ERR,...&amp;nbsp;to stop using the&amp;nbsp;uart0:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1) Commented line:&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/span&gt;&lt;em&gt;LOG_MODULE_REGISTER(esb_prx, CONFIG_ESB_PRX_APP_LOG_LEVEL);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;but some errors appeared:&amp;nbsp;&lt;img style="height:44px;max-height:44px;max-width:335px;" height="44" src="https://devzone.nordicsemi.com/resized-image/__size/670x88/__key/communityserver-discussions-components-files/4/pastedimage1664478761694v2.png" width="334" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;2) commented&amp;nbsp;&amp;nbsp;&lt;em&gt;#include &lt;/em&gt;&lt;span&gt;&lt;em&gt;&amp;lt;logging/log.h&amp;gt; &lt;/em&gt;in main.c and set&amp;nbsp;&lt;/span&gt;&lt;span&gt;CONFIG_NCS_SAMPLES_DEFAULTS&lt;/span&gt;&lt;span&gt;=n in prj.conf&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;unfortunatelly it also did not help.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Hope my question is clear, Do you please know how to use uart0 for my purpose and how to disable uart0 from using&amp;nbsp;LOG_xxx functions?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thank you very much.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;div class="jfk-bubble gtx-bubble" style="left:-68px;top:215px;"&gt;
&lt;div id="bubble-9" class="jfk-bubble-content-id"&gt;
&lt;div id="gtx-host" style="max-width:400px;"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="jfk-bubble-closebtn-id jfk-bubble-closebtn"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrow-id jfk-bubble-arrow jfk-bubble-arrowdown" style="left:247.504px;"&gt;
&lt;div class="jfk-bubble-arrowimplbefore"&gt;&lt;/div&gt;
&lt;div class="jfk-bubble-arrowimplafter"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Implement UART to example</title><link>https://devzone.nordicsemi.com/thread/388522?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2022 10:25:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3af616cf-b2d2-4fa0-8bfd-14b78edc8c39</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Have a look at the &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/2.1.0/zephyr/samples/drivers/uart/echo_bot/README.html"&gt;UART Driver Sample&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>