<?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>SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16749/sd132-nrf52-gcc-debugging</link><description>Hi 
 I&amp;#39;m trying to port my firmware to the NRF52 DK, but I&amp;#39;m having trouble getting it to work.
Could you give me a hint based on the stack trace below, what the problem might be? 
 Thread #1 &amp;lt;main&amp;gt; (Suspended : Signal : SIGTRAP:Trace/breakpoint trap</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 04 Oct 2016 16:34:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16749/sd132-nrf52-gcc-debugging" /><item><title>RE: SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/thread/64035?ContentTypeID=1</link><pubDate>Tue, 04 Oct 2016 16:34:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb28296a-1362-4c70-8434-57322891a15a</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Thanks for your help!&lt;/p&gt;
&lt;p&gt;The hint with checking the Makefile and ld-file in deep was the clue...
When moving my source files to the nrf52 makefile I copied the system_nrf51.c files...
This lead to the odd behaviour...&lt;/p&gt;
&lt;p&gt;Such a dumb mistake.
Thanks for your time in pinning this down!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/thread/64038?ContentTypeID=1</link><pubDate>Mon, 03 Oct 2016 10:26:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:317eaff1-52a4-4509-b6bd-721703e35541</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Agree with what @butch is saying. I can&amp;#39;t make much sense of register values other than that there is some memory corruption. I suspect this can be related to either the startup files or that the &amp;quot;common&amp;quot; linker script is for the 51.&lt;/p&gt;
&lt;p&gt;Your .ld settings seems correct, worst case with these settings is that you get a &amp;quot;no mem&amp;quot; assertion when enabling the stack if the RAM base is too low. It should not end up in a hardfault.&lt;/p&gt;
&lt;p&gt;I would suggest to use try with the example/ble_app_template/s132/ example, and change the makefile so that it includes your source files, and see if it makes any difference. This should at least ensure that the startup and linker configurations are correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/thread/64037?ContentTypeID=1</link><pubDate>Sun, 02 Oct 2016 14:51:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59fa9142-5a3e-44ff-8c18-778f2d7492d9</guid><dc:creator>butch</dc:creator><description>&lt;p&gt;Just thinking out loud... the lower nine bits of XPSR shows it is a hard fault.  The PC is in RAM, which is strange.  The SP is a very small number, which is strange, the stack is high in RAM and grows down?  The LR is odd, aren&amp;#39;t instructions word aligned?  How did you choose your .ld file, since the example/ble_app_template/s132/....ld is different?  I could be wrong on any of this.  Are you able to step through assembly code and do you have a reading knowledge of assembler (that is how I might tackle this?)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/thread/64036?ContentTypeID=1</link><pubDate>Sun, 02 Oct 2016 11:05:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90033d5f-50a6-4314-ae93-38d8218e4fda</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;These are my ld-file settings:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;MEMORY
    {
      FLASH (rx) : ORIGIN = 0x1f000, LENGTH = 0x61000
      RAM (rwx) :  ORIGIN = 0x20002080, LENGTH = 0xdf80
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The output of nrfjprog readregs is&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;R0:   0x0001E0D1
R1:   0x20001248
R2:   0x00002000
R3:   0x00000000
R4:   0x10001000
R5:   0x00000000
R6:   0x00000000
R7:   0x0001E0D1
R8:   0x00000000
R9:   0x00000000
R10:  0x00000000
R11:  0x00000000
R12:  0x00000000
SP:   0x20001230
LR:   0xFFFFFFF9
PC:   0x20001248
xPSR: 0x61000003
MSP:  0x20001230
PSP:  0x00000000
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Meanwhile I also tried to compile with gcc 4.9 and 5.2 without success. The symptoms stay the same... :-(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/thread/64034?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 12:35:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bea2177-51ca-45ee-a3d7-3a284e6d1a95</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Upfront: I&amp;#39;m using SD132 V3.
I paste the registers later. Hope this might help already.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/thread/64033?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 09:55:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22d18673-18be-4d48-b6c5-48f9432db5e3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Looks like the sigtrap is occurring in the softdevice, hence no debug symbols. Please include the core register values in your description. You can do that from Eclipse, or call nrfjprog --readregs -f nrf52. Also which version of the SD are using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/thread/64032?ContentTypeID=1</link><pubDate>Fri, 30 Sep 2016 07:50:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21f51d6e-3fc3-4276-acd8-0412299c9e30</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;these are all my defines, some of them are project specific:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;-DNRF52 
-D__HEAP_SIZE=0 
-D__VERSION_STR__=\&amp;quot;1.0.0.31\&amp;quot; 
-DSOFTDEVICE_PRESENT 
-DBOARD_PCA10040 
-DNRF52_PAN_12 
-DNRF52_PAN_15 
-DNRF52_PAN_58 
-DNRF52_PAN_55 
-DNRF52_PAN_54 
-DNRF52_PAN_31 
-DNRF52_PAN_30 
-DNRF52_PAN_51 
-DNRF52_PAN_36 
-DNRF52_PAN_53 
-DNRF_LOG_USES_RTT=1 
-DS132 
-DCONFIG_GPIO_AS_PINRESET 
-DBLE_STACK_SUPPORT_REQD 
-DSWI_DISABLE0 
-DNRF52_PAN_20 
-DNRF52_PAN_64 
-DNRF52_PAN_62 
-DNRF52_PAN_63 
-mcpu=cortex-m4 
-mthumb 
-mabi=aapcs 
--std=gnu99 
-mfloat-abi=hard 
-mfpu=fpv4-sp-d16 
-ffunction-sections 
-fdata-sections 
-fno-strict-aliasing 
-fno-builtin 
--short-enums  
-DBSP_DEFINES_ONLY 
-DREEDSWITCH 
-DUSE_EEPROM=1 
-DESB 
-DNRF_ESB_MAX_PAYLOAD_LENGTH=128 
-Wall -Werror -O0 -g3
-DDEBUG
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But still no symbols - this is really puzzling me, as it works nice with the NRF51...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SD132 NRF52 gcc debugging</title><link>https://devzone.nordicsemi.com/thread/64031?ContentTypeID=1</link><pubDate>Thu, 29 Sep 2016 20:18:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a16c416-8922-4fae-a996-74a97b3164a1</guid><dc:creator>butch</dc:creator><description>&lt;p&gt;Can&amp;#39;t you compile with debug symbols built into the object file (CFLAGS += -DDEBUG) so gdb can print out a readable trace?  Even if you could determine which handler was called (at ...ffff9) , with debug symbols compiled in the trace would tell you the name of the last function called etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>