<?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 set bootloader run first in my application?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/21803/how-to-set-bootloader-run-first-in-my-application</link><description>Iprogram the bootloader.hex to 0x78000 with jlink.Then in my application program,I set the NRF_UICR-&amp;gt;NRFFW[0] register as belew: 
 static void write_uicr_customer_register(uint32_t * data, uint32_t offset)
{
 uint32_t* cust_data = (uint32_t*)(NRF_UICR_BASE</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 May 2017 12:38:06 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/21803/how-to-set-bootloader-run-first-in-my-application" /><item><title>RE: How to set bootloader run first in my application?</title><link>https://devzone.nordicsemi.com/thread/85653?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 12:38:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5555c684-e32e-4b20-9369-4744174c6339</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I know it doesn&amp;#39;t come to your  bootloader, but you need to check if the value is still there when you restart.&lt;/p&gt;
&lt;p&gt;Note that the way it works is : MBR run first at reset handle address 0x00004. Then it check if there is anything at NRF_UICR-&amp;gt;NRFFW[0] , if it&amp;#39;s 0xFFFFFFF it will then forward to the softdevice, the softdevice then forward to normal application. If there is something in NRF_UICR-&amp;gt;NRFFW[0] then the MBR will forward interrupt and PC to that address.&lt;/p&gt;
&lt;p&gt;What if you simply test to flash your application, softdevice, and then use nrfjprog and write to nRF_UICR-&amp;gt;NRFFW[0] address 0x78000. If everything works as it should it should brick the code and your application shouldn&amp;#39;t run after a reset after that.&lt;/p&gt;
&lt;p&gt;What do you do in your bootloader ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set bootloader run first in my application?</title><link>https://devzone.nordicsemi.com/thread/85652?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 09:15:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2252089b-c848-423a-af0e-d97058b1162d</guid><dc:creator>sheep</dc:creator><description>&lt;p&gt;I use my own boot loader ,device is nrf52832 and S132,so when power on，it come to the app，I set the NRF_UICR-&amp;gt;NRFFW[0] and then read back to check in the app program。When I power off and on,I wish it run boot loader first,but it doesn&amp;#39;t come to my own boot loader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to set bootloader run first in my application?</title><link>https://devzone.nordicsemi.com/thread/85651?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 08:53:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f2af8055-8f0b-4fd4-ac66-4ef924f14b4f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Sheep,&lt;/p&gt;
&lt;p&gt;Do you use our bootloader or your own bootloader? If you use our bootloader, the UICR is already written when flashing the bootloader (using &lt;strong&gt;attribute&lt;/strong&gt; keyword)  check nrf_bootloader_info.c . Could you try to test with the DFU bootloader included in the SDK ?&lt;/p&gt;
&lt;p&gt;I assume you used and flashed S132, do you have the version you use ? Have you made sure to disable the softdevice before you do NRF_NVMC activity ? it&amp;#39;s blocked when the softdevice is active.&lt;/p&gt;
&lt;p&gt;When you reset and come back to the application could check and read UICR at offset 0x14, do you see anything ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>