<?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>Approtect with zephyr</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83140/approtect-with-zephyr</link><description>I&amp;#39;m not sure if zephyr questions can be also asked here. Problem I am struggling with is approtect mechanism to prevent flash readout. I am trying to use Zephyr config files to eneble such options (doing this by register can be ovewritten by zephyr),</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 06 Aug 2024 13:35:58 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83140/approtect-with-zephyr" /><item><title>RE: Approtect with zephyr</title><link>https://devzone.nordicsemi.com/thread/497173?ContentTypeID=1</link><pubDate>Tue, 06 Aug 2024 13:35:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:467690b7-36b2-46f2-84f9-e745b4e4938e</guid><dc:creator>lanwer</dc:creator><description>&lt;p&gt;That is most probably because you are using an &amp;quot;old&amp;quot; hardware revision (for example nrf52840 of revision 2). If that is the case, the only way to protect the flash from reading is to write 0x00 to the UICR.APPROTECT register.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The Config you are trying to add has only impact on new hardware revisions (revision &amp;gt;= 3 for nrf52840). You can check that as follows:&lt;/p&gt;
&lt;p&gt;Setting&amp;nbsp;&lt;span&gt;CONFIG_NRF_APPROTECT_LOCK=y --&amp;gt; leads to activating ENABLE_APPROTECT in the&lt;strong&gt;&lt;em&gt; nrf52_handle_approtect&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;func.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;This calls the function nrf_configuration_249() which only returns true for devices&amp;nbsp;of newer hadrware revisions that have the updated approtect mechanism, otherwise false.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1722950679686v1.png" alt=" " /&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;--&amp;gt; So, when you have an old harware revision, the function nrf52_handle_approtect() will be called, but have absolutely no impact. For those devices, you will only need to write the UICR.APPROTECT register --&amp;gt; see the&amp;nbsp;nrf_debug_port_disable() function in this thread on how to do it:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/96577/5340-protect-programs-from-theft/410501"&gt;Link&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Notice: writing to UICR.APPROTECT (e.g. in the beginning of you main func) should be done on both old and new hardware revisions! Only the second part (handled above) is automatically handled based on the revision, for which you should activate the config.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;I hope this helps.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Approtect with zephyr</title><link>https://devzone.nordicsemi.com/thread/345286?ContentTypeID=1</link><pubDate>Tue, 28 Dec 2021 17:04:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9719dec1-b165-4bc4-8ea1-c55337f6a11e</guid><dc:creator>dejans</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Which versions of the nRF SDK and which board are you using?&lt;br /&gt;Please note that you could use command nrfjprog --rbp ALL for disabling readout protection.&lt;/p&gt;
&lt;p&gt;For more information related to nRF Connect, Zephyr and APPROTECT please check also these two links:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/74325/nrf-connect-approtect"&gt;devzone.nordicsemi.com/.../nrf-connect-approtect&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/78322/nrf52840---zephyr-os---flash-protection"&gt;devzone.nordicsemi.com/.../nrf52840---zephyr-os---flash-protection&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Dejan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>