<?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>Bootloader overlapping MBR params page, should we worry?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/38736/bootloader-overlapping-mbr-params-page-should-we-worry</link><description>We’re working with the NRF52, SDK 14.2 and SES. 
 Somehow we have managed to have our boot loader extend into our MBR params page. We extended the stock SDK 14.2 boot loader with support for an OLED so we could indicate DFU mode but the memory offsets</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 26 Sep 2018 10:23:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/38736/bootloader-overlapping-mbr-params-page-should-we-worry" /><item><title>RE: Bootloader overlapping MBR params page, should we worry?</title><link>https://devzone.nordicsemi.com/thread/150440?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 10:23:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09c99793-5b24-49b7-a961-7c8db64b6e63</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;I do not think that there is much fat to cut there in bootloader templates that we provide.&lt;/p&gt;
&lt;p&gt;Yes, you are correct, uECC is needed for secure bootloader to decrypt the signatures.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader overlapping MBR params page, should we worry?</title><link>https://devzone.nordicsemi.com/thread/150439?ContentTypeID=1</link><pubDate>Wed, 26 Sep 2018 10:21:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d63451b9-3dc5-4b3c-8a56-15dab1191e8d</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Duncan,&lt;/p&gt;
&lt;p&gt;I checked the code and to answer your question, it does not erase MBA param page when you are uploading a smaller bootloader (replacing your oversized one). So this should work fine.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader overlapping MBR params page, should we worry?</title><link>https://devzone.nordicsemi.com/thread/150340?ContentTypeID=1</link><pubDate>Tue, 25 Sep 2018 20:32:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c38a5d06-3d98-4d21-8131-cd419a75b04f</guid><dc:creator>dmf3030</dc:creator><description>&lt;p&gt;Another related question would be whether the stock 14.2 SDK bootloader has any code that can be cut to reduce the compile size so that I could still squeeze in the extra 2k of code I need to run an oled with my bootloader.&amp;nbsp; In stepping through the memory usage I don&amp;#39;t see much fat to cut, we&amp;#39;re not using any of the bsp code but mainly I&amp;#39;m seeing the uECC library taking up space and I expect theres not really anything to omit there.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader overlapping MBR params page, should we worry?</title><link>https://devzone.nordicsemi.com/thread/150253?ContentTypeID=1</link><pubDate>Tue, 25 Sep 2018 12:28:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4934f366-935c-4000-af0a-21ef4b79de4d</guid><dc:creator>dmf3030</dc:creator><description>&lt;p&gt;Aryan, thanks for the help &amp;amp; info!&lt;/p&gt;
&lt;p&gt;Seems like our safest course of action is to flash the&amp;nbsp;revised bootloader that correctly fits in the alotted memory.&amp;nbsp; We have done this updated repeatedly over our old &amp;quot;too large&amp;quot; bootloader without any issue.&amp;nbsp; We have then moved along to update the application and found no problems.&amp;nbsp; I did find it odd that flashing the bootloader did not erase our application like I expected.&amp;nbsp; I did not think we had enough free space for a dual bank bootloader update since we have a large chunk reserved for FDS storage. Maybe if those pages are not used yet then they can be used for the update, that or we have a bit more memory than I expected and dual bank is possible. I&amp;#39;m also a bit paranoid here&amp;nbsp;butI feel like the best route is to flash the new bootloader while we have the units in hand and can ensure that everything goes well.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The other option is to let the units get into the wild with the &amp;quot;too large&amp;quot; bootloader which obviously does not have the problem with 0xAA at the magic spot in the MBR page since it works for now.&amp;nbsp; Seems like if the units are currently working theres no reason they should suddenly develop an issue where 0xAA ends up in the wrong spot, but this still makes me nervous and I don&amp;#39;t like the idea of the questionable bootloader update ever happening in the wild.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Q: So with the assumption that we will be updating the bootloader to be the correct size,&amp;nbsp; my only question is about what happens to the old bootloader code that overlapped into the MBR.&amp;nbsp; When we flash the smaller bootloader it presumably erases the bootloader memory bank but I would doubt it erases the MBR page, (though if it wrote there then maybe its happy to erase into it too).&amp;nbsp; So after our bootloader update there could still be old bits of code in the MBR, but if I understand correctly the worst thing that can happen is that code eventually causes a bad CRC in the MBR params page which just leads to it getting erased and a system reset. After that we would be all good with no signs of the mistake and a clean MBR page. I&amp;#39;m not sure how the MBR is used for a soft device or bootloader update, could that bad MBR checksum happen after we have sent over a new soft device and cause a bad update?&amp;nbsp; When does the NRF deliberately write that 0xAA value to the MBR params page, seems like the first time that happens we would have a problem unless prior to writing it the page is erased by the NRF.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bootloader overlapping MBR params page, should we worry?</title><link>https://devzone.nordicsemi.com/thread/150216?ContentTypeID=1</link><pubDate>Tue, 25 Sep 2018 10:42:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bc0237a3-c7c2-47e0-a64f-b1a7b0aca7da</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Duncan,&lt;/p&gt;
&lt;p&gt;1) Your assumptions are correct about when the MBR params page is being used. You app updates would work fine even with the overlap. But I think that BL/SD update will be risky (unpredictable) with an overlapping bootloader into MBR params page. I would caution you with one more thing.&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;When the system is booting up, the first thing that is run is the MBR reset handler.&lt;/li&gt;
&lt;li&gt;In the MBR reset handler, MBR param page is sniffed to see if there is a valid header&amp;nbsp; at &lt;strong&gt;((NRF_UICR-&amp;gt;NRFFW[1]) + 5)&lt;/strong&gt;. If this value is 0xAA by coincidence from the overflow of your bootloader then the MBR reset handler would think that this is a valid page and do a CRC check on the rest of the MBR params page. If the CRC check fails, then it would erase the params page and do a system reset. You would not like this as this will erase part of your bootloader. So make sure that the given offset never contains 0xAA.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;2)&amp;nbsp;If you try to upload the bootloader first then it would try to reinitialize the MBR param page (which is OK as you do not care about the old bootloader being overwritten)&amp;nbsp; I am still a bit paranoid here, but seems like it should work. Never tried it though&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>