<?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>Need help with custom DFU bootloader; Transferring back to main app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62777/need-help-with-custom-dfu-bootloader-transferring-back-to-main-app</link><description>Hi all, 
 I&amp;#39;m working on a custom Bootloader for my nrf52840-based board. The bootloader needs to support DFU from external SPI Flash. So far, my bootloader can read from the external SPI Flash and copies the firmware into the internal Flash. But then</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 19 Jun 2020 13:28:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62777/need-help-with-custom-dfu-bootloader-transferring-back-to-main-app" /><item><title>RE: Need help with custom DFU bootloader; Transferring back to main app</title><link>https://devzone.nordicsemi.com/thread/255982?ContentTypeID=1</link><pubDate>Fri, 19 Jun 2020 13:28:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6573c648-b666-4892-82a4-a5330c7329ae</guid><dc:creator>brooksp</dc:creator><description>&lt;p&gt;Wow, that did it! Thank you so much for the information and the link, Vidar!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Need help with custom DFU bootloader; Transferring back to main app</title><link>https://devzone.nordicsemi.com/thread/255924?ContentTypeID=1</link><pubDate>Fri, 19 Jun 2020 09:29:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2226941c-fd7e-404e-822a-fb00376725a9</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thanks for uploading the full project. I&amp;#39;m pretty sure you&amp;#39;re encountering the bug Bj&amp;oslash;rn is describing in this answer: &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/58618/dfu-upgraded-app-wont-boot/239171#239171"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/58618/dfu-upgraded-app-wont-boot/239171#239171&lt;/a&gt;. I did not spot any other obvious problems with your implementation.&lt;/p&gt;
&lt;p&gt;As mentioned in the other thread, the issue can be worked enabling code optimization. This is something you can do for source files individually, which means you can still keep optimization off for your other source files and make debugging of your project easier.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s nrf_bootloader_app_start_final.c that must be compiled with optimization:&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-11d577bc702d4a838463d2bd84113cca/pastedimage1592557396080v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;The reason this has not been caught during release testing is mainly that we only test the bootloader with optimization enabled, but it has been reported before, and we will have it fixed in our upcoming SDK release.&lt;/p&gt;
&lt;p&gt;You can also fix the bug by replacing the problematic assembly in jump_to_addr() with this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void jump_to_addr(uint32_t new_msp, uint32_t addr)
{
    __set_MSP(new_msp);
    ((void (*)(void))addr)();
}&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>