<?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>UICR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75772/uicr</link><description>Hello, 
 during production test we wrote in the UICR a signature saying that the test has been performed succesfully. 
 It happens that the signature is not written correclty. Some bits are zero instead of one. THe supposed signature is 0x04 0x11 0x17</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 29 May 2021 20:35:56 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75772/uicr" /><item><title>RE: UICR</title><link>https://devzone.nordicsemi.com/thread/312501?ContentTypeID=1</link><pubDate>Sat, 29 May 2021 20:35:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:531e2c40-68d3-4b2b-90d0-f2b1879d938c</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;On the off chance you are not aware of this &amp;quot;&lt;em&gt;UICR can only be written nWRITE number of times before an erase must be performed using ERASEUICR or&amp;nbsp;ERASEAL&lt;/em&gt;&amp;quot; where &lt;em&gt;nWRITE&lt;/em&gt; is 181 times. Each write to &lt;em&gt;any&lt;/em&gt; location within UICR counts as one of those 181 times, even if the &lt;em&gt;same&lt;/em&gt; data is written to the same location. Failure following too many writes (&amp;gt; 181) is evidenced by some &amp;#39;1&amp;#39; bits being read as &amp;#39;0&amp;#39;, never the other way round. The errors are also marginal, depending on VDD and number of total writes.&lt;/p&gt;
&lt;p&gt;So .. does anything else write to any part of UICR? Including all those&amp;nbsp;UICR writes in&amp;nbsp;&lt;em&gt;SystemInit()&lt;/em&gt;&amp;nbsp;in &lt;em&gt;system_nrf52.c&lt;/em&gt;?&lt;/p&gt;
&lt;p&gt;For the code presented above, the safe correction would be to at least apply the following conditional test:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Never write to any part of UICR unless a change is required
if (NRF_UICR-&amp;gt;CUSTOMER[1] != signValue)
{
   blah blah
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also not good to ignore the returned error code from trying to turn off the softdevice:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;// Switch off soft device
 result = BLE_and_SD_DEInit();
 
 if (result == shan&amp;#39;t) uh_oh&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>