<?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 blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5212/debugging-blinky-example-with-gnu-eclipse-with-sdk7-x</link><description>I&amp;#39;m trying to debug the blinky example with SDK 7.1 using Eclipse Luna. Going through several threads here I could figure out configurations needed and build the app. I can download the app through nRF studio and it works fine. However the issue comes</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 24 Jan 2015 22:51:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5212/debugging-blinky-example-with-gnu-eclipse-with-sdk7-x" /><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18261?ContentTypeID=1</link><pubDate>Sat, 24 Jan 2015 22:51:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:839310b2-2d8e-421b-9da6-236f7174660e</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;The plugins described on my blog work perfectly with both JLink and OpenOCD.  I work mainly with Eclipse on OS X.  Only Eclipse Luna that has issues with debug.  Avoid Luna, works fine with Kepler and Mars.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18260?ContentTypeID=1</link><pubDate>Sat, 24 Jan 2015 17:09:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0101e07a-0c08-4360-bd72-fe124cd76230</guid><dc:creator>Makarand K</dc:creator><description>&lt;p&gt;Thanks Nguyen, let me give it a shot. But I&amp;#39;ll leave this thread here for now, I&amp;#39;m getting digressed into tool chain issue than what I&amp;#39;m trying to build :( I&amp;#39;d stick to the evaluation copy of Keil uVision till I hit the 32K code limit. Hope that by that time I&amp;#39;d get something working with the GNU tools&lt;/p&gt;
&lt;p&gt;The image which worked for Vidar doesn&amp;#39;t work with gdb on my setup. The only difference I can think of is the JLink settings. Is there something you can think of that I might be able to try in this direction?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18259?ContentTypeID=1</link><pubDate>Sat, 24 Jan 2015 13:18:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4f33b89-08fc-4885-9d6e-ec2f41d96911</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;That&amp;#39;s right, if Keil debug then it should also work in Eclipse.  I have a blinky example on my blog.  It is a pure Eclipse project not makefile.  Can you try that se if it works for you.  All the examples on my blog are pure Eclipse project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18258?ContentTypeID=1</link><pubDate>Sat, 24 Jan 2015 04:47:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a0483381-8e31-4357-b56f-d3fafd723357</guid><dc:creator>Makarand K</dc:creator><description>&lt;p&gt;Can&amp;#39;t find any information like this. But if Keil can debug, then the mechanism must be same right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18256?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2015 21:04:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:98a8c76c-ddec-4b41-930d-60531da31b53</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;I haven&amp;#39;t seen the new DK.  is the jlink separate or onboard ? If on board, is there a switch that allows to switch in or out the jlink ?  It does not seems to connect to the target&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18257?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2015 17:10:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9aa1b2e6-949a-414b-916b-1eba8410a892</guid><dc:creator>Makarand K</dc:creator><description>&lt;p&gt;doesn&amp;#39;t help, it doesn&amp;#39;t even hit the reset handler. I believe there is something wrong while accessing the device. when I connect the target, I read 0xffffffff at adress 0 which doesn&amp;#39;t seem right. Do you think that&amp;#39;s correct?&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Checking target voltage...
Target voltage: 3.30 V
Listening on TCP/IP port 2331
Connecting to target...Connected to target
Waiting for GDB connection...Connected to 127.0.0.1
Reading all registers
Read 4 bytes @ address 0x00000000 (Data = 0xFFFFFFFF)
Resets core &amp;amp; peripherals via SYSRESETREQ &amp;amp; VECTRESET bit.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18263?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2015 11:34:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d4f52a39-48c4-48d0-830f-d8640867f1ec</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Ok, then try to set the breakpoint in the Reset function see if it stops there.  From there you can check to see until where it stops working.  It&amp;#39;s the function where you found the RAM settings.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18268?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2015 10:29:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53f57a90-e7e5-4e2f-a6bb-aa6fae9af04d</guid><dc:creator>Makarand K</dc:creator><description>&lt;p&gt;it&amp;#39;s the nrf51-DK (pca10028) board. So I believe it should be xxAC (and so does the chip on the board reads)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18269?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2015 08:16:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d85c821-2a83-4001-b829-26bc49925291</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Yes, looks good.  I see that you set the chip is xxAC.  Which board are you using ? The xxAC has 32KB of RAM, the xxAA has 16KB.  Make sure you have the correct chip.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18267?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2015 05:07:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:207d9972-d94f-48ae-b44b-f490009439b3</guid><dc:creator>Makarand K</dc:creator><description>&lt;p&gt;This is what the gcc_startup_nrf51.s says:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;/* Make sure ALL RAM banks are powered on */
    MOVS    R1, #NRF_POWER_RAMONx_RAMxON_ONMODE_Msk
    
    LDR     R0, =NRF_POWER_RAMON_ADDRESS
    LDR     R2, [R0]
    ORRS    R2, R1
    STR     R2, [R0]

LDR     R0, =NRF_POWER_RAMONB_ADDRESS
LDR     R2, [R0]
ORRS    R2, R1
STR     R2, [R0]
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Does this look good ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18266?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2015 05:00:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dd6fbdde-e6fb-4473-975f-8ded7b429c53</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Looks like the RAM is not enabled.  Check in the startup code see if it enables the RAM.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18265?ContentTypeID=1</link><pubDate>Fri, 23 Jan 2015 03:40:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5ee3c0c-dafd-45df-b550-fc8b86217989</guid><dc:creator>Makarand K</dc:creator><description>&lt;p&gt;No, it&amp;#39;s just the blinky app. If I directly flash the .out file, it worked fine. My main issue is with the debugger. First it doesn&amp;#39;t stop at the main() routine as indicated in debug configuration. Second when I hit run, it seems to get SIGTRAP as I&amp;#39;d shown in the screenshots above. Now if I stop the debugger and switch-off/switch-on the board I see the lights blinking! First I doubted if I&amp;#39;d accidently flashed the code. But even after erasing the whole flash with nRF studio, I could repeat the whole behavior, so looks like somehow the flash is getting programmed instead of debugger taking over&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18264?ContentTypeID=1</link><pubDate>Thu, 22 Jan 2015 18:44:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d635b877-f388-4d24-a8a7-a324c9c88d00</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Is it a BLE application ? If it is then you must flash in the softdevice (s110, s120, or ...) first.  It looks like you don&amp;#39;t have it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18262?ContentTypeID=1</link><pubDate>Thu, 22 Jan 2015 17:36:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ee0d10c-5b83-49e8-ab81-8c2390abe9dd</guid><dc:creator>Makarand K</dc:creator><description>&lt;p&gt;Thank you so much. I can get the application running with Mars. But the execution doesn&amp;#39;t halt at the breakpoint at main()
Neither can I single step. Is there some settings I&amp;#39;m missing ? I&amp;#39;m using the application which comes with examples in SDK7.0 given by Nordic&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18255?ContentTypeID=1</link><pubDate>Thu, 22 Jan 2015 16:29:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6b0cd902-78cf-4c85-96f3-b7795c50d51e</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;To work with Eclipse, go here &lt;a href="http://embeddedsoftdev.blogspot.ca/p/ehal-nrf51.html"&gt;embeddedsoftdev.blogspot.ca/.../ehal-nrf51.html&lt;/a&gt;
Luna is not recommended.  Use Kepler or Mars.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18254?ContentTypeID=1</link><pubDate>Thu, 22 Jan 2015 16:18:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ea098bf5-d087-4074-9985-924de36625bc</guid><dc:creator>Makarand K</dc:creator><description>&lt;p&gt;I&amp;#39;ve the above two changes in place. Still no luck. Here are the portions of makefile that point to these flags:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#flags common to all targets
CFLAGS  = -DNRF51
CFLAGS += -DBSP_DEFINES_ONLY
CFLAGS += -DBOARD_PCA10028
CFLAGS += -mcpu=cortex-m0
CFLAGS += -mthumb -mabi=aapcs --std=gnu99
CFLAGS += -Wall -Werror -O0 -g3
CFLAGS += -mfloat-abi=soft
# keep every function in separate section. This will allow linker to dump unused functions
CFLAGS += -ffunction-sections -fdata-sections -fno-strict-aliasing
#CFLAGS += -flto -fno-builtin

# keep every function in separate section. This will allow linker to dump unused functions
LDFLAGS += -Xlinker -Map=$(LISTING_DIRECTORY)/$(OUTPUT_FILENAME).map
LDFLAGS += -mthumb -mabi=aapcs -L $(TEMPLATE_PATH) -T$(LINKER_SCRIPT)
LDFLAGS += -mcpu=cortex-m0
# let linker to dump unused sections
LDFLAGS += -Wl,--gc-sections
# use newlib in nano version
LDFLAGS += --specs=nano.specs -lc -lnosys

# Assembler flags
ASMFLAGS += -x assembler-with-cpp
ASMFLAGS += -DNRF51
ASMFLAGS += -DBSP_DEFINES_ONLY
ASMFLAGS += -DBOARD_PCA10028
#default target - first one defined
default: clean nrf51422_xxac
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I see a SIGTRAP after running the code (please see the screen shot)&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/Untitled4.png" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging blinky example with GNU Eclipse with SDK7.x</title><link>https://devzone.nordicsemi.com/thread/18253?ContentTypeID=1</link><pubDate>Thu, 22 Jan 2015 09:00:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6f3a665-4825-492d-a270-eeaa16195600</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Makefile.common is decprecated in SDK v.7+, and the project makefiles are now standalone. Some of the other changes are that they no longer have the debug target and it&amp;#39;s compiled as release with optimization by default. In order to enable debugging you need to replace the -O3 option with -O0 and add -g3 in cflags to include debug symbols. The CFLAG variable should therefore be set like this CFLAGS += -O0 -g3.&lt;/p&gt;
&lt;p&gt;You also need to comment out the &lt;a href="https://gcc.gnu.org/onlinedocs/gcc/Optimize-Options.html"&gt;-flto&lt;/a&gt; optimization. Otherwise the debug symbols will be removed from the compile: #CFLAGS += -flto -fno-builtin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>