<?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>Master boot record</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80962/master-boot-record</link><description>Hi, 
 I am developing using the SoftDevice s140 7.2.0. 
 I am trying to use the MBR function sd_mbr_command() to upgrade my bootloader with command SD_MBR_COMMAND_COPY_BL . 
 The bootloader occupies the address range 0xf8000-0xfdfff, so the length is</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Nov 2021 11:50:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80962/master-boot-record" /><item><title>RE: Master boot record</title><link>https://devzone.nordicsemi.com/thread/337067?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 11:50:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9376535-fad9-4975-b02b-13431cd1327b</guid><dc:creator>dzabel</dc:creator><description>&lt;p&gt;Ok, I seem to have found it. I had not (as I thought) set MBR_UICR_PARAM_PAGE_ADDR to 0xfe000, but instead to 0xFFE00, so condition 3 was the culprit. Thank you for your help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Master boot record</title><link>https://devzone.nordicsemi.com/thread/337043?ContentTypeID=1</link><pubDate>Tue, 02 Nov 2021 10:45:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4e0f2cd-0acf-440b-b6f4-8bbb4933ad2c</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This is strange. As far as I can tell, all parameters are valid.&lt;/p&gt;
&lt;p&gt;The copy command should only return invalid length if one of the following conditions are true:&lt;/p&gt;
&lt;p&gt;1) bl_src + bl_len &lt;span style="text-decoration:line-through;"&gt;does not&lt;/span&gt; exceeds total flash size. 0xdb000 + 0x6000 = 0xE1000&lt;/p&gt;
&lt;p&gt;2) bootloader start + bl_len &lt;span style="text-decoration:line-through;"&gt;does not&lt;/span&gt; exceeds total flash size. 0xf8000 + 0x6000 = 0xFE000&lt;/p&gt;
&lt;p&gt;3) MBR_UICR_PARAM_PAGE_ADDR + flash page size&lt;span style="text-decoration:line-through;"&gt; does not&lt;/span&gt; exceeds total flash page size. 0xFE000 + 0x1000 = 0xFF000&lt;/p&gt;
&lt;p&gt;Can you double-check the addresses in UICR again?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Master boot record</title><link>https://devzone.nordicsemi.com/thread/336926?ContentTypeID=1</link><pubDate>Mon, 01 Nov 2021 17:03:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5335f5e-5954-4336-8ea3-ab4ffafafbf6</guid><dc:creator>dzabel</dc:creator><description>&lt;p&gt;Hi, sorry to come up again with this topic, but I still have not solved my problem.&lt;/p&gt;
&lt;p&gt;I changed the code to put the new bootloader into flash, and I still get the error code 9.&lt;/p&gt;
&lt;p&gt;command.command = SD_MBR_COMMAND_COPY_BL;&lt;/p&gt;
&lt;p&gt;command.copy_bl.bl_src = 0xdb000&lt;/p&gt;
&lt;p&gt;command.copy_bl.bl_len = 6144&lt;/p&gt;
&lt;p&gt;errCode = sd_mbr_command(&amp;amp;command);&lt;/p&gt;
&lt;p&gt;gives still errCode == 9&lt;/p&gt;
&lt;p&gt;MBR_BOOTLOADER_ADDR (at 0xfff8) is not set, as well as MB_PARAM_PAGE_ADDR (at 0xffc).&lt;/p&gt;
&lt;p&gt;MBR_UICR_BOOTLOADER_ADDR (NRF_UICR-&amp;gt;NRFFW[0]) is still 0xf8000 (this is also where the currently executing bootloader is located), MBR_UICR_PARAM_PAGE_ADDR (UICR.NRFW[1]) is 0xfe000&lt;/p&gt;
&lt;p&gt;Do you have any idea what else I could check?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Master boot record</title><link>https://devzone.nordicsemi.com/thread/335482?ContentTypeID=1</link><pubDate>Fri, 22 Oct 2021 12:21:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c474c71a-5056-473d-9684-770611d846ee</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;No problem, I hope you will be able to work around this limitation without too much change.. Yes, the main, if not only reason for not allowing it to be copied from RAM is probably that it wouldn&amp;#39;t be able to recover from a sudden power failure. &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Master boot record</title><link>https://devzone.nordicsemi.com/thread/335474?ContentTypeID=1</link><pubDate>Fri, 22 Oct 2021 11:52:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c8ef54d-ea26-438a-8bf5-9daa9b66ed7b</guid><dc:creator>dzabel</dc:creator><description>&lt;p&gt;Thank you for a really fast answer. That explains it. I had not realized that the source must be located in flash. But I guess, that is required to recover after a power failure while writing the new bootloader is not yet complete.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Master boot record</title><link>https://devzone.nordicsemi.com/thread/335472?ContentTypeID=1</link><pubDate>Fri, 22 Oct 2021 11:39:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4313f0ea-3a0c-4c90-a488-4e0e07b00420</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Unfortunately&lt;em&gt;, SD_MBR_COMMAND_COPY_BL&lt;/em&gt; requires both the source and destination area to be in flash.&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;/**@brief This command copies a new BootLoader.&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* The MBR assumes that either @ref MBR_BOOTLOADER_ADDR or @ref MBR_UICR_BOOTLOADER_ADDR is set to&lt;br /&gt;&amp;nbsp;* the address where the bootloader will be copied. If both addresses are set, the MBR will prioritize&lt;br /&gt;&amp;nbsp;* @ref MBR_BOOTLOADER_ADDR.&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* The bootloader destination is erased by this function.&lt;br /&gt;&amp;nbsp;* If (destination+bl_len) is in the middle of a flash page, that whole flash page will be erased.&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* This command requires that @ref MBR_PARAM_PAGE_ADDR or @ref MBR_UICR_PARAM_PAGE_ADDR is set,&lt;br /&gt;&amp;nbsp;* see @ref sd_mbr_command.&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* This command will use the flash protect peripheral (BPROT or ACL) to protect the flash that is&lt;br /&gt;&amp;nbsp;* not intended to be written.&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* On success, this function will not return. It will start the new bootloader from reset-vector as normal.&lt;br /&gt;&amp;nbsp;*&lt;br /&gt;&amp;nbsp;* @retval ::NRF_ERROR_INTERNAL indicates an internal error that should not happen.&lt;br /&gt;&amp;nbsp;* @retval ::NRF_ERROR_FORBIDDEN if the bootloader address is not set.&lt;br /&gt;&amp;nbsp;&lt;strong&gt;* @retval ::NRF_ERROR_INVALID_LENGTH if parameters attempts to read or write outside flash area.&lt;/strong&gt;&lt;br /&gt;&amp;nbsp;* @retval ::NRF_ERROR_NO_MEM No MBR parameter page is provided. See @ref sd_mbr_command.&lt;br /&gt;&amp;nbsp;*/&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Vidar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>