<?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 is the bootloader updated after write-protecting the flash?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71095/how-is-the-bootloader-updated-after-write-protecting-the-flash</link><description>Hello, 
 In nRF5_SDK_17/examples/dfu/secure_bootloader/main.c, the main program starts off with protecting a couple of flash areas: 
 
 
 But how can, after this, an OTA update of the (single-bank) bootloader be performed when its flash area is write</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 01 Feb 2021 09:35:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71095/how-is-the-bootloader-updated-after-write-protecting-the-flash" /><item><title>RE: How is the bootloader updated after write-protecting the flash?</title><link>https://devzone.nordicsemi.com/thread/292154?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 09:35:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d30f85f9-5650-43fa-ad7e-5b7bc68886da</guid><dc:creator>J&amp;#248;rgen Holmefjord</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Updates of the bootloader is handled by the MBR, see&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_secure_boot.html#secure_boot_act_updates"&gt;Activation of updates&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;quot;When activating an update of the bootloader itself, the bootloader cannot perform the activation since its code cannot be running while it is being rewritten. Instead, the bootloader leverages the MBR, which has the ability to perform power-failure-safe copy operations. The bootloader calls into the MBR (through SVC) which stores the operation details in the MBR params page. The MBR then does its own Root of Trust reset and follows the instructions it left for itself in the MBR params page. If a reset happens at any time during the copy procedure, the MBR will continue or restart the copy operation, because its details are stored in flash. After this is done, it erases the MBR params page and boots the new bootloader.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Even though you are using a single-bank bootloader, the softdevice + bootloader updates will be performed in a dual-bank process, see&amp;nbsp;&lt;a title="SoftDevice and bootloader" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_bootloader_dfu_banks.html?cp=7_1_3_5_1_2_1_0#lib_bootloader_dfu_single_bank_sd"&gt;SoftDevice and bootloader&lt;/a&gt;&amp;nbsp;for more details.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Jørgen&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>