<?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>NRF5340 gets secured after writing UICR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77796/nrf5340-gets-secured-after-writing-uicr</link><description>Hi, 
 I unsecured my device and running it with JLink RTT to observe logging. If I program uicr registers during this process, the devices gets secured and I have to redo programming all over again. I am using the following sample command - 
 
 
 
 Can</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Aug 2021 08:49:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77796/nrf5340-gets-secured-after-writing-uicr" /><item><title>RE: NRF5340 gets secured after writing UICR</title><link>https://devzone.nordicsemi.com/thread/324161?ContentTypeID=1</link><pubDate>Tue, 10 Aug 2021 08:49:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2be731fa-d767-409c-bcbe-0f390c2bcfde</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hey Rookie! Sorry for the late reply, I have been away for a while.&lt;/p&gt;
[quote user="agustamir"]I&amp;#39;m a bit perplexed by this behavior. [/quote]
&lt;p&gt;So am I. Your memwr command shouldn&amp;#39;t enable approtect on its own, so I assume there is something with the image you&amp;#39;ve written to the chip that is making it happen. What is on this image of yours? Did you write/do anything to UICR?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Ands could you send it to me&amp;nbsp;so that I can try it on my end?&lt;/p&gt;
[quote user="agustamir"]&lt;p&gt;&lt;strong&gt;Use this if you want to enable authenticated debug.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Can you point to some resources that talk about authenticated debugging?&lt;/p&gt;[/quote]
&lt;p&gt;Ah, this is referring to some undocumented and unfinished functionality you don&amp;#39;t have to worry about. Just never mind that option.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 gets secured after writing UICR</title><link>https://devzone.nordicsemi.com/thread/322967?ContentTypeID=1</link><pubDate>Mon, 02 Aug 2021 19:31:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a61b2cea-47a2-4626-af24-ed336ab5c255</guid><dc:creator>rookie</dc:creator><description>&lt;p&gt;I am unable to do the read when the device is locked. I&amp;#39;m a bit perplexed by this behavior. What this points to is that the value of APPROTECT in the UICR changes from&amp;nbsp;0x50FA50FA, to something else which locks me out. One thing to note that my debugger connected and gdb was running when I&amp;#39;d tried to do this. This wasn&amp;#39;t a problem before, but may be it is on the latest revisions?&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also curious what this&amp;nbsp;comment in the `&lt;span&gt;nrf53_handle_approtect` function means:&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Use this if you want to enable authenticated debug.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Can you point to some resources that talk about authenticated debugging?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 gets secured after writing UICR</title><link>https://devzone.nordicsemi.com/thread/322202?ContentTypeID=1</link><pubDate>Wed, 28 Jul 2021 11:19:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:deeada9f-4c6c-4a60-8e52-8384bd131677</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hmm that is a bit strange.&lt;/p&gt;
&lt;p&gt;Could you try it once without&amp;nbsp;&lt;span&gt;JLink RTT? &lt;/span&gt;&lt;span&gt;And&amp;nbsp;could you try to read the value you wrote after memwr and see if it complains about SPU?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nrfjprog --coprocessor CP_NETWORK --memrd 0x01FF8308&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Elfving&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 gets secured after writing UICR</title><link>https://devzone.nordicsemi.com/thread/322069?ContentTypeID=1</link><pubDate>Tue, 27 Jul 2021 13:52:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1956ebf0-5665-4f51-a9db-8e26bb4ad816</guid><dc:creator>rookie</dc:creator><description>&lt;p&gt;Hello, yes I have already recovered the device and wrote my own image to it. I can see that the app-protect branch is handled in way to disable app-protect. `nrf53_handle_approtect` is called and `NRF_CTRLAP_NS-&amp;gt;APPROTECT.DISABLE = NRF_UICR_NS-&amp;gt;APPROTECT;` is compiled in.&lt;/p&gt;
&lt;p&gt;Until this point my device was debggable. Then I used the memwr function in nrfjprog and the device got secured, since the next time I tried to JLink into the device, it complained that the device is secured.&lt;/p&gt;
&lt;p&gt;My question is why/how would JLink find out that the APPROTECT is enabled AFTER&amp;nbsp;this nrfjprog call is made? Something happens after this `memwr` call that is setting APPROTECT, isn&amp;#39;t it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF5340 gets secured after writing UICR</title><link>https://devzone.nordicsemi.com/thread/321863?ContentTypeID=1</link><pubDate>Mon, 26 Jul 2021 14:04:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:120635bb-8d1a-4e15-8615-6de8398e39f0</guid><dc:creator>Elfving</dc:creator><description>&lt;p&gt;Hi Rookie!&lt;/p&gt;
&lt;p&gt;That is the nRF5340s APPROTECT feature. It is essentially writing protected by default.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Try recovering it first, (which should additionally write a small binary stopping it from locking up) using:&lt;/p&gt;
&lt;pre&gt;&lt;span&gt;nrfjprog&lt;/span&gt; &lt;span&gt;--&lt;/span&gt;&lt;span&gt;recover&lt;/span&gt; &lt;span&gt;--&lt;/span&gt;&lt;span&gt;coprocessor&lt;/span&gt; &lt;span&gt;CP_NETWORK&lt;/span&gt;&lt;/pre&gt;
&lt;div&gt;
&lt;div&gt;
&lt;pre&gt;&lt;span&gt;nrfjprog&lt;/span&gt; &lt;span&gt;--&lt;/span&gt;&lt;span&gt;recover&lt;br /&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;For more info about working with the &amp;#39;53&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/1.6.0/nrf/ug_nrf5340.html"&gt; take a look here&lt;/a&gt;, and for more info about APPROTECT &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fps_nrf5340%2Fdebugandtrace.html&amp;amp;cp=3_0_0_7_1&amp;amp;anchor=access_port_protection"&gt;take a look here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Elfving&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>