<?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>SECUREAPPROTECT and Non Secure code loading</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/44584/secureapprotect-and-non-secure-code-loading</link><description>Dear all, 
 
 I&amp;#39;ve been struggling with SECUREAPPROTECT register in UICR Flash area on a nRF9160 DK. 
 I would like to restrict and protect Secure code loaded in Secure mapped memory. Thus I defined Secured regions with SPU (0x0 to 0x40000 is Sec), load</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 10 Jul 2020 20:06:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/44584/secureapprotect-and-non-secure-code-loading" /><item><title>RE: SECUREAPPROTECT and Non Secure code loading</title><link>https://devzone.nordicsemi.com/thread/259534?ContentTypeID=1</link><pubDate>Fri, 10 Jul 2020 20:06:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6e4b02e-b1e5-4340-be6f-6d4ac5130874</guid><dc:creator>erik.johnson</dc:creator><description>&lt;p&gt;Has there been any kind of resolution on this? I&amp;#39;m also hitting this exact barrier with a similar setup.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SECUREAPPROTECT and Non Secure code loading</title><link>https://devzone.nordicsemi.com/thread/176266?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 15:51:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea3c728-c08f-43a7-9aba-52423f0fd515</guid><dc:creator>Nico_ID</dc:creator><description>&lt;p&gt;I can&amp;#39;t find any detailled description of the modifications performed by &amp;quot;ALL&amp;quot; level set on read back protection.&lt;/p&gt;
&lt;p&gt;I would like to be sure that it does not lock the whole board without any possibility to recover it (SECUREAPPROTECT + APPROTECT + ERASEPROTECT).&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Back to my objective, I would like to lock the board from the secure code. How can I achieve that ?&lt;br /&gt;Have you been able to reproduce the issue ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SECUREAPPROTECT and Non Secure code loading</title><link>https://devzone.nordicsemi.com/thread/176205?ContentTypeID=1</link><pubDate>Thu, 14 Mar 2019 13:31:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:264e8ace-66e6-4751-bf10-b92e8a58af00</guid><dc:creator>Hakon</dc:creator><description>&lt;p&gt;Another way of enabling read back protection is to use nrfjprog. Write &amp;quot;nrfjprog --rbp ALL&amp;quot;. Try that and see if you are able to read the non-secure memory after that.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SECUREAPPROTECT and Non Secure code loading</title><link>https://devzone.nordicsemi.com/thread/175738?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 15:39:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9f3b552d-697f-42d2-b7ac-25025d251dc1</guid><dc:creator>Nico_ID</dc:creator><description>&lt;p&gt;I guess that I&amp;#39;m doing something wrong. I read many times to document you mentionned&amp;nbsp; and to be honest some parts are not so easy to understand, in particular the fact that we can ERASE the flash even if ERASEPORTECT is set (using a key through CTRL-AP). But that is another story.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I do set SECUREAPPROTECT, switching it from 0xFFFFFFFF (default state) to 0x0.&lt;br /&gt;However, after that manipulation, the non secure part is no longer programmable. Or at least the methods I use (those listed in my original post) are no longer usable.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you elaborate please on how to &amp;quot;properly&amp;quot; set SECUREAPPROTECT ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here is what I&amp;#39;m doing, am I missing something to enable non secure loading ?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void UICR_SecureProtect(void) {
  // Enabling Write in Config
  NRF_NVMC-&amp;gt;CONFIG = NVMC_CONFIG_WEN_Wen &amp;lt;&amp;lt; NVMC_CONFIG_WEN_Pos;
  while (NRF_NVMC-&amp;gt;READY == NVMC_READY_READY_Busy);
  // Issunig Protect command
  NRF_UICR_S-&amp;gt;SECUREAPPROTECT = 0;
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: SECUREAPPROTECT and Non Secure code loading</title><link>https://devzone.nordicsemi.com/thread/175717?ContentTypeID=1</link><pubDate>Tue, 12 Mar 2019 14:43:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55fb48b2-9aaf-4a3b-a5ec-faa79983ea14</guid><dc:creator>Hakon</dc:creator><description>[quote user=""]Is that&amp;nbsp;possible with nRF9160 to load and lock the Secure part, give the board to another dev team that will load and lock the non secure part without having the possibility to dump or debug secure part ?[/quote]
&lt;p&gt;&amp;nbsp;Yes, it is possible. You should not be able to access the secure part or debug it once SECUREAPPROTECT is set properly. See &lt;a href="https://www.nordicsemi.com/DocLib/Content/Product_Spec/nRF9160/latest/nRF9160_html5_keyfeatures"&gt;https://www.nordicsemi.com/DocLib/Content/Product_Spec/nRF9160/latest/nRF9160_html5_keyfeatures&lt;/a&gt; for further details of how it&amp;#39;s done.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>