<?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>nrf52811, custom bootloader and softdevice</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/68939/nrf52811-custom-bootloader-and-softdevice</link><description>Hello, I am trying to implement my own custom bootloader in the nRF52811. I have the softdevice loaded, which then jumps to address 0x19000. This is where I put my bootloader. Once the bootloader is complete it jumps to my application located at 0x1b000</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 01 Dec 2020 17:52:36 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/68939/nrf52811-custom-bootloader-and-softdevice" /><item><title>RE: nrf52811, custom bootloader and softdevice</title><link>https://devzone.nordicsemi.com/thread/282750?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2020 17:52:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b87e838-9b1c-42eb-a70f-9ffd2de02a6c</guid><dc:creator>jeffery1234</dc:creator><description>&lt;p&gt;Hello Edvin,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;thank you for the detailed response&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;When you stated &amp;quot;However, in our bootloader, we set the softdevice interrupt address to the bootloader start address. When the application starts later, the softdevice is initialized again, and it uses the default softdevice interrupt vector.&amp;quot;.&amp;nbsp; This was the clue to my problems&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The solution to my problem was in this routine nrf_bootloader_mbr_addrs_populate().&amp;nbsp; This routine allows me to tell the softdevice to run my bootloader first (do not run code at 0x19000).&amp;nbsp; So I moved my bootloader to the end of flash, placed the app back at 0x19000.&amp;nbsp; So now the softdevice goes to bootloader first, and once it is complete it goes to the softdevice for reinitialization and then my app runs fine.&amp;nbsp; I knew there must be a way to have the softdevice do this but I just couldn&amp;#39;t find the answer until today&lt;/p&gt;
&lt;p&gt;thanks for the help&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Jeff&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nrf52811, custom bootloader and softdevice</title><link>https://devzone.nordicsemi.com/thread/282732?ContentTypeID=1</link><pubDate>Tue, 01 Dec 2020 15:53:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b156dd46-0fe7-4840-83a6-833967e2dfcc</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I am not sure whether it will work to have the bootloader directly after the softdevice, but of course you can give it a go. If it doesn&amp;#39;t work, I would suggest you try to have the bootloader in the top of the flash, like it is in our bootloader implementation.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Looking at our bootloader implementation (SDK\examples\dfu\secure_bootloader\&lt;/p&gt;
&lt;p&gt;I see that the bootloader sets the softdevice vector table using sd_softdevice_vector_table_base_set(). Perhaps you can try using that?&lt;/p&gt;
&lt;p&gt;Also, see how the application is started from the bootloader in the nrf_bootloader_app_start() and it clears the interrupts.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;By default the softdevice sets the interrupt table directly after itself, so this is why this isn&amp;#39;t an issue when you don&amp;#39;t have a bootloader, but the application directly after the softdevice. However, in our bootloader, we set the softdevice interrupt address to the bootloader start address. When the application starts later, the softdevice is initialized again, and it uses the default softdevice interrupt vector.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Try using sd_softdevice_vextor_table_base_set() in your application, since it is not directly after the softdevie.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>