<?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>Custom bootloader guidance</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/47065/custom-bootloader-guidance</link><description>Hi Nordic 
 I have some questions regarding a custom bootloader we are about to implement into our product. 
 Information: - We use NRF52832 - We have a custom board for our product - We use the S132 softdevice - We need a bootloader - We use ESB as our</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 May 2023 17:05:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/47065/custom-bootloader-guidance" /><item><title>RE: Custom bootloader guidance</title><link>https://devzone.nordicsemi.com/thread/423376?ContentTypeID=1</link><pubDate>Tue, 02 May 2023 17:05:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:842f2719-4613-4005-8dcb-7ae08cc36bca</guid><dc:creator>Thanuha</dc:creator><description>&lt;p&gt;I have a 1 query here, If I use DFU Bootloader of Nordic, how can I update the F/W from the same app which we are also developing for our application. we needs to maintain 1 separate app for the f/w update and also we don&amp;#39;t have any pins in device for going in bootloader mode again.is my understanding correct?&lt;/p&gt;
&lt;p&gt;we are designing the Product and for that mobile application is also there. weather this will be good approach or we needs to develop our own custom bootloader?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom bootloader guidance</title><link>https://devzone.nordicsemi.com/thread/186183?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 12:32:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:985c81a5-3740-4540-9e38-84521e27d9a2</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="MStampe"]- I would have two projects right? One for bootloader/DFU implementation and one for our application?[/quote]
&lt;p&gt;Yes, that is correct.&lt;/p&gt;
[quote user="MStampe"]- As for production, we need both of these modules in one hex file to program the device before entering the field.[/quote]
&lt;p&gt;Yes, and you also need the MBR or SoftDevice hex (which depend on if you need BLE transport or not), and you need a valid DFU &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_bootloader.html?cp=5_0_3_5_0_0#lib_bootloader_settings_page"&gt;settings page&lt;/a&gt;. Everything can be merged into a single hex file used for production programming.&lt;/p&gt;
[quote user="MStampe"]- Afterwards we need to generate application only hex files, which can be transfered to the DFU through ESB.[/quote]
&lt;p&gt;Yes.&lt;/p&gt;
[quote user="MStampe"]What I am not able to understand is the relations of how the different project outputs&amp;nbsp;will be correct, regarding addresses, starting addresses etc?[/quote]
&lt;p&gt;Please refer to the bootloader documentation, particularly the &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/lib_bootloader.html?cp=5_0_3_5_0_7#lib_bootloader_memory"&gt;Memory layout&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom bootloader guidance</title><link>https://devzone.nordicsemi.com/thread/186112?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 08:53:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c116890-195a-4da8-b3dd-9376236ddc65</guid><dc:creator>MStampe</dc:creator><description>&lt;p&gt;Hi Einar&lt;/p&gt;
&lt;p&gt;Thank you for the detailed answer, and the clearification of the DFU and bootloader relation.&lt;br /&gt;I think I will stick to your suggestion and use the examples as a starting point, and then implement the ESB transport layer myself.&lt;/p&gt;
&lt;p&gt;The first practical questions that comes to mind, and the last I think I need to understand before I can complete the implementation is:&lt;/p&gt;
&lt;p&gt;- I would have two projects right? One for bootloader/DFU implementation and one for our application?&lt;/p&gt;
&lt;p&gt;- As for production, we need both of these modules in one hex file to program the device before entering the field.&lt;/p&gt;
&lt;p&gt;- Afterwards we need to generate application only hex files, which can be transfered to the DFU through ESB.&lt;/p&gt;
&lt;p&gt;What I am not able to understand is the relations of how the different project outputs&amp;nbsp;will be correct, regarding addresses, starting addresses etc?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom bootloader guidance</title><link>https://devzone.nordicsemi.com/thread/186107?ContentTypeID=1</link><pubDate>Thu, 09 May 2019 08:39:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f74b1c16-a3e6-44c6-ad9a-416d32276ea9</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I want to start by commenting on a misunderstanding: Bootloader and DFU are very much related. The only purpose of the bootloader in the nrF5 SDK is to facilitate DFU. In other words: if you want to support DFU, you need the bootloader. If you don&amp;#39;t need DFU, there is no point in having a bootloader.&lt;/p&gt;
&lt;p&gt;It seems to me like what you want is the SDK bootloader, but with an ESB transport. We do not provide an ESB transport layer, but the bootloader is modular, so you can implement it yourself. If you want to save time and have available flash size, then perhaps you can stick with BLE for the bootloader even though you do not use it for the application. In that case you can use the example bootloader out of the box without any modifications. I believe much of these questions will be answered in a good way by reading bootloader documentation and experimenting with the DFU examples. DFU is quite complex so I strongly suggest you go with this approach, and use as much of the SDK examples as you can. If not, you risk spending a lot of time making something that does not work very well.&lt;/p&gt;
[quote user=""]- How to I setup a bootloader project in Segger, which are able to startup directly into the bootloader?[/quote]
&lt;p&gt;I recommend you just start off with a example bootloader project. This will have everything in place. The boot up sequence will be the following (ignoring the special handling when here is a SoftDevice or Bootloader upgrade in progress):&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;MBR always runs first. MBR checks if there is a bootloader present (by checking the a reserved UICR register for a bootloader start address and/or a special word in the MBR).&lt;/li&gt;
&lt;li&gt;If a bootloader &lt;strong&gt;is not&lt;/strong&gt; detected, the MBR starts the SoftDevice if present, or the application (whatever is located at address 0x1000).&lt;/li&gt;
&lt;li&gt;If a bootloader &lt;strong&gt;is&lt;/strong&gt;&amp;nbsp;detected, the MBR will forward execution to the bootloader.&lt;/li&gt;
&lt;li&gt;The bootloader will check if it is supposed to enter DFU mode (via a number of configurable methods, such as GPIO pin asserted, retention register set, ...)&lt;/li&gt;
&lt;li&gt;If DFU mode is not requested, the bootloader will check if a valid application is present and start it.&lt;/li&gt;
&lt;li&gt;If DFU mode is requested or a valid application is not present, the bootloader will enter DFU mode.&lt;/li&gt;
&lt;/ul&gt;
[quote user=""]- How to setup a segger project with the correct flash placement for use with a bootloader?[/quote]
&lt;p&gt;I assume you are asking about application in this case? As you can see from the memory layout, the bootloader is placed right in the end of the flash. Additionally, the linker will try to place tings in the beginning of the flash you have configured, therefor most applications does not need any modification at all. If you want, you can adjust the size of the application in the linker settings to make it clearer, but it should not have any practical consequences (other than that it will generate a linker error in case the application grows too large, so that it overlaps with the bootloader).&lt;/p&gt;
[quote user=""]- How to jump from bootloader to the application?[/quote]
&lt;p&gt;&amp;nbsp;Please refer to the bootloader implementation. You can see how it is done in&amp;nbsp;nrf_bootloader_app_start() in SDK 15.3. (components\libraries\bootloader\nrf_bootloader_app_start.c), including the implementation of&amp;nbsp;nrf_bootloader_app_start_final().&lt;/p&gt;
[quote user=""]- Will the UICR values be kept between bootloader and application, when not using the DFU?[/quote]
&lt;p&gt;The UICR is a persistent (flash) register that typically never changes. Moreover, it cannot be deleted without erasing the full UICR page, which is typically something you never do in the field with an end product.&amp;nbsp;&lt;/p&gt;
[quote user=""]- How would we write to the application flash from our bootloader? Using the fstorage or other lib?[/quote]
&lt;p&gt;Please refer to the example bootloader (which use fstorage). I would like to repeat the strong recommendation to use the example bootloader instead of implementing this yourself.&lt;/p&gt;
&lt;p&gt;Br,&lt;/p&gt;
&lt;p&gt;Einar&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>