<?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>Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10196/very-simple-spi-bootloader</link><description>Hi, 
 I&amp;#39;m implementing a simple bootloader which will not use BLE. 
 
 Application will transfer the data from mobile devices using BLE and this data will be stored to external SPI flash memory. I&amp;#39;ve already managed to make writing/reading data over</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Nov 2015 15:12:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10196/very-simple-spi-bootloader" /><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37829?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 15:12:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:795e88c1-2b69-40ef-b4ff-2bb1ddf35e81</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;No problem:) P.S. think new questions not directly related to my answer should be posted as a new questions to better fit the QA format of this page. This should make it easier for others to find a solution while searching for a particular subject. So please accept answer above, and make a separate thread if new questions arises.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37828?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 15:02:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb6867fa-32e5-49dd-919a-073954e3e4d4</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;Ok, will try.
Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37831?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 15:01:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e90ba60-0753-4024-9995-769f0cea0d2a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;SD_MBR_COMMAND_INIT_SD forwards interrupts from the MBR to the vector table located at 0x1000. With this the MBR stops forwarding the interrupts directly to the bootloader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37827?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 14:55:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f88d88c-1873-4acb-9a28-219eae20d4bf</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;Sorry, not sure if I understood right. I have to use SD_MBR_COMMAND_INIT_SD command for MBR when bootloader finishes it&amp;#39;s work so that vector table is forwarded from bootloader to application?&lt;/p&gt;
&lt;p&gt;Yes, application will transfer data to SPI flash, and bootloader will only transfer/flash the data to nRF.
Yes, app and SD should always be compatible, meaning that when we update the SD, we must update the app with it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37826?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 13:55:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:427c9201-e40a-4746-bbfa-2ba825d35f63</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;The CODE_REGION_1_START is stored in the SDs info structure at 0x3000, and thus updated when you have uploaded a new SD. In your case it&amp;#39;s the application that&amp;#39;s actually receiving the image, and the bootloader will only handle the swapping of images, right? So you need to ensure that your application is always compatible with the SD to allow new DFU attempts. There should not be any need to update the bootloader itself.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37825?ContentTypeID=1</link><pubDate>Mon, 23 Nov 2015 13:46:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b89eaa14-ffca-4da9-a683-7b3d89e9fe3d</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;Hey Vidar, still waiting for a comment. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37813?ContentTypeID=1</link><pubDate>Fri, 20 Nov 2015 09:49:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:785682a1-f5c9-435f-9a10-af1c4268053b</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;My small code example works ok now! UICR-&amp;gt;BOOTLOADERADDR was the problem. Thank you!&lt;/p&gt;
&lt;p&gt;I would like to make this bootloader totally independent of SoftDevice. Is that possible? Imagine this scenario. There is no SD. App does not use SD. MBR is flashed and valid. How would I jump from bootloader to application? And how would I set interrupt forwarding address (application vector table) to application and vice versa without SD?&lt;/p&gt;
&lt;p&gt;If I code a bootloader which will use sd_softdevice_vector_table_base_set(CODE_REGION_1_START), what would happen if you change the address of that function(example: SD becomes bigger than 96kb) in new SD version? My bootloader would become invalid(outdated), correct? And I would have to update a new bootloader also. But the idea is to make this bootloader as MBR, it should never ever need an update. Is that possible? If yes, how?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37822?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 13:18:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3373e61f-12fc-4737-911e-5e33790ecf3a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;UICR-&amp;gt;BOOTLOADERADDR must correspond to the start address of your bootloader so the MBR will start forwarding interrupts to the bootlaoder and &amp;quot;jump&amp;quot; to the bootloader on startup.&lt;/p&gt;
&lt;p&gt;You can use  sd_softdevice_vector_table_base_set() once you have invoked the softdevice. See the functions that needs to be called to enter the application above in my answer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37821?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 13:09:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d2461ef3-5e22-4b5d-8e8e-cc9a5b3d79d1</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;Exactly! Basically I need a simple &amp;quot;app&amp;quot; which can read SPI flash, write nRF flash, blink some LEDs, and print to uart(debug). I&amp;#39;ve already done something like that but when I change addressees of flash as they are in DFU examples, my bootloader example won&amp;#39;t start when flashed. Must I change some other stuff too? Also, vector handling is a problem here since I can&amp;#39;t use sd_softdevice_vector_table_base_set(), correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37819?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 12:53:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d77f7f98-6826-446d-8147-a48d236704a3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Ok I see, you want to only use the bootloader to load the images from SPI flash to the nRF51 that previously received over BLE in the application. Then it will be a entirely different implementation of the bootloader than the one we have in our SDK (simpler).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37820?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 12:22:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4f3de5de-28f5-4650-8ff4-d6b989ebe6a5</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;Why OTA bootloader?
I don&amp;#39;t need BLE or UART in my bootloader. The application(normal application everyone has) will transfer the update to SPI flash when device is operating normally. Meaning I have SD (BLE usage) only in my app.
When application transfers the file it raises the flags and restarts the nRF. Bootloader checks the flags and only uses SPI to transfer data from SPI flash to nRF flash. My bootloader must only have SPI driver for transfer, must be able to flash nRF, it should use timers for LED blinking and UART for debugging(printing on terminal). Bootloader does not use UART or BLE for file transfer, the application does the file transfer when in normal operation. Bootloader just flashes the data. At least that is the idea.&lt;/p&gt;
&lt;p&gt;For now, UART does not work, timer using scheduler does not work and SPI does not work. I&amp;#39;ll try to debug SPI tomorrow and see what went wrong.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37816?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 09:32:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:79dddb64-0613-4580-91c8-657554e465bc</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;I would&amp;#39;ve based this on the OTA bootlaoder if you&amp;#39;re planning to receive the image over BLE to SPI flash. SPI is not really the transport layer for the bootloader if I have understood you correctly.&lt;/p&gt;
&lt;p&gt;UART is used by the serial bootlaoder by default, so it&amp;#39;s reinitialized after you have enabled app trace. Not sure why SPI did not work though. You can try to &lt;a href="https://devzone.nordicsemi.com/question/18039/bootloader-debugging/"&gt;debug the bootloader&lt;/a&gt; to see what the reason may be.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37815?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 16:27:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:20822889-480c-492d-a219-fbfec408a597</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;SPI hangs the entire bootloader when trying to initialize it @ spi_master_init_hw_instance(NRF_SPI0, SPI0_TWI0_IRQn, p_spi_instance, p_spi_master_config-&amp;gt;SPI_DisableAllIRQ);&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37814?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 15:33:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72ac6b73-07f3-479b-84b1-1148514d2cdd</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;I&amp;#39;ve taken &amp;quot;serial single bank bootloader&amp;quot; as my project.
When I create and run timer in it, it does not run.
When I try to printf (UART put...) nothing happens.
I believe SPI won&amp;#39;t work either, didn&amp;#39;t had the time to test it today.&lt;/p&gt;
&lt;p&gt;Any ideas why?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37812?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 11:54:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d007fd0b-b27b-4e0e-9645-d59f9124f552</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;I&amp;#39;m working on a &amp;quot;serial single bank&amp;quot; example, although I don&amp;#39;t need banks at all for this case, I simply flash directly from SPI flash to chip flash.
Yes, larger application space could be required later.&lt;/p&gt;
&lt;p&gt;Will ping you if I get some kind of a problem, but for now everything is clear.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37811?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 11:31:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0ea60eb1-4f96-4f01-b7ee-a1d4e31c991e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, the MBR must be kept when doing DFU. Also, just wanted to mention that you can make the standard bootloader use single bank in case you were not aware of it. Just replace dfu_dual_bank.c with dfu_single_bank.c. Assume the reason for using SPI flash is to have enough storage for a larger application?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37809?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 10:36:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1e9ae4a8-5cc5-4d0d-9c91-13cf6b23a71d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;CODE_REGION_1_START is hardcoded in an info structure within the softdevice, see dfu_types.h on how the bootloader reads this address. I don&amp;#39;t think there is anything wrong with the approach I proposed, but could I could have forgotten some minor details. I would have to implement this to verify that it will work. Unfortunately,  I don&amp;#39;t have time to do this. I suggest to just start and get more familiar with the bootlaoder and try to implement the changes, and let me know if any problems arise.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37810?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 10:15:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0443cca6-be4a-46f8-8051-71ab9be890ca</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;One more question.
When updating SD directly as mentioned above, I should keep MBR intact, correct? Meaning I should skip first 4096 bytes(address 0x0 - 0x1000) when deleting and writing new SD.&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37824?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 10:05:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:628e10ee-7bd2-4a8d-9f7a-1f09b2379f04</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;Yes, that&amp;#39;s it!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;application transfers data to SPI external flash, raises flags, restarts&lt;/li&gt;
&lt;li&gt;bootloader reads flags and flashes the chip (new SD or new app), clears flags and enters new app&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This means I don&amp;#39;t have to use vector mapping, since if I use modified SDK bootloader, MBR will always call bootloader 1st. And after bootloading is done, when I call the stuff you wrote, I will have SD flashed so it will work.
And since this is very simple bootloader(KISS principle), it will never need updating of it&amp;#39;s own.&lt;/p&gt;
&lt;p&gt;I think I got it now, I&amp;#39;ll wait until you confirm this last few sentences.
Just one simple question. If size of SD changes it will change CODE_REGION_1_START address, correct? So I guess I should have this address as a variable which I can write/read and not have it hard-coded in the bootloader?&lt;/p&gt;
&lt;p&gt;Thank you very much!
This helped me to grasp everything into solution.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37823?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 09:46:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67da793f-d841-4371-9c37-e86b1d21fa64</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;updated my answer&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37818?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 14:29:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c2b115ef-4f4e-4017-8fdc-4fb81647a72e</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;Ok, that helped a bit with some facts.&lt;/p&gt;
&lt;p&gt;So basically I can modify &amp;quot;serial single bank bootloader&amp;quot; template and make it read stuff from external flash over SPI. But, how to make MBR read data directly from external flash? I guess there is no way?
I would have to copy data for SD to chip flash and then tell MBR to overwrite it?&lt;/p&gt;
&lt;p&gt;The problem is I will have my own file from which SD will be updated. Where can I read some info about how SD firmware file must look like in temporary bank(bank 1) so MBR will be able to update it on it&amp;#39;s own from bank 1 to bank 0?&lt;/p&gt;
&lt;p&gt;Is there a source code for &amp;quot;sd_softdevice_vector_table_base_set()&amp;quot; function?
Why not use that function each time we go from bootloader to application and vice versa so we don&amp;#39;t need to use a solution as it was mentioned on the link you provided above?&lt;/p&gt;
&lt;p&gt;Thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37817?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 11:37:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4911c518-357c-431a-a349-f19e8420e8cc</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Correct the MBR is loaded at address 0 and is included as a part of the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.130.sds.v1.0.0/mbr_bootloader/bootloader.html?cp=2_7_2_0_9_1"&gt;SD binary&lt;/a&gt;. On startup the MBR will forward execution to the address stored in &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.130.sds.v1.0.0/mbr_bootloader/mbr_sd_reset_behavior.html?cp=2_7_2_0_9_2"&gt;UICR-&amp;gt;BOOTLOADERADDR&lt;/a&gt; if set. In our examples we place the bootloader above the application, see &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk51.v10.0.0/bledfu_memory.html?cp=4_1_0_4_3_1_3"&gt;memory layout&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Replacing the SD itself will be handled in the MBR without involvement from the bootloader, and will not return execution to the bootloader before its finished (will also handle unexpected resets).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37830?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 09:14:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8ebb211-323f-4005-b983-285bd8d2ebc5</guid><dc:creator>mbozic</dc:creator><description>&lt;p&gt;Hm, I&amp;#39;ve already taken a look at &lt;a href="https://devzone.nordicsemi.com/question/33621/how-to-make-the-nrf51822-flash-jump-successful-without-softdevice/"&gt;link&lt;/a&gt; and still a little fuzzy about it.&lt;/p&gt;
&lt;p&gt;Regarding sd_softdevice_vector_table_base_set() and MBR, I don&amp;#39;t get it at all.
Where is MBR located, in SD or must I flash it separately? If MBR goes at the address of 0x0000 then I must flash the bootloader on some offset(0x0000 + MBR size)? Any document in which I can read about this?
How to write flash without SD? I&amp;#39;ve seen a function &amp;quot;sd_flash_write()&amp;quot; but where are functions for flash write without SD?
Or, how to do this &amp;quot;&lt;em&gt;an easier approach may just be to use the SD to forward interrupts to your bootloader/application&lt;/em&gt;&amp;quot; when SD is deleted and I&amp;#39;m writing over it. How to use SD for anything when you have deleted it to update it?&lt;/p&gt;
&lt;p&gt;There are so many questions I can&amp;#39;t find an answer to.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Very simple SPI bootloader</title><link>https://devzone.nordicsemi.com/thread/37808?ContentTypeID=1</link><pubDate>Mon, 16 Nov 2015 10:35:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bafd07a2-a1d3-4ae9-9815-8f1435b3f61b</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Maybe the example mentioned in this thread &lt;a href="https://devzone.nordicsemi.com/question/33621/how-to-make-the-nrf51822-flash-jump-successful-without-softdevice/"&gt;here&lt;/a&gt; can give you some pointers on how to handle interrupt forwarding without the softdevice. However, an easier approach may just be to use the SD to forward interrupts to your bootloader/application (&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.130.sds.v1.0.0/mbr_bootloader/mbr_sd_initialization.html?resultof=%22%73%64%5f%73%6f%66%74%64%65%76%69%63%65%5f%76%65%63%74%6f%72%5f%74%61%62%6c%65%5f%62%61%73%65%5f%73%65%74%22%20"&gt;sd_softdevice_vector_table_base_set&lt;/a&gt;()). Then use the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.130.sds.v1.0.0/mbr_bootloader/mbr_bootloader.html?cp=2_7_2_0_9"&gt;MBR&lt;/a&gt; to enable update of the SD itself.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;EDIT 17.11&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Think I have a better idea of what you want to do now after reading your question again, but please correct me if I&amp;#39;m wrong:&lt;/p&gt;
&lt;p&gt;First you want to receive the image over BLE and store it to external flash over SPI. Then once finished, use the bootloader to load the received FW image into application or SD space on the nRF51.&lt;/p&gt;
&lt;p&gt;So if my understanding is correct I think I would have used the SDK bootloader as a basis, and modify it so it runs independent of the Softdevice once a FW image is successfully loaded to the SPI flash. That is, don&amp;#39;t call ble_stack_init() or use any of the sd_ flash APIs (pstorage). When the bootloader is running independent of the softdevice you can access the the NVMC module directly (&lt;a href="https://devzone.nordicsemi.com/question/54763/sd_flash_write-implementation-without-softdevice/#54772"&gt;example&lt;/a&gt;). Thus, delete and update the softdevice from the bootloader without using the MBR (MBR can&amp;#39;t access &amp;quot;SPI&amp;quot; memory).&lt;/p&gt;
&lt;p&gt;Update sequence:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;FW image is uploaded over BLE, only difference is that it&amp;#39;s loaded to SPI flash (softdevice enabled at this point).&lt;/li&gt;
&lt;li&gt;Bootloader verifies integrity of received image. CRC and image size received from init packet and start packet respectively.&lt;/li&gt;
&lt;li&gt;Set a flag in bootloader settings to indicate new FW image is ready to be swapped. Similiar to what we already do when updating the softdevice/bootloader.&lt;/li&gt;
&lt;li&gt;Bootloader does a system reset (soft reset - NVIC_SystemReset)&lt;/li&gt;
&lt;li&gt;MBR forwards execution directly to the bootloader without invoking the softdevice&lt;/li&gt;
&lt;li&gt;Bootloader checks for update in progress flag on startup, similiar to   if (bootloader_dfu_sd_in_progress()) in existing example.&lt;/li&gt;
&lt;li&gt;Prepare flash region (delete) and start loading the image from &amp;quot;SPI&amp;quot; flash to Softdevice/App region.&lt;/li&gt;
&lt;li&gt;Update flags in bootloader settings when complete and reset.&lt;/li&gt;
&lt;li&gt;Go into DFU mode or start application if it&amp;#39;s present and valid.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Also, before you enter the application the following functions must have been called:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sd_mbr_command_t com = {SD_MBR_COMMAND_INIT_SD, }; // MBR starts forwarding interrupts to SD

uint32_t err_code = sd_mbr_command(&amp;amp;com);
APP_ERROR_CHECK(err_code);

interrupts_disable();

err_code = sd_softdevice_vector_table_base_set(CODE_REGION_1_START); // Set interrupt forwarding address (application vector table)
APP_ERROR_CHECK(err_code);

bootloader_util_app_start(CODE_REGION_1_START); // ASM routine to branch to app reset handler.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Note that I have not had a chance to test the approach I described above, so it is possible that I&amp;#39;ve missed something.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>