<?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 under linux [solved]</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/5494/debugging-under-linux-solved</link><description>Hi All, 
 I can compile and flash examples with my nrf51822 SDK on linux. I would like to use Code::Blocks as IDE.
Code::Blocks is transparent to run debugger. I try to use it with the following configuration: 
 
 start JLinkGDBServer:
konsole -e</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 09 Feb 2015 15:02:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/5494/debugging-under-linux-solved" /><item><title>RE: debugging under linux [solved]</title><link>https://devzone.nordicsemi.com/thread/19168?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2015 15:02:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c53408a1-ecd7-43f3-a499-abe158ab4b49</guid><dc:creator>zamek</dc:creator><description>&lt;p&gt;Hi All,&lt;/p&gt;
&lt;p&gt;I can found it.
Process is the following:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;1. start JLinkGDBServer: JLinkGDBServer -device nrf51822 -i swd -speed 1000
2. Start Code::Blocks
3. Global settings/debugger/default executable path: /usr/bin/arm-none-eabi-gdb
4. project/properties/debugger:
project connection type: TCP
ipaddress: localhost Port:2331
**uncheck** connect with extended-remote
**check** Do NOT adjust LD_LIBRARY_PATH before launching debugger

additional gdb commands:

before connection:
target remote localhost:2331
monitor speed 1000
monitor endian little
monitor flash breakpoints=1
monitor flash download=1
monitor flash device=swd
file ./build/&amp;lt;elf_file&amp;gt;
load

after connection:
thbreak main
monitor reset
continue
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;delete thbreak main if you don&amp;#39;t want to break in main&lt;/p&gt;
&lt;p&gt;thx
Zamek&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: debugging under linux [solved]</title><link>https://devzone.nordicsemi.com/thread/19165?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2015 08:08:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83639a2c-291d-4c86-9d74-b89134a11f36</guid><dc:creator>zamek</dc:creator><description>&lt;p&gt;Hi Charles,
thx for the link, I read it...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: debugging under linux [solved]</title><link>https://devzone.nordicsemi.com/thread/19167?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2015 08:04:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:be74abea-c970-4f94-96b4-582ce2242e8c</guid><dc:creator>zamek</dc:creator><description>&lt;p&gt;Hi Marcel,&lt;/p&gt;
&lt;p&gt;Could you list your .gdbinit in your home and project directory if exists?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: debugging under linux [solved]</title><link>https://devzone.nordicsemi.com/thread/19166?ContentTypeID=1</link><pubDate>Mon, 09 Feb 2015 07:57:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2edda7b-3008-448d-a22d-b11c79f24026</guid><dc:creator>Marcel Mulder</dc:creator><description>&lt;p&gt;I use QT Creator for debugging. The only thing I do is:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mon reset 0
load
mon reset 0
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;All other setting you mentioned are not necessary. They are already configures when you call JLinkGDBServer or JLink knows it already because it knows the target.
Using &amp;#39;mon reset&amp;#39; does not work for me somehow. I always use &amp;#39;mon reset 0&amp;#39;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: debugging under linux [solved]</title><link>https://devzone.nordicsemi.com/thread/19164?ContentTypeID=1</link><pubDate>Sun, 08 Feb 2015 20:25:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:869102eb-10ec-4dbf-b3be-e2813d1a8ec5</guid><dc:creator>Charles Manning</dc:creator><description>&lt;p&gt;Segger provide a gdb server for JLink. Use the documentation there.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://www.segger.com/jlink-gdb-server.html"&gt;www.segger.com/jlink-gdb-server.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once you have that it should be a matter of just hooking up a gdb server to Code blocks.&lt;/p&gt;
&lt;p&gt;BTW You might do better with something designed to do this sort of thing. eg &lt;a href="http://www.emide.org/"&gt;http://www.emide.org/&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>