<?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>debugging over RTT in linux</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17260/debugging-over-rtt-in-linux</link><description>Hello, I want to test using RTT for logging since I am using UART for send/receive packets. I made following changes in sdk_config.h: 
 #ifndef NRF_LOG_ENABLED
#define NRF_LOG_ENABLED 1 // previously 0
#endif
 
 after I call make default, i have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 23 Dec 2016 14:46:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17260/debugging-over-rtt-in-linux" /><item><title>RE: debugging over RTT in linux</title><link>https://devzone.nordicsemi.com/thread/66295?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 14:46:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33526fd9-dbde-4d5a-942e-6f2f3b485390</guid><dc:creator>Tomi</dc:creator><description>&lt;p&gt;I am glad you worked this out!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: debugging over RTT in linux</title><link>https://devzone.nordicsemi.com/thread/66294?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 11:25:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22c6b891-aebd-452c-b9a3-3735de08b4cc</guid><dc:creator>Anjali</dc:creator><description>&lt;p&gt;You are correct. Since I was at the time of posting, using an example application from nrf SDK, I didn&amp;#39;t have to bother about the steps you have mentioned. However, just recently when I was writing my customized application I was stuck because  NRF_LOG_BACKEND_SERIAL_USES_RTT 1 and NRF_LOG_USES_RTT were not enabled. This is what I was looking for.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: debugging over RTT in linux</title><link>https://devzone.nordicsemi.com/thread/66293?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 10:59:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0154e03-3683-471f-acb7-a1a5481ba13d</guid><dc:creator>Tomi</dc:creator><description>&lt;p&gt;Since Sigurd&amp;#39;s answer provide some good guides to dig further, there is some more work to do in order to be &amp;quot;compliant&amp;quot; with Nordic proprietary logging system.&lt;/p&gt;
&lt;p&gt;Just continue with Sigurd&amp;#39;s suggestions and include libraries for NRF_LOG backend (under the SRC_FILES):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(SDK_ROOT)/components/libraries/log/src/nrf_log_backend_serial.c \  
$(SDK_ROOT)/components/libraries/log/src/nrf_log_frontend.c \
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;in INC_FOLDERS make just you have:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;$(SDK_ROOT)/components/libraries/log/src \
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Then add header files to main.c, e.g.:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define NRF_LOG_MODULE_NAME &amp;quot;MY_APP&amp;quot;
#include &amp;quot;nrf_log.h&amp;quot;
#include &amp;quot;nrf_log_ctrl.h&amp;quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;To work out-of-the-box you will also need declaration for your constants (which can be copy-pasted from other examples), best to place them at the end of config file (default: sdk_config.h):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// ....other constants ...
//
// &amp;lt;h&amp;gt; nrf_log_backend - Logging sink

//==========================================================
// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_MAX_STRING_LENGTH - Buffer for storing single output string
// &amp;lt;i&amp;gt; Logger backend RAM usage is determined by this value.

#ifndef NRF_LOG_BACKEND_MAX_STRING_LENGTH
#define NRF_LOG_BACKEND_MAX_STRING_LENGTH 256
#endif

// &amp;lt;o&amp;gt; NRF_LOG_TIMESTAMP_DIGITS - Number of digits for timestamp
// &amp;lt;i&amp;gt; If higher resolution timestamp source is used it might be needed to increase that

#ifndef NRF_LOG_TIMESTAMP_DIGITS
#define NRF_LOG_TIMESTAMP_DIGITS 8
#endif

// &amp;lt;e&amp;gt; NRF_LOG_BACKEND_SERIAL_USES_UART - If enabled data is printed over UART
//==========================================================
#ifndef NRF_LOG_BACKEND_SERIAL_USES_UART
#define NRF_LOG_BACKEND_SERIAL_USES_UART 0
#endif
#if  NRF_LOG_BACKEND_SERIAL_USES_UART
// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_SERIAL_UART_BAUDRATE  - Default Baudrate

// &amp;lt;323584=&amp;gt; 1200 baud
// &amp;lt;643072=&amp;gt; 2400 baud
// &amp;lt;1290240=&amp;gt; 4800 baud
// &amp;lt;2576384=&amp;gt; 9600 baud
// &amp;lt;3862528=&amp;gt; 14400 baud
// &amp;lt;5152768=&amp;gt; 19200 baud
// &amp;lt;7716864=&amp;gt; 28800 baud
// &amp;lt;10289152=&amp;gt; 38400 baud
// &amp;lt;15400960=&amp;gt; 57600 baud
// &amp;lt;20615168=&amp;gt; 76800 baud
// &amp;lt;30801920=&amp;gt; 115200 baud
// &amp;lt;61865984=&amp;gt; 230400 baud
// &amp;lt;67108864=&amp;gt; 250000 baud
// &amp;lt;121634816=&amp;gt; 460800 baud
// &amp;lt;251658240=&amp;gt; 921600 baud
// &amp;lt;268435456=&amp;gt; 57600 baud

#ifndef NRF_LOG_BACKEND_SERIAL_UART_BAUDRATE
#define NRF_LOG_BACKEND_SERIAL_UART_BAUDRATE 30801920
#endif

// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_SERIAL_UART_TX_PIN - UART TX pin
#ifndef NRF_LOG_BACKEND_SERIAL_UART_TX_PIN
#define NRF_LOG_BACKEND_SERIAL_UART_TX_PIN 6
#endif

// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_SERIAL_UART_RX_PIN - UART RX pin
#ifndef NRF_LOG_BACKEND_SERIAL_UART_RX_PIN
#define NRF_LOG_BACKEND_SERIAL_UART_RX_PIN 8
#endif

// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN - UART RTS pin
#ifndef NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN
#define NRF_LOG_BACKEND_SERIAL_UART_RTS_PIN 5
#endif

// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN - UART CTS pin
#ifndef NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN
#define NRF_LOG_BACKEND_SERIAL_UART_CTS_PIN 7
#endif

// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_SERIAL_UART_FLOW_CONTROL  - Hardware Flow Control

// &amp;lt;0=&amp;gt; Disabled
// &amp;lt;1=&amp;gt; Enabled

#ifndef NRF_LOG_BACKEND_SERIAL_UART_FLOW_CONTROL
#define NRF_LOG_BACKEND_SERIAL_UART_FLOW_CONTROL 0
#endif

// &amp;lt;o&amp;gt; NRF_LOG_BACKEND_UART_INSTANCE  - UART instance used

// &amp;lt;0=&amp;gt; 0

#ifndef NRF_LOG_BACKEND_UART_INSTANCE
#define NRF_LOG_BACKEND_UART_INSTANCE 0
#endif

#endif //NRF_LOG_BACKEND_SERIAL_USES_UART
// &amp;lt;/e&amp;gt;

// &amp;lt;q&amp;gt; NRF_LOG_BACKEND_SERIAL_USES_RTT  - If enabled data is printed using RTT


#ifndef NRF_LOG_BACKEND_SERIAL_USES_RTT
#define NRF_LOG_BACKEND_SERIAL_USES_RTT 1
#endif

// &amp;lt;/h&amp;gt;
//==========================================================
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The important parts here are &amp;quot;&lt;strong&gt;NRF_LOG_BACKEND_SERIAL_USES_RTT 1&lt;/strong&gt;&amp;quot; and &amp;quot;&lt;strong&gt;NRF_LOG_BACKEND_SERIAL_USES_UART 0&lt;/strong&gt;&amp;quot;, so debug data will go ONLY to your Segger RTT.&lt;/p&gt;
&lt;p&gt;BTW, don&amp;#39;t forget to initialize the NRF_LOG module before use it (in main.c), i.e.:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Initialize NRF_LOG module
err_code = NRF_LOG_INIT(NULL);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: debugging over RTT in linux</title><link>https://devzone.nordicsemi.com/thread/66292?ContentTypeID=1</link><pubDate>Mon, 24 Oct 2016 07:10:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57f82371-b3f6-40b0-aa20-db2ae18e0598</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;You also need to add the Segger RTT files to your makefile.&lt;/p&gt;
&lt;p&gt;In the SRC_FILES make sure these are included:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  $(SDK_ROOT)/external/segger_rtt/RTT_Syscalls_GCC.c \
  $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT.c \
  $(SDK_ROOT)/external/segger_rtt/SEGGER_RTT_printf.c \
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In the INC_FOLDERS, make sure this is inclued:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;  $(SDK_ROOT)/external/segger_rtt \
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>