<?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>How to enable APPPROTECT, SECUREAPPROTECT and ERASEPROTECT on nRF5340?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/107311/how-to-enable-appprotect-secureapprotect-and-eraseprotect-on-nrf5340</link><description>Hi All 
 I&amp;#39;m devolving the product by using nRF5340. I found a problem when I needed to disable the J-Link Port by enabling APPPROTECT, SECUREAPPROTECT and ERASEPROTECT. This is my source for testing that feature. 
 
 
 And this is my project configuration</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 30 Jan 2024 08:50:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/107311/how-to-enable-appprotect-secureapprotect-and-eraseprotect-on-nrf5340" /><item><title>RE: How to enable APPPROTECT, SECUREAPPROTECT and ERASEPROTECT on nRF5340?</title><link>https://devzone.nordicsemi.com/thread/466682?ContentTypeID=1</link><pubDate>Tue, 30 Jan 2024 08:50:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d20dc125-cd33-4dac-a06e-cdd91bc4c21b</guid><dc:creator>wasan</dc:creator><description>&lt;p&gt;HI Sigurd&lt;br /&gt;&lt;br /&gt;Thank you for your information. &lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Actually, I work with nRF9160 to enable APPPROTECT, SECUREAPPROTECT, and ERASEPROTECT of the nRF device before using nRF5340. In this post, I&amp;#39;ve submitted a ticket providing information on how to enable it:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/93169/how-to-remove-the-nrf9160-s-erase-protection"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/93169/how-to-remove-the-nrf9160-s-erase-protection&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;However, I&amp;#39;ve discovered that the same process doesn&amp;#39;t work when applied to nRF5340. After studying your playground and reviewing the information, I found differences between nRF9160 and nRF5340 regarding the mechanism to lock. Here are the key distinctions:&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;nRF9160 has only one core, while nRF5340 has two cores &amp;ndash; an application core and a network core, both of which need to be locked .&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;If I lock only the application core of nRF5340, the device can still unlock the J-Link port when attempting to recover the network core.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;I have found a new method using nrfjprog to enable app-protect and enable erase-protect. This approach is easier compared to using J-Link scripts as mentioned above.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;Example script for using&amp;nbsp;to enable APPPROTECT, SECUREAPPROTECT and ERASEPROTECT of nRF5340&lt;/p&gt;
&lt;pre class="aLF-aPX-K0-aPE"&gt;&lt;/pre&gt;
&lt;pre class="aLF-aPX-K0-aPE"&gt;&lt;pre class="ui-code" data-mode="text"&gt;# Enable APPPROTECT and ERASEPROTECT of network core
nrfjprog.exe -f NRF53 --coprocessor CP_NETWORK --memwr 0x01FF8004 --val 0x00000000 --verify
nrfjprog.exe -f NRF53 --coprocessor CP_NETWORK --memwr 0x01FF8000 --val 0x00000000 --verify

# Enable APPPROTECT, SECUREAPPROTECT and ERASEPROTECT of application core
nrfjprog.exe -f NRF53 --coprocessor CP_APPLICATION --memwr 0x00FF8020 --val 0x00000000 --verify
nrfjprog.exe -f NRF53 --coprocessor CP_APPLICATION --memwr 0x00FF801C --val 0x00000000 --verify
nrfjprog.exe -f NRF53 --coprocessor CP_APPLICATION --memwr 0x00FF8000 --val 0x00000000 --verify

nrfjprog.exe -p
#Noted: Noted: Before using this command, please ensure that your application has a method to #disable&amp;#160;ERASEPROTECT&amp;#160;both the network core and application core.
&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;Best Regards&lt;br /&gt;Wasan&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to enable APPPROTECT, SECUREAPPROTECT and ERASEPROTECT on nRF5340?</title><link>https://devzone.nordicsemi.com/thread/463826?ContentTypeID=1</link><pubDate>Thu, 11 Jan 2024 15:49:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec7fd534-ab5f-432e-b6cb-cf36b98f9d3e</guid><dc:creator>Sigurd Hellesvik</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Firstly, I advise you to be very careful when doing this. If you enable ERASEPROTECT and APPROTECT at the same time and do not have firmware running on the nRF to unlock the ERASEPROTECT or APPROTECT you will no longer be able to reprogram your chip.&lt;/p&gt;
&lt;p&gt;Can I suggest that you implement a timeout that will automatically unlock the nRF after X seconds when you are developing?&lt;/p&gt;
&lt;p&gt;Then I suggest you try to use the features standalone one by one first.&lt;/p&gt;
&lt;p&gt;For approtect, see &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/security/ap_protect.html"&gt;Enabling access port protection mechanism&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;For eraseprotect, see &lt;a href="https://github.com/hellesvik-nordic/samples_for_nrf_connect_sdk/tree/main/ctrl-ap/eraseprotect"&gt;my unofficial sample&lt;/a&gt;, but mark its disclaimers.&lt;/p&gt;
&lt;p&gt;PS: For the nRF5340, I think you might have to enable approtect for the network core as well.&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Sigurd Hellesvik&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>