<?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>Flashing value to gpregret</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8804/flashing-value-to-gpregret</link><description>How do I write a value to gpregret when flashing the chip? 
 Basically, what I need to do is be able to detect the first time the chip is powered on so I can go into a special test mode. Once everything is verified as working, the app will clear gpregret</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 19 Aug 2015 04:14:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8804/flashing-value-to-gpregret" /><item><title>RE: Flashing value to gpregret</title><link>https://devzone.nordicsemi.com/thread/32309?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2015 04:14:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77cab347-7f7e-45d3-8b7d-bb6b49a2350d</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;I didn&amp;#39;t suggest erasing it - I suggested writing it - as long as you turn bits OFF you can write flash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing value to gpregret</title><link>https://devzone.nordicsemi.com/thread/32308?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2015 04:12:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d976a314-f987-4682-b4ea-d7583bc144ba</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Duh, I forgot about GPREGRET not being preserved after reset.  It was my understanding that UICR can&amp;#39;t be erased without erasing the entire chip as Aryan says in his answer here:
&lt;a href="https://devzone.nordicsemi.com/question/37682/erase-uicr-customer-registers/"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Flashing value to gpregret</title><link>https://devzone.nordicsemi.com/thread/32307?ContentTypeID=1</link><pubDate>Wed, 19 Aug 2015 03:58:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a2a5865e-84c1-4f01-96b0-49317d0cb8e5</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;Well you could try adding a section into your binary at the correct address to write it. However it&amp;#39;s not going to do what you want because even if you wrote it, GPREGRET isn&amp;#39;t preserved over a power on reset.&lt;/p&gt;
&lt;p&gt;Why don&amp;#39;t you write to the customer area of the UICR (again by adding a UICR section to your binary), something like 0x55555555, then when you&amp;#39;ve finished the test, enable writes to Flash and set it to 0x0000000. Or don&amp;#39;t write it at all, it&amp;#39;ll be 0xFFFFFFFF on first powerup, then write it to anything else.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>