<?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>Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24093/adding-dfu-in-custom-application</link><description>Hi all, 
 There are lots of posts on the devzone about adding DFU service to a custom application and they have been very helpful in getting to this point. 
 At this point, I have an application that works very well on its own. Within this application</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 08 Aug 2017 14:52:47 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24093/adding-dfu-in-custom-application" /><item><title>RE: Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/thread/94866?ContentTypeID=1</link><pubDate>Tue, 08 Aug 2017 14:52:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6418880b-281d-4f92-a3ad-10d2a3a45caf</guid><dc:creator>anasimtiaz</dc:creator><description>&lt;p&gt;Changing attribute table size seems to be helping so I think that&amp;#39;s the problem.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/thread/94865?ContentTypeID=1</link><pubDate>Tue, 08 Aug 2017 11:15:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:acaeaa03-8591-4e18-9e86-5e7876045fa9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;You are right about the fact that the Buttonless DFU service has its sole purpose is to reset into bootloader.
You can of course integrate it into your own service to trigger the command. But then you need to make your own app to do so. If you use the ready made DFU service , then you don&amp;#39;t need to modify the DFU library on the Android/iOS app.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think you need to advertise the DFU service in your advertising packet. The DFU master detect if a device support DFU buttonless or not after service discovery, not when scanning.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/thread/94864?ContentTypeID=1</link><pubDate>Mon, 07 Aug 2017 21:37:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cda95cd3-f168-443a-b242-aa744e863926</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Hung&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
&lt;p&gt;It&amp;#39;s my misunderstanding of the &amp;quot;DFU service&amp;quot;, because when used by the application it&amp;#39;s only a method to reset into the bootloader with the appropriate flags set to cause the bootloader to advertise etc as a the actual DFU service&lt;/p&gt;
&lt;p&gt;I generally incorporate the function of the Buttonless DFU command service into my own command system, rather than adding an additional service, because it takes more resources, and also takes up spare in the advertising packet which I need for broadcasting manufacturer data&lt;/p&gt;
&lt;p&gt;But I understand my response was confusing&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/thread/94863?ContentTypeID=1</link><pubDate>Mon, 07 Aug 2017 13:30:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b680e3d9-74bc-46f3-9ff7-a0ea88cfb761</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Anasimtiaz,&lt;/p&gt;
&lt;p&gt;You are right on the fact that you need to add the DFU service in to enable DFU buttonless.&lt;/p&gt;
&lt;p&gt;Error code 4 means NRF_ERROR_NO_MEM. Your issue is most likely caused by the limit of the size of the attribute table.&lt;/p&gt;
&lt;p&gt;The attributable size is configured in side the ble_enable_params_t, by default it&amp;#39;s the value configured by softdevice_enable_get_default_config() call inside ble_stack_init(). What you can do is to change the ble_enable_params.gatts_enable_params.attr_tab_size = &amp;gt; BLE_GATTS_ATTR_TAB_SIZE_DEFAULT  to enable more attributes in the table.&lt;/p&gt;
&lt;p&gt;@Roger: You still need the DFU service declared so that the DFU master can write to it to send the command to the application to switch to the bootloader.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/thread/94861?ContentTypeID=1</link><pubDate>Sat, 05 Aug 2017 08:41:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e2db2d45-70fe-445d-939c-992aa37eea84</guid><dc:creator>anasimtiaz</dc:creator><description>&lt;p&gt;That&amp;#39;s right but still need to include nrf_dfu to init the service in the application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/thread/94862?ContentTypeID=1</link><pubDate>Sat, 05 Aug 2017 07:08:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b3c8fa24-ac6c-483b-affe-f8f826f90d34</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;@anasimtiaz&lt;/p&gt;
&lt;p&gt;Take a look at the buttonless DFU.&lt;/p&gt;
&lt;p&gt;Basically, AFIK, that service sets up some data on non-volatile storage and then reboots.&lt;/p&gt;
&lt;p&gt;So that if you have the DFU bootloader installed, it checks the non-volatile storage to find out if it needs to do a normal boot or whether to enter DFU (i.e advertise as a DFU service etc)&lt;/p&gt;
&lt;p&gt;Nordic seem to have changed the implementation of how they signal from the main application to the bootloader i.e via some sort of non-volatile storage, and in SDK 11 and SDK 13, I think this is is via a non volatile register in the MCU, but in SDK 12 they use some of the flash for this purpose.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/thread/94860?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 22:04:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f65c5b97-244c-4f50-8c10-63e77fb7553c</guid><dc:creator>anasimtiaz</dc:creator><description>&lt;p&gt;Roger, I have turned on logging and I know that the code has crashed. I get a fatal error and then keeps rebooting and same thing happens.
For adding the dfu service, what I have understood is that I need to add the service to implement buttonless dfu so that when I write to its characteristic I can start the bootloader in DFU mode. Is that not right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Adding DFU in custom application</title><link>https://devzone.nordicsemi.com/thread/94859?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2017 21:56:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb7a3c7d-f86b-4e46-84bd-9f63c8710c4e</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;Do mean it does not advertise at all when you add the dfu service?&lt;/p&gt;
&lt;p&gt;If so, how do you know if the code has not crashed?&lt;/p&gt;
&lt;p&gt;Did you turn on logging or run the code in a debugger ?&lt;/p&gt;
&lt;p&gt;Btw. Why do you want to add the dfu service to your application.
I thought the normal process is for the bootloader to provide the dfu service, and your application just needs to reboot into the bootloader dfu mode when an upload of firmware is required&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>