<?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_app_start() doesn&amp;#39;t run newly flashed app</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15178/bootloader_app_start-doesn-t-run-newly-flashed-app</link><description>Hi, 
 i&amp;#39;m doing my own bootloader and i want to use external flash to download image trough a spi. Now it almost works. But after an app image has been successfully transferred to nrf52 flash and the bootloader reaches bootloader_app_start(DFU_BANK_0_REGION_START</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 18 Jul 2016 12:00:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15178/bootloader_app_start-doesn-t-run-newly-flashed-app" /><item><title>RE: bootloader_app_start() doesn't run newly flashed app</title><link>https://devzone.nordicsemi.com/thread/57950?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 12:00:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb010daa-c788-4184-a105-99ca7a4690f7</guid><dc:creator>Konstantin</dc:creator><description>&lt;p&gt;The problem is solved. The source of bug was spi init\deinit procedure. The NRF_SPIM1 module is used by either bootloade and app, so spi deinit is necessary for bootloader, but calling nrf_drv_spi_uninit() it seems was not enough. Subsequent call of spi_init() in app hangs CPU. Adding manual spi event reset solves the problem.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;	FlashSpiReadStop();
	nrf_drv_spi_uninit(&amp;amp;AuxSpi);
	NRF_SPIM1-&amp;gt;EVENTS_END = 0;
	NRF_SPIM1-&amp;gt;EVENTS_ENDRX = 0;
	NRF_SPIM1-&amp;gt;EVENTS_ENDTX = 0;
	NRF_SPIM1-&amp;gt;EVENTS_STARTED = 0;
	NRF_SPIM1-&amp;gt;EVENTS_STOPPED = 0;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;May be the same behavior should be added in nrf_drv_spi.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bootloader_app_start() doesn't run newly flashed app</title><link>https://devzone.nordicsemi.com/thread/57949?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 11:13:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2934c7de-ba81-4641-adc4-cbafc2f4a60d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Konstantin: I just want to make sure you haven&amp;#39;t modified the bootloader_app_start() function.
You can test to debug your application and see what happens when you step through the application code when it inits.&lt;/p&gt;
&lt;p&gt;Do you use any extra timer/peripheral in the bootloader that can trigger an interrupt in the period when the bootloader is closing and branching to the application that would not be handled ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bootloader_app_start() doesn't run newly flashed app</title><link>https://devzone.nordicsemi.com/thread/57948?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 09:45:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9eb7ce90-ab3b-413a-a5f4-48674a48ed61</guid><dc:creator>Konstantin</dc:creator><description>&lt;p&gt;Hi, Hung Bui
I use bootloader_app_start() directly (see the end of code in my post). This function will not return as it does the things you mentioned and jump to an app entry point. I have seen SPI bootloader example, but my project have different structure since it is SPI master. The problem still exists, so i&amp;#39;m trying to debug my application code from the bootloader project.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: bootloader_app_start() doesn't run newly flashed app</title><link>https://devzone.nordicsemi.com/thread/57947?ContentTypeID=1</link><pubDate>Mon, 18 Jul 2016 08:58:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:672e6698-53c1-4240-b9eb-5d3482a007f2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Konstantin: Have you made sure you have disabled the softdevice, and forwarded the interrupt vector table to the application as we do in the bootloader_app_start() function. Make sure the return error code is checked.&lt;/p&gt;
&lt;p&gt;You can have a look at our example of SPI bootloader &lt;a href="https://github.com/NordicSemiconductor/nrf51-dfu-spi-slave"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>