<?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 to reflash the soft device without MBR</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47499/how-to-reflash-the-soft-device-without-mbr</link><description>Hello, 
 I&amp;#39;m flashing a bootloader (DFU) and then i&amp;#39;m flashing my application but each time i flash the application, Segger Embedded reflashes the softdevice and the MBR. As a result, it erases the address 0xFF8 and 0xFFC that contains the bootloader</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 May 2019 07:26:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47499/how-to-reflash-the-soft-device-without-mbr" /><item><title>RE: How to reflash the soft device without MBR</title><link>https://devzone.nordicsemi.com/thread/189202?ContentTypeID=1</link><pubDate>Mon, 27 May 2019 07:26:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26f0fbd0-f865-4885-b4fe-36f447ee003c</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you very much. indeed, i guess it is voluntarily put to 0xFF by Segger embedded when i flash my application so that the MBR can jump onto it.&lt;/p&gt;
&lt;p&gt;Thank you again for the explanation ;)&lt;/p&gt;
&lt;p&gt;best regards,&lt;/p&gt;
&lt;p&gt;Aur&amp;eacute;lien&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reflash the soft device without MBR</title><link>https://devzone.nordicsemi.com/thread/188302?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 13:35:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b996c52b-7bee-419e-9279-394ab09bbbfd</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Aurel"]I&amp;#39;m saying that because, then,&amp;nbsp; after flashing&amp;nbsp;my application by using SWD, i can see :&amp;nbsp;[/quote]
&lt;p&gt;I assume these numbers are the content at the addresses (for instance&amp;nbsp;MBR_BOOTLOADER_ADDR shows the content at (uint32_t*)0xFF8). Either this is not the case (you print something you did not intend to), or there is something else happening. This is in the MBR region, but these words are part of the bootloader .hex file. It can only be reset to all FF&amp;#39;s if you have performed a page erase on the MBR page? Or never flashed the MBR?&lt;/p&gt;
&lt;p&gt;I suspect you have done something odd, but not entirely sure what. could it be that you first programmed the bootloader, then programmed the SoftDevice (including MBR) using --sectorerase? If so, this would explain it.&lt;/p&gt;
&lt;p&gt;If the bootloader address is not present as in this case (all FF&amp;#39;s), the MBR will jump straight to the application instead of the bootloader. In this case, FDS will also think that the FDS pages are in the end of the flash, but those will be corrupt since it is actually the bootloader that has been flashed here (FDS requires pages to have a FDS header, alternatively empty so that it can initialize them).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reflash the soft device without MBR</title><link>https://devzone.nordicsemi.com/thread/188282?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 13:04:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ba25fbe-1c74-496d-aeaf-e44d946671cb</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you very much for the explanation. Indeed, i discovered what bootloader settings is and i understand the behavior i have now. But i have one more question regarding my appliction. When i upgrade it via DFU, all is working fine, it boots on the application after the upgrade but then it fails to start. I&amp;#39;m suspecting &amp;quot;fds_init&amp;quot; function to fail.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m saying that because, then,&amp;nbsp; after flashing&amp;nbsp;my application by using SWD, i can see :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: MBR_BOOTLOADER_ADDR : 0xFFFFFFFF

&amp;lt;info&amp;gt; app: MBR_PARAM_PAGE_ADDR : 0xFFFFFFFF

&amp;lt;info&amp;gt; app: MBR_UICR_BOOTLOADER_ADDR : 0xFFFFFFFF

&amp;lt;info&amp;gt; app: MBR_UICR_PARAM_PAGE_ADDR : 0xFFFFFFFF

&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;So, i think when i flash the application by using SWD it erases the MBR part. I would like to know if it is possible to keep the bootloader&amp;nbsp;start address somewhere else to be sure they are not erased. I&amp;nbsp;heard&amp;nbsp;about the UICR registers. Is it the right way, when do i need to&amp;nbsp;populate&amp;nbsp;these registers ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you very much,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Aur&amp;eacute;lien&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reflash the soft device without MBR</title><link>https://devzone.nordicsemi.com/thread/188092?ContentTypeID=1</link><pubDate>Tue, 21 May 2019 06:51:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9a968ac-0f61-4292-b9a8-395f93a80367</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="Aurel"]- then, i&lt;span&gt;&amp;nbsp;flash, by using swd,&lt;/span&gt;&amp;nbsp;the application without uploading the softdevice but unfortunatly the application cannot start, i guess there is something missing in it so that the DFU can jump on it. Or maybe there is something indicating to the DFU to stay in DFU ?[/quote]
&lt;p&gt;Yes. The bootloader performs a CRC check of the application at startup, and will enter DFU mode instead of starting the application if the CRC does not match. You can verify this by using the debug bootloader with RTT logging, which should state that the app is not valid. There are a few ways around this when debugging:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;The simplest is to modify the bootloader while testing so that it never performs a CRC check of the application. You can do this by modifying&amp;nbsp;crc_on_valid_app_required() in &amp;lt;SDK 15.3&amp;gt;\components\libraries\bootloader\nrf_bootloader.c so that it always returns false.&lt;/li&gt;
&lt;li&gt;Alternatively, you must generate a new bootloader settings page using nrfutil every time you flash a new application, and program that as well. You can program it using nrfjprog with the --sectorerase option so that all other pages are preserved.&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reflash the soft device without MBR</title><link>https://devzone.nordicsemi.com/thread/187929?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 12:58:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a61cad35-ad5e-4665-83aa-d7865953b088</guid><dc:creator>Aurele</dc:creator><description>&lt;p&gt;Hello Einar,&lt;/p&gt;
&lt;p&gt;Thank you very much for the reply.&lt;/p&gt;
&lt;p&gt;Indeed, i tried to not upload the softdevice like you propose but i&amp;#39;m still having issues.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m doing the following steps :&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- i erase all the memory&lt;/p&gt;
&lt;p&gt;- i flash, by using swd, the DFU with the softdevice + MBR (0xFF8 and 0xFFC are updated with the right address)&lt;/p&gt;
&lt;p&gt;- then, i&lt;span&gt;&amp;nbsp;flash, by using swd,&lt;/span&gt;&amp;nbsp;the application without uploading the softdevice but unfortunatly the application cannot start, i guess there is something missing in it so that the DFU can jump on it. Or maybe there is something indicating to the DFU to stay in DFU ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;My&amp;nbsp;SoftDevice version is 6.1.1 and i&amp;#39;m working with SDK 15.3.0&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Aur&amp;eacute;lien&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to reflash the soft device without MBR</title><link>https://devzone.nordicsemi.com/thread/187922?ContentTypeID=1</link><pubDate>Mon, 20 May 2019 12:45:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8c62b3d-ffe9-49d1-9598-9fdb86be6393</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can prevent the SoftDevice from being flashed automatically by changing/removing the additional load file as shown here:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-f2d1a453516b4709920b1c0c7cc7734f/additional_5F00_load_5F00_file.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;We do not provide SoftDevice .hex files without the MBR, but you could strip out the MBR for instance by combining hex2bin, then strip of the lower 0x1000 bytes and convert it back with bin2hex.&lt;/p&gt;
&lt;p&gt;I did not this would be a practical problem, as the MBR should check the UICR for the bootloader start address if the 0xFF8 and 0xFFC are empty (in order to be backwards compatible). Which SoftDevice/MBR version do you use?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>