<?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>setting DEBUG flag in eclipse</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/32806/setting-debug-flag-in-eclipse</link><description>I am trying to track down a fatal error and want to use the Error module as documented below, to get the line number and file name. 
 Using eclipse, where should DEBUG be set. So far I have tried sdk_config.h file with the following addition: 
 #ifndef</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Apr 2018 07:16:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/32806/setting-debug-flag-in-eclipse" /><item><title>RE: setting DEBUG flag in eclipse</title><link>https://devzone.nordicsemi.com/thread/129269?ContentTypeID=1</link><pubDate>Mon, 23 Apr 2018 07:16:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:296873f1-b3c5-4bdd-b52e-03f7cb450036</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Try setting the assembler also.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;ASMFLAGS += -DDEBUG&lt;/p&gt;
&lt;p&gt;The .elf /.out file contains a lot of extra&amp;nbsp;non-executable data(meta-information,&amp;nbsp;debugging information) that is not present in the .hex&lt;/p&gt;
&lt;p&gt;So try using arm-none-eabi-addr2line with the .out file instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: setting DEBUG flag in eclipse</title><link>https://devzone.nordicsemi.com/thread/129122?ContentTypeID=1</link><pubDate>Fri, 20 Apr 2018 10:39:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f97819f-d959-4bfd-9913-dd73a05c5b04</guid><dc:creator>venerley</dc:creator><description>&lt;p&gt;I am not getting into&amp;nbsp;&lt;em&gt;&lt;strong&gt;app_error_save_and_stop()&amp;nbsp;&lt;/strong&gt;&lt;/em&gt;and don&amp;#39;t have an &lt;em&gt;&lt;strong&gt;elf&lt;/strong&gt; &lt;/em&gt;file, however was under the impression that a&amp;nbsp;&lt;em&gt;&lt;strong&gt;hex &lt;/strong&gt;&lt;/em&gt;file is actually contained the &lt;em&gt;&lt;strong&gt;elf&lt;/strong&gt;&lt;/em&gt; data.&lt;/p&gt;
&lt;p&gt;Unfortunately &lt;em&gt;&lt;strong&gt;arm-none-eabi-addr2line&amp;nbsp;&lt;/strong&gt;&lt;/em&gt;doesn&amp;#39;t appear to like my hex file, (it is the file I flash onto the board) I get the following:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;/Users/venerly/nordic/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-addr2line 200516 -e nrf52832_xxaa.hex&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;which outputs:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;strong&gt;??:0&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: setting DEBUG flag in eclipse</title><link>https://devzone.nordicsemi.com/thread/127575?ContentTypeID=1</link><pubDate>Tue, 10 Apr 2018 09:30:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d1bb7d7-9ad0-49c5-ac78-db843763939f</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Is the code going into app_error_save_and_stop() ?&lt;/p&gt;
&lt;p&gt;If you have access the the PC, and you have the .elf file, you could use&amp;nbsp;arm-none-eabi-addr2line to find where it is failing also.&lt;/p&gt;
&lt;p&gt;// Example, pc=0x01BEEF&lt;/p&gt;
&lt;p&gt;$ arm-none-eabi-addr2line &lt;span&gt;0x01BEEF&lt;/span&gt; -e app_beacon.elf&lt;/p&gt;
&lt;p&gt;C:\folder\SDK\src\main.c:34&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: setting DEBUG flag in eclipse</title><link>https://devzone.nordicsemi.com/thread/127283?ContentTypeID=1</link><pubDate>Sat, 07 Apr 2018 11:07:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:efecbefc-e5f1-4f43-9015-834c310444b2</guid><dc:creator>venerley</dc:creator><description>&lt;p&gt;Unfortunately I am not seeing the expected behaviour. Despite implementing all of the above&amp;nbsp;with the addition of adding&amp;nbsp;&lt;strong&gt;&lt;em&gt;app_error_weak.c&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;&lt;em&gt;&lt;/em&gt;to the makefile to ensure it is recompiled. I can see &lt;span&gt;&lt;strong&gt;-DDEBUG&lt;/strong&gt; applied to the&amp;nbsp;compilation of&amp;nbsp;&lt;strong&gt;&lt;em&gt;app_error_weak.c &lt;/em&gt;&lt;/strong&gt;in the build log.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;However I am not hitting the expected line:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/Nordic_5F00_FatalError.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It has just&amp;nbsp;&lt;/span&gt;occurred to me that I am using &lt;strong&gt;segger RTT&lt;/strong&gt; which could be effecting the behaviour of &lt;em&gt;&lt;strong&gt;NRF_LOG_FINAL_FLUSH()&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;/em&gt;Also Eclipse isn&amp;#39;t alway honest when comes to highlighting.&lt;/p&gt;
&lt;p&gt;So I have access to the PC, I guess I need to manually go through the map file to determine where things are failing?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: setting DEBUG flag in eclipse</title><link>https://devzone.nordicsemi.com/thread/126839?ContentTypeID=1</link><pubDate>Wed, 04 Apr 2018 12:22:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19592397-36fb-4372-b8bd-a39fb236e465</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You should define DEBUG in the makefile. I.e.&amp;nbsp;CFLAGS += -DDEBUG&lt;/p&gt;
&lt;p&gt;You should also add the&amp;nbsp;&lt;span&gt;&lt;a href="https://gcc.gnu.org/onlinedocs/gcc/Debugging-Options.html"&gt;-g3 flag&lt;/a&gt;&lt;/span&gt;&amp;nbsp;and remove compiler optimization (to get expected debug results). I.e.&amp;nbsp;CFLAGS += -Wall -Werror -O0 -g3.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>