<?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 nRF51822 application through UART using SDK8.1 and eclipse/gcc toolchain</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7232/debugging-nrf51822-application-through-uart-using-sdk8-1-and-eclipse-gcc-toolchain</link><description>I would like a working example of a simple application that uses soft_device (either S110 or S120) plus UART debugging.
I have read many posts in this forum about this topic but it is difficult (so far impossible for me) to get a complete/end-to.end</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 Oct 2017 02:40:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7232/debugging-nrf51822-application-through-uart-using-sdk8-1-and-eclipse-gcc-toolchain" /><item><title>RE: Debugging nRF51822 application through UART using SDK8.1 and eclipse/gcc toolchain</title><link>https://devzone.nordicsemi.com/thread/25560?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 02:40:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd35c0c4-4c25-4ae3-bb73-4280a3640b4d</guid><dc:creator>Jeong Hyun Seok</dc:creator><description>&lt;p&gt;Can I ask you some question?&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;I get RTT log with eclipse + GDB server + Jlink Client&lt;/li&gt;
&lt;li&gt;Can I get RTT log with just RTT viewer? which means no need for eclipse environment. just using device (with eclipse build Firmware) + Jlink + Jlink RTT Viewer&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging nRF51822 application through UART using SDK8.1 and eclipse/gcc toolchain</title><link>https://devzone.nordicsemi.com/thread/25559?ContentTypeID=1</link><pubDate>Sat, 11 Mar 2017 12:24:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:65f1b8d5-7c9d-4a3f-a711-7396d7eeb913</guid><dc:creator>etienne</dc:creator><description>&lt;p&gt;What about the sys call files !??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging nRF51822 application through UART using SDK8.1 and eclipse/gcc toolchain</title><link>https://devzone.nordicsemi.com/thread/25558?ContentTypeID=1</link><pubDate>Thu, 28 May 2015 10:22:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cc468787-49e9-4543-b075-44eb3258314e</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;Alright! Thank you for the feedback! I&amp;#39;ll just include the link to the RTT tutorial here for others to see: &lt;a href="https://devzone.nordicsemi.com/tutorials/6/debugging-with-real-time-terminal/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging nRF51822 application through UART using SDK8.1 and eclipse/gcc toolchain</title><link>https://devzone.nordicsemi.com/thread/25557?ContentTypeID=1</link><pubDate>Thu, 28 May 2015 09:48:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7fab2be-db55-47d1-99dc-ebcbbd831619</guid><dc:creator>tumaku</dc:creator><description>&lt;p&gt;Thanks for the hints. They have helped me on my goal (debugging/loggig using the eclipse/gcc toolchain explained in the &lt;a href="https://devzone.nordicsemi.com/tutorials/7/development-with-gcc-and-eclipse/"&gt;tutorial&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;@nguyen: I had already tried app_uart without success. I retried it again and I got it working:)
Silly mistake from my side but I was using the default UART initialisation which I had to update&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;const app_uart_comm_params_t comm_params =
{
    RX_PIN_NUMBER,
    TX_PIN_NUMBER,
    RTS_PIN_NUMBER,
    CTS_PIN_NUMBER,
    APP_UART_FLOW_CONTROL_ENABLED,
    false,
    UART_BAUDRATE_BAUDRATE_Baud38400
};
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I disabled HW flow control (change &lt;code&gt;APP_UART_FLOW_CONTROL_ENABLED&lt;/code&gt; by &lt;code&gt;APP_UART_FLOW_CONTROL_DISABLED&lt;/code&gt;) and my serial connection started working at 38400 bauds. I used the Serial Monitor of my  Arduino IDE but any other serial terminal app should work.&lt;/p&gt;
&lt;p&gt;Interesting to note that the UART PINs (&lt;code&gt;RX_PIN_NUMBER&lt;/code&gt;, &lt;code&gt;TX_PIN_NUMBER&lt;/code&gt;)  are assigned/defined in
bsp.h -&amp;gt; boards.h -&amp;gt; pca10028.h (I am using BLE Nano but I use flag  &lt;code&gt;CFLAGS = -DBOARD_PCA10028&lt;/code&gt; in makefile)&lt;/p&gt;
&lt;p&gt;@stian Thanks a lot for pointing out the RTT tutorial. I had dismissed it because it included keil in the requirement list (I am using eclipse). However, I read it and it was straight forward to enable RTT logging with J-link in eclipse.&lt;/p&gt;
&lt;p&gt;I extracted the  RTT zip folder in my SDK component folder and then added a couple of files/lines to my makefile:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;C_SOURCE_FILES += \
...........
../../../../../../components/rtt/RTT/SEGGER_RTT.c \
../../../../../../components/rtt/RTT/SEGGER_RTT_printf.c \
...........


INC_PATHS += -I../../../../../../components/rtt/RTT
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Finally I included the RTT library in the main.c file of the project:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#include &amp;quot;SEGGER_RTT.h&amp;quot; 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;No need to initialise RTT with a explicit call. You can start using it in the code straight away:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SEGGER_RTT_WriteString(0, &amp;quot;Hello World!\n&amp;quot;); 
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;SEGGER_RTT_printf(0, &amp;quot;Length %d \n&amp;quot;, p_evt_write-&amp;gt;len);  
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you have J-Link (and J-Link RTT Viewer application as explained in the tutorial) there is no need for UART debugging anymore!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging nRF51822 application through UART using SDK8.1 and eclipse/gcc toolchain</title><link>https://devzone.nordicsemi.com/thread/25562?ContentTypeID=1</link><pubDate>Wed, 27 May 2015 13:17:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4c91d571-5cb9-481b-884f-acfc98d22206</guid><dc:creator>Stian R&amp;#248;ed Hafskjold</dc:creator><description>&lt;p&gt;It should be working in the ble examples in the sdk. Try the &lt;em&gt;ble_app_hrs&lt;/em&gt; example and define &lt;code&gt;ENABLE_DEBUG_LOG_SUPPORT&lt;/code&gt;, so that &lt;code&gt;app_trace_init()&lt;/code&gt; in &lt;strong&gt;app_trace.h&lt;/strong&gt; gets defined. Then call &lt;code&gt;app_trace_init()&lt;/code&gt; from the top of &lt;code&gt;main()&lt;/code&gt;. You should now see some activity on the &lt;code&gt;RX_PIN_NUMBER&lt;/code&gt; and &lt;code&gt;TX_PIN_NUMBER&lt;/code&gt;. You can set these pin definitions to what ever pin you want.&lt;/p&gt;
&lt;p&gt;It is documented here: &lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a00169.html"&gt;developer.nordicsemi.com/.../a00169.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You should also check out RTT debugging if you are using a JLINK debugger: &lt;a href="https://devzone.nordicsemi.com/tutorials/6/debugging-with-real-time-terminal/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging nRF51822 application through UART using SDK8.1 and eclipse/gcc toolchain</title><link>https://devzone.nordicsemi.com/thread/25561?ContentTypeID=1</link><pubDate>Sat, 23 May 2015 13:59:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e69af68-c8be-4635-8790-398ec10d614e</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Look for app_uart in the SDK.  There are also example code of that in the SDK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>