<?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>Merging of Boot loader, DFU and BLE peripheral application.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/75741/merging-of-boot-loader-dfu-and-ble-peripheral-application</link><description>Hi, 
 I have created my BLE peripheral application with custom services. Now i want to add DFU feature to it. 
 I have independently checked DFU test images given in nRF5 DK which works fine. 
 I want my application to update (DFU) whenever there is new</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 28 May 2021 07:56:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/75741/merging-of-boot-loader-dfu-and-ble-peripheral-application" /><item><title>RE: Merging of Boot loader, DFU and BLE peripheral application.</title><link>https://devzone.nordicsemi.com/thread/312296?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 07:56:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23fc3e16-aa4c-4e11-a951-8b6884b33c62</guid><dc:creator>yu1998</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/sudhir-foujadar"&gt;Sudhir Foujadar&lt;/a&gt;&amp;nbsp;btw if you don&amp;#39;t really know what is setting pages read&lt;/p&gt;
&lt;p&gt;&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fug_nrfutil%2FUG%2Fnrfutil%2Fnrfutil_settings_generate_display.html"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Merging of Boot loader, DFU and BLE peripheral application.</title><link>https://devzone.nordicsemi.com/thread/312261?ContentTypeID=1</link><pubDate>Fri, 28 May 2021 06:12:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7c94ce1-65cf-4e8c-af27-c22d619071ab</guid><dc:creator>yu1998</dc:creator><description>&lt;p&gt;well first of all let me check your question&lt;/p&gt;
&lt;p&gt;your application works fine your dfu works fine you combine them both and it still works fine&lt;/p&gt;
&lt;p&gt;and after using dfu update the application you cant update again?&lt;/p&gt;
&lt;p&gt;that is because there are three diff section in your devices&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;--dfu bootloader&lt;span&gt;(which updates happen here)&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;--application(with setting pages)&lt;/p&gt;
&lt;p&gt;--softdevices&lt;/p&gt;
&lt;p&gt;so if you have three &amp;quot;functional&amp;quot; section which means all of those sections work fine&lt;/p&gt;
&lt;p&gt;when you restart the app it will just boot into the application section you cannot directly update your app in this section&lt;/p&gt;
&lt;p&gt;now you have three different way to change your section while you are in the application section&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;1. use buttonless dfu which can detect the signal to force the device to change the section to bootloader&lt;/p&gt;
&lt;p&gt;for buttonlesswith interactive command as example:(nrf52840)&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/72701/merging-interactive-command-and-buttonless-dfu-base-on-sdk-_17-0-2"&gt;devzone.nordicsemi.com/.../merging-interactive-command-and-buttonless-dfu-base-on-sdk-_17-0-2&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;2. delete the setting pages and restart(this method is one way and no going back) after restart it will force enter bootloader forever&lt;br /&gt;before you update your setting page&lt;br /&gt;example: nrf52840:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/72902/force-enter-the-dfu-with-command"&gt;devzone.nordicsemi.com/.../force-enter-the-dfu-with-command&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;3.use button or command in uart to tell device you want to change the section&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;well , if&amp;nbsp; asking how to enter with button i think the sdk have already taught that&lt;/p&gt;
&lt;p&gt;second with command in uart for me&amp;nbsp;&lt;/p&gt;
&lt;p&gt;as interactive command as an example:&lt;/p&gt;
&lt;p&gt;in cli_m.c file&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;NRF_CLI_CMD_REGISTER(dfu,
    NULL,
    &amp;quot;dfu start.&amp;quot;,
    dfu);
static void dfu(nrf_cli_t const *p_cli, size_t argc, char **argv) {
  NVIC_SystemReset();
  ble_dfu_buttonless_bootloader_start_finalize();
  //NVIC_SystemReset();
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;for your second question how to merge your application with softdevice and dfu and setting page&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;it is simple after you build your program you should create a hex file all of those above does have hex file in sdk just merge them&lt;/p&gt;
&lt;p&gt;in command&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;@ECHO ON
mergehex -m softdevice.hex bootloader.hex -o softdevice+dfu.hex
@ECHO ON
mergehex -m softdevice+dfu.hex setting.hex -o softdevice+dfu+setting.hex
@ECHO ON
mergehex -m softdevice+dfu+setting.hex application.hex -o full_application.hex&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>