<?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 Issue: Single Step vs Brakepoint not Yielding Same Result.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/981/debugging-issue-single-step-vs-brakepoint-not-yielding-same-result</link><description>I am new to ARM and nRF51822. I am using a development kit with the PCA10000 dongle and the PCA10005 daughter card. I wrote a simple C program (attached) to blink the LEDs on the dongle. I also hooked up LEDs to the same GPIO pins on the daughter card</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 26 Nov 2013 10:23:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/981/debugging-issue-single-step-vs-brakepoint-not-yielding-same-result" /><item><title>RE: Debugging Issue: Single Step vs Brakepoint not Yielding Same Result.</title><link>https://devzone.nordicsemi.com/thread/4657?ContentTypeID=1</link><pubDate>Tue, 26 Nov 2013 10:23:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51a6607d-42b0-49d8-9d1d-c156a28de52e</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;Sorry for overlooking that part. I edited my answer a little to expand somewhat on this, although I don&amp;#39;t really have any great suggestions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging Issue: Single Step vs Brakepoint not Yielding Same Result.</title><link>https://devzone.nordicsemi.com/thread/4656?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2013 19:47:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9e00c7b-39a5-4e16-bf88-43e10ebaeede</guid><dc:creator>Dalbert</dc:creator><description>&lt;p&gt;Hey, thanks for the response.  I really appreciate it.  I do intend to use the official SDK, and thanks for the tips on the issues with the flash.  The only point of my code was a learning exercise -- In regards to CLENR0, I was just trying to see if changing it made any difference.&lt;/p&gt;
&lt;p&gt;But, all this is besides the point.  Why would the same code work on the PCA10005 and not the PCA10000?   And what could cause a different result if I use a breakpoint vs a single step?   I can use J-Commander and see that the two devices are flashed exactly the same way.  If it is something that is unexplainable, that&amp;#39;s fine, maybe I will discover the answer as I continue learning...&lt;/p&gt;
&lt;p&gt;Thanks Again.&lt;br /&gt;
Dal&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Debugging Issue: Single Step vs Brakepoint not Yielding Same Result.</title><link>https://devzone.nordicsemi.com/thread/4655?ContentTypeID=1</link><pubDate>Mon, 25 Nov 2013 14:14:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5d670bf-bd85-4e9d-8cbe-fce35ddaf471</guid><dc:creator>Ole Morten</dc:creator><description>&lt;p&gt;It seems that you don&amp;#39;t use the official SDK. I&amp;#39;d strongly recommend you to do so, since it contains a lot of defines that makes your code nicer and easier to write. Especially consider using nrf51.h and nrf51_bitfields.h. There are also examples of a lot of things, that could be useful to refer to.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also having a little trouble understanding what you try to do at the start of your main function. The CLENR0 register in UICR is a flash register, and there is no need to write to it on every reset. I&amp;#39;d therefore recommend you to remove this snippet completely, and see if that changes anything.&lt;/p&gt;
&lt;p&gt;Also, beware that the upper 8 kB of flash is not on by default, and must be explicitly turned on. This doesn&amp;#39;t seem to be the problem here, but I guess it&amp;#39;s an issue you&amp;#39;ll easily hit later. In the SDK code, this is done with the following assembly code in the Reset_Handler:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;
/* Reset Handler */

    .equ    NRF_POWER_RAMON_ADDRESS,            0x40000524
    .equ    NRF_POWER_RAMON_RAMxON_ONMODE_Msk,  0xF  

    .text
    .thumb
    .thumb_func
    .align 1
    .globl    Reset_Handler
    .type    Reset_Handler, %function
Reset_Handler:
    .fnstart

/* Make sure ALL RAM banks are powered on */
    LDR     R0, =NRF_POWER_RAMON_ADDRESS
    LDR     R2, [R0]
    MOVS    R1, #NRF_POWER_RAMON_RAMxON_ONMODE_Msk
    ORRS    R2, R1
    STR     R2, [R0]

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;You may also have use in looking at &lt;a href="https://github.com/hlnd/nrf51-pure-gcc-setup"&gt;this GitHub repository&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Edit: As for the difference between the boards, I don&amp;#39;t have any immediate good explanations for that. The only thing I can think of that could be worth checking is the &amp;quot;Allow instruction set simulation&amp;quot; option in the J-Link settings (right-click the J-Link icon in the taskbar, go to settings tab). I&amp;#39;ve seen previously that this sometimes give unexpected behavior, although I can&amp;#39;t remember having seen anything like what you describe.&lt;/p&gt;
&lt;p&gt;You should of course also make sure that you start from blank flash before programming on both chips, but I assume you have already done so.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>