<?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>enable debug in thingy52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/29961/enable-debug-in-thingy52</link><description>Hello guys. 
 I&amp;#39;m new with nodic nRF52 SDK and I tried to enable debug by setting 1 on &amp;quot;NRF_LOG_ENABLED&amp;quot; in sdk_config.h, but nothing happens in com port criated by Jtag (pca10040). 
 Where is my error? What is the correctly procedure?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 29 Jun 2018 14:15:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/29961/enable-debug-in-thingy52" /><item><title>RE: enable debug in thingy52</title><link>https://devzone.nordicsemi.com/thread/138299?ContentTypeID=1</link><pubDate>Fri, 29 Jun 2018 14:15:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:152e2a19-399b-42aa-81f3-51420de8c7f0</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Great to hear that you figured it out! I am not sure how exactly it works when you use gcc &amp;amp; makefiles, but in Keil &amp;amp; Segger Embedded Studio, you can often choose between a Release Build that could be more optimized for size or a debug build that is easier to debug with. &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/20122/what-s-difference-between-debug-mode-and-release-mode"&gt;See this link&lt;/a&gt; for a good explanation of the difference between the two.&lt;/p&gt;
&lt;p&gt;I do not think you would have needed to change the line:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#CFLAGS += NRF_LOG_ENABLED=1 # Use if RTT output is desired.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;to include a -D in front of it.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I believe the code optimization could be changed by taking a look at line 268 in the makefile:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;CFLAGS += -Wall -Werror -O3 -g3&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;It seems that -g3 includes debug symbols in the .out file &amp;amp; you can change -03 to -O0 to decrease optimization, I believe (&lt;a href="https://devzone.nordicsemi.com/tutorials/b/getting-started/posts/development-with-gcc-and-eclipse"&gt;see link&lt;/a&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable debug in thingy52</title><link>https://devzone.nordicsemi.com/thread/138173?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 15:07:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8d39134e-0c24-45f5-85f3-9352aef7bffe</guid><dc:creator>cprehn</dc:creator><description>&lt;p&gt;Never mind! It&amp;#39;s working now!&amp;nbsp; I was expecting some debug information on Thingy startup, but I had to go into one of the Thingy services in the smartphone app so that sensor data was being collected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable debug in thingy52</title><link>https://devzone.nordicsemi.com/thread/138168?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 14:51:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73ddd8f0-5e72-489c-83e9-da5e698415c6</guid><dc:creator>cprehn</dc:creator><description>&lt;p&gt;Line 273 of the makefile had the following line:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#CFLAGS += NRF_LOG_ENABLED=1 # Use if RTT output is desired.&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I uncommented it and added the -D in front.&amp;nbsp; Maybe I&amp;#39;m trying to compile the wrong version of the Thingy FW.&lt;/p&gt;
[quote userid="25682" url="~/f/nordic-q-a/29961/enable-debug-in-thingy52/119144"]I compiled the debug version of the Thingy FW.[/quote]
&lt;p&gt;Are there two different FW versions in the Nordic-Thingy52-FW-master directory, one for debugging and the other for release?&amp;nbsp; Or did you mean that the firmware was made into a debug version by applying the changes to the sdk_config.h file? Right now I&amp;#39;m compiling from Nordic-Thingy52-FW-master\project\pca20020_s132\armgcc.&amp;nbsp; There&amp;#39;s another directory (Nordic-Thingy52-FW-master\project\bootloader_secure\pca20020_debug) that obviously has something to do with debugging, but there&amp;#39;s no makefile and is too large to build in my version of Keil.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks again!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable debug in thingy52</title><link>https://devzone.nordicsemi.com/thread/138017?ContentTypeID=1</link><pubDate>Thu, 28 Jun 2018 07:30:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f4b5ce5-8150-4251-80b4-1550a3b715e2</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;I was a bit unsure about what the DEBUG flag does, but it seems like it adds blocking asserts instead of a reset loop when something goes wrong in your code (&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/8070/debug-flag-error-module-nrf52"&gt;see link&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Comparing the preprocessor symbols in Keil with the makefile located at:&amp;nbsp;project\pca20020_s132\armgcc\, I noticed this:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-0abd4e4150604bc9845735d5f542fa20/pastedimage1530170817654v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-0abd4e4150604bc9845735d5f542fa20/pastedimage1530170839717v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;The first picture shows the preprocessor definitions in Keil &amp;amp; the second picture shows the makefile. It seems the makefile sets a -D in front of the preprocessor definitions compared to Keil. If you go a bit further down, you notice that there is already a debug flag set at line 307:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ASMFLAGS += -DDEBUG&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;TLDR: The debug flag is already set in the makefile. You are good to go &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable debug in thingy52</title><link>https://devzone.nordicsemi.com/thread/137762?ContentTypeID=1</link><pubDate>Tue, 26 Jun 2018 19:22:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58b6ad86-e2a1-4b75-85d5-213de3407433</guid><dc:creator>cprehn</dc:creator><description>&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;I tried it on the original firmware.&amp;nbsp; I&amp;#39;m now able to get NRF_LOG_INFO data through RTT.&amp;nbsp; I&amp;#39;m using GCC to compile.&amp;nbsp; I changed the two settings in sdk_config from above and went into the makefile.&amp;nbsp; There, I uncommented the line for using RTT.&amp;nbsp; Would that be the same thing as setting the debug flag in Keil?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable debug in thingy52</title><link>https://devzone.nordicsemi.com/thread/135551?ContentTypeID=1</link><pubDate>Mon, 11 Jun 2018 11:45:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:462b307a-c535-4311-bd62-67fe88ed088e</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;I believe you might need to set the DEBUG flag in the preprocessor symbols (i.e. in Keil using the debug v1_0_0 FW, right click on project, Options for Target, C/C++ tab, write DEBUG inside the Define window). Otherwise, I believe you have done everything correctly. It might be something with your FW, so to double check, you can download the regular Thingy FW, make the RTT changes required &amp;amp; RTT should work. Or start commenting out some lines in your custom FW.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable debug in thingy52</title><link>https://devzone.nordicsemi.com/thread/135415?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 21:54:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7f61ad6d-44b5-4ddd-9766-5b57d9158e32</guid><dc:creator>cprehn</dc:creator><description>&lt;p&gt;I&amp;#39;m trying to debug custom Thingy52 firmware. I&amp;#39;ve followed the steps here to compile and modified the sdk_config.h file as described.&amp;nbsp; I can flash the Thingy and the J-Link RTT View seems to show connectivity, but no messages beyond this appear.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/rtt_5F00_screenshot.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there anything else that I need to do to show debugging information on the RTT Viewer?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: enable debug in thingy52</title><link>https://devzone.nordicsemi.com/thread/119144?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2018 13:09:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e55cedc4-e39e-4fbc-bd66-9b011dcc3e92</guid><dc:creator>Bj&amp;#248;rn Kvaale</dc:creator><description>&lt;p&gt;Hi Leoni,&lt;/p&gt;
&lt;p&gt;Unfortunately, the process is more difficult than this. You will need to first download the &lt;a href="https://www.nordicsemi.com/eng/nordic/Products/Nordic-Thingy-52/Thingy-52-SDK-zip/61951"&gt;Thingy FW code&lt;/a&gt;, then take a look at &lt;a href="https://nordicsemiconductor.github.io/Nordic-Thingy52-FW/"&gt;this link&lt;/a&gt; to be able to compile the Thingy FW. &lt;a href="https://nordicsemiconductor.github.io/Nordic-Thingy52-FW/documentation/firmware_compile.html"&gt;This link&lt;/a&gt; then shows you how to compile the Thingy FW. Remember to set &lt;code&gt;NRF_LOG_ENABLED 1&lt;/code&gt; &amp;amp; &lt;code&gt;NRF_LOG_BACKEND_RTT_ENABLED 1&lt;/code&gt; in sdk_config.h header file to enable logging over RTT. I compiled the debug version of the Thingy FW.&lt;/p&gt;
&lt;p&gt;Then, you have two options: the proper way via &lt;a href="https://devzone.nordicsemi.com/blogs/1085/getting-started-with-nordics-secure-dfu-bootloader/"&gt;secure dfu bootloader&lt;/a&gt; or an easy solution. I would recommend the easy solution at the beginning.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The easy solution:&lt;/strong&gt; Connect your Thingy:52 via a 10-pin SWD cable to the debug out port (P19) on an nrf52DK. Open nrf go studio (you can download it here (&lt;a href="https://www.nordicsemi.com/chi/nordic/Products/nRFgo-Studio/nRFgo-Studio-Win32/22286"&gt;32 bit&lt;/a&gt; or &lt;a href="https://www.nordicsemi.com/chi/nordic/Products/nRFgo-Studio/nRFgo-Studio-Win64/14964"&gt;64 bit&lt;/a&gt;) if you don&amp;#39;t have it already). Turn the dev kit &amp;amp; the Thingy devices on. Click on the Segger tab under nrf52 dev boards in Device Manager. Press the erase all button. Click on the Program Softdevice tab &amp;amp; flash the Softdevice v4.0.2 (located here: &lt;code&gt;thingy_fw\external\sdk13\components\softdevice\s132\hex&lt;/code&gt;
). Then, press on the Program Application tab &amp;amp; flash the Thingy application hex file that you compiled in Keil or GCC.&lt;/p&gt;
&lt;p&gt;Finally, open up the J-Link RTT Viewer program, change specify target device to the dev kit that you have &amp;amp; press the OK button. You should then get debug info via RTT.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>