<?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>Writing to bootloader flash region from the application?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/77703/writing-to-bootloader-flash-region-from-the-application</link><description>The initialized struct &amp;quot;nrf_fstorage_t&amp;quot; for use in nrf_fstorage_init( ) temporarily includes the application and bootloader (just for this test) 
 
 start address is 0x2&amp;#39;600 
 end address is 0xF&amp;#39;DFFF. 
 
 
 Bootloader test page address (last page of Bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 22 Jul 2021 10:07:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/77703/writing-to-bootloader-flash-region-from-the-application" /><item><title>RE: Writing to bootloader flash region from the application?</title><link>https://devzone.nordicsemi.com/thread/321295?ContentTypeID=1</link><pubDate>Thu, 22 Jul 2021 10:07:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b885bfb4-9ccc-44fe-a143-f284dec35df8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes your hypothesis is correct. When flash protect is commented out, the write/erase should pass.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;It&amp;#39;s the reason why I asked to try testing the same when you don&amp;#39;t use the bootloader.&lt;br /&gt; Just to verify that the code you used to write to the desired address is correct and works without the bootloader. Then we know that the bootloader does something to the flash area (which it should not).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to bootloader flash region from the application?</title><link>https://devzone.nordicsemi.com/thread/321201?ContentTypeID=1</link><pubDate>Wed, 21 Jul 2021 20:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5d27d137-bfdf-4979-a71c-c2a71d49155b</guid><dc:creator>SwEngineer007</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;WRP - Write protection&lt;/p&gt;
&lt;p&gt;The bootloader applies the write protection using the following and experiences no issues (right now it&amp;#39;s commented out):&lt;/p&gt;
&lt;p&gt;nrf_bootloader_flash_protect( START_ADDR, BOOTLOADER_SIZE, false )&lt;/p&gt;
&lt;p&gt;Where&amp;nbsp;&lt;span&gt;START_ADDR = 0x2&amp;#39;6000 and&amp;nbsp;BOOTLOADER_SIZE = (0xF&amp;#39;DFFF -&amp;nbsp;START_ADDR&amp;nbsp;+ 1)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Then in the application layer, any attempt to write to the last page of the bootloader partition (which is not used, all 0xFF&amp;#39;s) at the test address (&amp;nbsp;&lt;span&gt;BOOTLOADER_SIZE - PAGE_SIZE ) nothing is erased or written.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;My hypothesis is based on other ARM MCU&amp;#39;s, but may or may not be correct, but it is essentially this:&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. When&amp;nbsp;nrf_bootloader_flash_protect is commented out, erase/write should pass and write to the test address &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. When&amp;nbsp;nrf_bootloader_flash_protect is active, it should exhibit a fault.&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So, the issue is writing to the flash from the app layer to the bootloader region and in test case #1,&amp;nbsp;&lt;span&gt;nrf_fstorage_write( ) and&amp;nbsp;nrf_fstorage_erase( )&lt;/span&gt; erases nothing and writes nothing to the test address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Writing to bootloader flash region from the application?</title><link>https://devzone.nordicsemi.com/thread/321121?ContentTypeID=1</link><pubDate>Wed, 21 Jul 2021 12:28:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab44e27e-179d-48d5-b7e5-0c08cfdc37d0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;br /&gt;Could you please explain what exactly you meant by &amp;quot;WRP&amp;quot; ? Did you mean the&amp;nbsp;ACL peripheral ? Could you give more information on how you&amp;nbsp;turn it off an on.&amp;nbsp;&lt;br /&gt;Have you removed the protection in the bootloader ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you try to test the same code without the bootloader flashed do you have any problem ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>