<?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>BPROT Protecting Bootloader nRF52832</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25405/bprot-protecting-bootloader-nrf52832</link><description>nRF52832
SDK14.0 
 Hi, how can I protect the bootloader from being overwritten? Ideally, I would never be updating the bootloader so it will be a permanent part of the device. How can I make sure nothing can overwrite/erase the bootloader? I am looking</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Sep 2017 17:37:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25405/bprot-protecting-bootloader-nrf52832" /><item><title>RE: BPROT Protecting Bootloader nRF52832</title><link>https://devzone.nordicsemi.com/thread/100139?ContentTypeID=1</link><pubDate>Mon, 25 Sep 2017 17:37:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2d11834f-9e25-4d55-b16c-3741f6f3af8d</guid><dc:creator>superpak</dc:creator><description>&lt;p&gt;Thank you very much for the clear answer, Sigurd!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BPROT Protecting Bootloader nRF52832</title><link>https://devzone.nordicsemi.com/thread/100138?ContentTypeID=1</link><pubDate>Mon, 25 Sep 2017 16:22:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06fe74ba-96f9-4822-b6cb-6b33b2e1e21a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Yes, you can use the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.nrf52832.ps.v1.1/bprot.html?cp=2_1_0_11#concept_gdr_qlx_vr"&gt;BPROT peripheral&lt;/a&gt; to prevent application code from erasing or writing to protected blocks. Any attempt to erase or write to a protected flash page will trigger a hardfault. Typically, you would want to enable the protection right at the start of your code, before you do anything else.&lt;/p&gt;
&lt;p&gt;A BPROT-block represents 1 flashpage(4kB), so on the nRF52832 that have 512 kB flash, we have 512/4 = 128 BPROT-blocks. The non-debug secure-bootloader in SDK 14.0 is by-default located from 0x78000 to 0x7E000. This corresponds to BPROT block/region 120 to 126. (The debug-project uses page 115 to 124).&lt;/p&gt;
&lt;p&gt;You can enable BPROT on these regions like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;NRF_BPROT-&amp;gt;CONFIG3 = (BPROT_CONFIG3_REGION120_Enabled &amp;lt;&amp;lt; BPROT_CONFIG3_REGION120_Pos) |
                     (BPROT_CONFIG3_REGION121_Enabled &amp;lt;&amp;lt; BPROT_CONFIG3_REGION121_Pos) |
                     (BPROT_CONFIG3_REGION122_Enabled &amp;lt;&amp;lt; BPROT_CONFIG3_REGION122_Pos) |
                     (BPROT_CONFIG3_REGION123_Enabled &amp;lt;&amp;lt; BPROT_CONFIG3_REGION123_Pos) |
                     (BPROT_CONFIG3_REGION124_Enabled &amp;lt;&amp;lt; BPROT_CONFIG3_REGION124_Pos) |
                     (BPROT_CONFIG3_REGION125_Enabled &amp;lt;&amp;lt; BPROT_CONFIG3_REGION125_Pos) |
                     (BPROT_CONFIG3_REGION126_Enabled &amp;lt;&amp;lt; BPROT_CONFIG3_REGION126_Pos);
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>