<?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>How do I add RTT debugging to blinky example in Embedded Studio</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/59649/how-do-i-add-rtt-debugging-to-blinky-example-in-embedded-studio</link><description>Hi all, I apologise for this very basic question, but I don&amp;#39;t understand how to add/enable RTT debugging to my code. I want to practice writing basic code for the NRF5 SDK, and I think adding debugging to the blinky example is a good step. 
 What I have</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 03 Apr 2020 19:36:57 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/59649/how-do-i-add-rtt-debugging-to-blinky-example-in-embedded-studio" /><item><title>RE: How do I add RTT debugging to blinky example in Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/243464?ContentTypeID=1</link><pubDate>Fri, 03 Apr 2020 19:36:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfde7ab0-dba5-4f0a-801b-0716e05ebce6</guid><dc:creator>Eric Navarrete</dc:creator><description>&lt;p&gt;Thank you very much Karl, that has helped me get it working!&lt;/p&gt;
&lt;p&gt;I will need to keep reading through&amp;nbsp;all the infocenter pages on the logger module to really understand it, but this is a good first step.&lt;/p&gt;
&lt;p&gt;I will modify the code to use UART now for some practice.&lt;/p&gt;
&lt;p&gt;Thanks again&lt;/p&gt;
&lt;p&gt;-Eric&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add RTT debugging to blinky example in Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/243381?ContentTypeID=1</link><pubDate>Fri, 03 Apr 2020 11:33:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:62abfd18-ab7e-40d4-9456-615848ba245e</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hi Eric,&lt;br /&gt;&lt;br /&gt;I took your code, reverted to the original blinky sdk_config.h(so you could see exactly what needs to be added), and added the following:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;#ifndef NRF_LOG_ENABLED
#define NRF_LOG_ENABLED 1
#endif

#ifndef NRF_LOG_DEFERRED
#define NRF_LOG_DEFERRED 0
#endif

#ifndef NRF_LOG_BACKEND_RTT_ENABLED
#define NRF_LOG_BACKEND_RTT_ENABLED 1
#endif

#ifndef NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE
#define NRF_LOG_BACKEND_RTT_TEMP_BUFFER_SIZE 64
#endif

#ifndef NRF_LOG_BACKEND_RTT_TX_RETRY_DELAY_MS
#define NRF_LOG_BACKEND_RTT_TX_RETRY_DELAY_MS 1
#endif

#ifndef NRF_LOG_BACKEND_RTT_TX_RETRY_CNT
#define NRF_LOG_BACKEND_RTT_TX_RETRY_CNT 3
#endif

#ifndef SEGGER_RTT_CONFIG_BUFFER_SIZE_UP
#define SEGGER_RTT_CONFIG_BUFFER_SIZE_UP 512
#endif

#ifndef SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS
#define SEGGER_RTT_CONFIG_MAX_NUM_UP_BUFFERS 2
#endif

#ifndef SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN
#define SEGGER_RTT_CONFIG_BUFFER_SIZE_DOWN 16
#endif

#ifndef SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS
#define SEGGER_RTT_CONFIG_MAX_NUM_DOWN_BUFFERS 2
#endif

#ifndef SEGGER_RTT_CONFIG_DEFAULT_MODE
#define SEGGER_RTT_CONFIG_DEFAULT_MODE 0
#endif&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I also included the source files nrf_log_backend_rtt, nrf_log_default_backend and nrf_log_backend_serial from components/libraries/log/src, as well as the segger_rtt files from external/segger_rtt(along with adding its include path ../../../../../../external/segger_rtt to the end of the project included directories - options-&amp;gt;preprocessor-&amp;gt;User Included Directories). You can find this setting by right clicking on the project name, at the top of your project directory and selecting options.&lt;br /&gt;&lt;br /&gt;These files seem to be included in your project in your screenshots, but not when I opened the project files you sent earlier.&lt;br /&gt;&lt;br /&gt;The result from this is &amp;quot;Invert!&amp;quot; being printed in the RTT terminal along with the leds toggling like in the blinky example, the RTT output is seen in the included image.&lt;br /&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2b6ebf3756e148c2ad0e017cbe1c95f8/toEric.PNG" /&gt;&lt;br /&gt;&lt;br /&gt;I recommend that you use the program &amp;quot;J-link RTT Viewer&amp;quot; for viewing RTT messages, instead of the built in SES debug window. I find the debug window often behaves unexpectedly. Mind you that you may not have J-link RTT Viewer open at the same time as the debug terminal in SES, that will not work.&lt;br /&gt;&lt;br /&gt;If you would like to use the UART backend instead, take a look at an example using this, and see if you can change the code to use UART instead - I recommend this exercise!&lt;br /&gt;&lt;br /&gt; I&amp;#39;ll include the modified code in its entirety also, so that you may take a look.&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-2b6ebf3756e148c2ad0e017cbe1c95f8/my_5F00_code.zip"&gt;devzone.nordicsemi.com/.../my_5F00_code.zip&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Sorry for my late reply by the way, I had some issues with my network this morning.&lt;br /&gt;&lt;br /&gt;Hope you have a great weekend Eric, and please let me know if you should have any more questions and issues in the future! :)&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add RTT debugging to blinky example in Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/243069?ContentTypeID=1</link><pubDate>Thu, 02 Apr 2020 02:53:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b21a1684-7fda-47f1-9327-72463bbb9363</guid><dc:creator>Eric Navarrete</dc:creator><description>&lt;p&gt;Thanks for your help again.&lt;/p&gt;
&lt;p&gt;I am using Nrf5 SDK 16.0.0. and Segger embedded studio V4.52&lt;/p&gt;
&lt;p&gt;I tried adding&amp;nbsp;&lt;em&gt;NRF_LOG_INIT(NULL) &lt;/em&gt;to the start of main() but still nothing shows in debug window or RTT viewer.&amp;nbsp;I have tried using UART instead of RTT, so I have:&lt;/p&gt;
&lt;p&gt;-Added nrf_drv_uart.c, nrfx_uart.c, nrfx_uarte.c to the project in embedded studio.&lt;/p&gt;
&lt;p&gt;-Enabled NRF_LOG_BACKEND_UART_ENABLED in sdk_config.h&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Disabled NRF_LOG_BACKEND_RTT_ENABLED in sdk_config.h&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Unfortunately&lt;span&gt;&amp;nbsp;after those steps, the project doesn&amp;#39;t build. The error is:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;Building ‘blinky_pca10056_mbr’ from solution ‘blinky_pca10056_mbr’ in configuration ‘Release’
1&amp;gt; Compiling ‘nrf_log_str_formatter.c’
2&amp;gt; Compiling ‘nrf_log_frontend.c’
3&amp;gt; Compiling ‘nrf_log_backend_rtt.c’
4&amp;gt; Compiling ‘nrf_log_backend_serial.c’
5&amp;gt; Compiling ‘nrf_log_backend_uart.c’
6&amp;gt; Compiling ‘nrf_log_default_backends.c’
7&amp;gt; Compiling ‘boards.c’
8&amp;gt; Compiling ‘app_error_weak.c’
9&amp;gt; Compiling ‘app_error_handler_gcc.c’
10&amp;gt; Compiling ‘nrf_atomic.c’
11&amp;gt; Compiling ‘nrf_fprintf.c’
12&amp;gt; Compiling ‘nrf_balloc.c’
13&amp;gt; Compiling ‘nrf_fprintf_format.c’
14&amp;gt; Compiling ‘nrf_memobj.c’
15&amp;gt; Compiling ‘nrf_ringbuf.c’
5&amp;gt; C:\Nordic\nRF5_SDK_16.0.0_98a08e2\components\libraries\log\src\nrf_log_backend_uart.c:45:10: fatal error: nrf_drv_uart.h: No such file or directory
5&amp;gt; compilation terminated.
16&amp;gt; Compiling ‘nrf_strerror.c’
17&amp;gt; Compiling ‘nrfx_atomic.c’
Build failed&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I checked&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;em&gt;C:\Nordic\nRF5_SDK_16.0.0_98a08e2\components\libraries\log\src&amp;nbsp;&lt;/em&gt;and indeed there is no&amp;nbsp;nrf_drv_uart.h file there. That file is actually located at&amp;nbsp;&lt;em&gt;C:\Nordic\nRF5_SDK_16.0.0_98a08e2\integration\nrfx\legacy&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;So I&amp;#39;m not quite sure how to fix that error&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Eric&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/2020_2D00_04_2D00_02.png" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add RTT debugging to blinky example in Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/243012?ContentTypeID=1</link><pubDate>Wed, 01 Apr 2020 14:44:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1afedd14-b671-4e97-b0c3-867678552fcb</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Sorry, I did not see this in when initially reading your ticket. I misunderstood your question.&lt;/p&gt;
[quote user=""] I apologise for this very basic question[/quote]
&lt;p&gt;No problem at all, you do not need to apologize. I am happy to help!&lt;/p&gt;
&lt;p&gt;Which SDK version are you working with?&lt;br /&gt;&lt;br /&gt;From you code, I immediately notice that you do not call &lt;em&gt;NRF_LOG_INIT(NULL)&lt;/em&gt;, could you add this to the beginning of your main function, and see if this resolves your issue?&lt;br /&gt;Your includes and added project source files looks correct.&lt;br /&gt;&lt;br /&gt;If this does not solve your problem, I will build your code tomorrow and take a look!&lt;/p&gt;
&lt;p&gt;If you would like to read more about the Logger module you could do so &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_nrf_log.html"&gt;here&lt;/a&gt;, and its &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__nrf__log.html"&gt;API reference&lt;/a&gt; can be found here. Here can see how to use different logger debug levels to see different output during your development - such as using NRF_LOG_DEBUG printouts, which are not even compiled on the lower NRF_LOG_LEVELs.&lt;br /&gt;You could also use the non-RTT options, such as UART(then you can see it using a serial monitor), by enabling them instead of RTT :)&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add RTT debugging to blinky example in Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/242566?ContentTypeID=1</link><pubDate>Tue, 31 Mar 2020 01:32:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0da26cff-bcac-48d7-af2e-053ba19de63d</guid><dc:creator>Eric Navarrete</dc:creator><description>&lt;p&gt;Thank you for your response, I have seen that tutorial, however I am using Segger embedded studio. The tutorial only mentions Keil, also the RTT files it says to download don&amp;#39;t include syscalls for Segger embedded studio, so I thought it wouldn&amp;#39;t work. As for what I have done myself, I have tried using the SES built in debug window, Segger RTT viewer, and a Serial monitor, but nothing shows. The code builds fine in SES. Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add RTT debugging to blinky example in Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/242313?ContentTypeID=1</link><pubDate>Mon, 30 Mar 2020 08:39:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d719573-2d1a-4bb9-bb22-3895e816a8c2</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Thank you for including your code.&lt;br /&gt;Have you seen the &lt;a href="https://devzone.nordicsemi.com/nordic/nordic-blog/b/blog/posts/debugging-with-real-time-terminal"&gt;Debugging with RTT tutorial&lt;/a&gt;?&lt;br /&gt;If you have not, I highly recommend taking a look at it first. Be advised that since SDK v12.0.0 RTT is built into the NRF_LOG module.&lt;br /&gt;&lt;br /&gt;If you have seen the tutorial, and made sure you&amp;#39;ve followed the steps, please let me know where it does not perform as expected. You say nothing shows in your debug terminal - have you checked with a serial monitor as well?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I add RTT debugging to blinky example in Embedded Studio</title><link>https://devzone.nordicsemi.com/thread/242246?ContentTypeID=1</link><pubDate>Sun, 29 Mar 2020 14:15:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e31260e-bde7-49c7-883e-d6a545e240da</guid><dc:creator>Eric Navarrete</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/my_5F00_code.zip"&gt;devzone.nordicsemi.com/.../my_5F00_code.zip&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I forgot to add my code, so here it is if that helps at all&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>