<?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>I can read &amp;quot;NRF_POWER-&amp;gt;RESETREAS&amp;quot; in code, but I can&amp;#39;t with nrfjprog</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/17511/i-can-read-nrf_power--resetreas-in-code-but-i-can-t-with-nrfjprog</link><description>I put my code before ble_stack_init() 
 reset_reason = NRF_POWER-&amp;gt;RESETREAS;
NRF_LOG_PRINTF(&amp;quot;reset_reason: 0x%08x.\n&amp;quot;,reset_reason );
//NRF_POWER-&amp;gt;RESETREAS = 0xffffffff;
 
 and it works 
 but when I tried nrfjprog, it did not work. 
 nrfjprog</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Nov 2016 23:51:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/17511/i-can-read-nrf_power--resetreas-in-code-but-i-can-t-with-nrfjprog" /><item><title>RE: I can read "NRF_POWER-&gt;RESETREAS" in code, but I can't with nrfjprog</title><link>https://devzone.nordicsemi.com/thread/67320?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2016 23:51:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f5ee41e-f28d-402e-ae7d-09c46c3332fa</guid><dc:creator>Jeong Hyun Seok</dc:creator><description>&lt;p&gt;You are right!
Why I did not think of breakpoint?
I checked Power Register in keil and checked when register value change.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;My colleague put clear code below somewhere.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thank you. it helped a lot. :-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can read "NRF_POWER-&gt;RESETREAS" in code, but I can't with nrfjprog</title><link>https://devzone.nordicsemi.com/thread/67321?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2016 09:16:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2f41411-c8b5-414b-a642-e7c6fcd32a61</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I am pretty sure that some part of your code is clearing the register. Can you please upload your test code and tell me the laser marking of the chip so that i can test it on my desk.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can read "NRF_POWER-&gt;RESETREAS" in code, but I can't with nrfjprog</title><link>https://devzone.nordicsemi.com/thread/67319?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 16:51:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb21036a-1d79-4b7a-a79f-2f0a6a11b361</guid><dc:creator>Jeong Hyun Seok</dc:creator><description>&lt;p&gt;Sorry for confusion.
But I actually did not used that line while I tested&lt;/p&gt;
&lt;p&gt;so my test was like this&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;reset_reason = NRF_POWER-&amp;gt;RESETREAS;
NRF_LOG_PRINTF(&amp;quot;reset_reason: 0x%08x.\n&amp;quot;,reset_reason );
//NRF_POWER-&amp;gt;RESETREAS = 0xffffffff;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I can read "NRF_POWER-&gt;RESETREAS" in code, but I can't with nrfjprog</title><link>https://devzone.nordicsemi.com/thread/67318?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2016 09:32:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f0fc8d4-9876-4fa0-a9af-07422ab7f6e2</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;That is because you are explicitly clearing the register in your program after you printed it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_POWER-&amp;gt;RESETREAS = 0xffffffff;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will clear the register before you get a chance to read from nrfjprog. Comment this out and you will read the same in both.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>