<?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>DFU from application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8989/dfu-from-application</link><description>Hello Expert, 
 I am using SDK 6.1 and Softdevice 7.1.0 (s110) for our 256K/32K nrf51822 platform. As of now I wanna port DFU feature into our project. Of course, when burnt with bootloader, nRF toolbox can find device and upgrade application correctly</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Sep 2015 14:27:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8989/dfu-from-application" /><item><title>RE: DFU from application</title><link>https://devzone.nordicsemi.com/thread/33095?ContentTypeID=1</link><pubDate>Mon, 07 Sep 2015 14:27:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c5ab2c4-8594-4a46-a352-89aa6d90ed3e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;You can have  a look at the dfu_transport_update_start() function where we increase the address by 1 when we start bootloader from a button press.&lt;/p&gt;
&lt;p&gt;The default address of our chip is RANDOM STATIC Address. Public address should be the address in  address domain your company registered with Bluetooth SIG.&lt;/p&gt;
&lt;p&gt;Private address as far as I remember, is just the name to distinguish with public address and the random static address.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from application</title><link>https://devzone.nordicsemi.com/thread/33094?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2015 12:42:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f6da19b-1e2a-48b7-b6c2-6821f80efcc8</guid><dc:creator>Alex Zhang</dc:creator><description>&lt;p&gt;OK. I think we can accept unencrypted link druing DFU, so I just call sd_ble_gap_address_set, right? which para can I choose for my case? BLE_GAP_ADDR_CYCLE_MODE_AUTO is not good, it will change every BLE_GAP_DEFAULT_PRIVATE_ADDR_CYCLE_INTERVAL_S seconds.BLE_GAP_ADDR_TYPE_PUBLIC or BLE_GAP_ADDR_TYPE_RANDOM_STATIC, which is better? How to get a private address, any example code?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from application</title><link>https://devzone.nordicsemi.com/thread/33093?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2015 11:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f402fba-9cca-4b47-92d1-93e07928b6e5</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;No the softdevice won&amp;#39;t send the indication automatically, you need to send it by calling sd_ble_gatts_service_changed(). However, the existence of this characteristic can tell the central device that the att table maybe changed, and he can act differently. At least it&amp;#39;s the case on iOS device. When you are not bonded and you have service changed characteristic, the phone will try to do service discovery every time it reconnects.&lt;/p&gt;
&lt;p&gt;The option to change the address should be a good solution if you ok with doing bootloader without the encrypted link.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from application</title><link>https://devzone.nordicsemi.com/thread/33092?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2015 08:52:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26bdcc04-639d-484f-aa93-b4701cfe98fa</guid><dc:creator>Alex Zhang</dc:creator><description>&lt;p&gt;Thanks, Hung. Actually, we only use UART profile in our application, and our device will receive a DFU-like command via UART characteristic, then the device should disconnect UART connection and then go to bootloader for a firmware upgrade. As your proposal, i will set IS_SRVC_CHANGED_CHARACT_PRESENT and try again. A confused point is that if I enable this service changed indication, does my device or Softdevice send this change automaticlly? How does Android App deal with this indication with callback?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from application</title><link>https://devzone.nordicsemi.com/thread/33091?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2015 11:42:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f219037c-0d32-4305-b84c-a87619848872</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Alex Zhang: Yes, you should set  IS_SRVC_CHANGED_CHARACT_PRESENT to 1 for both application and bootloader. However this one would have no effect if the device is not bonded.
But to do that you would need to share bond information between the application and bootloader.
You can refer to our button-less example in our SDK. Our approach doesn&amp;#39;t do a NVIC soft reset but jump directly to the bootloader.
Another solution you can use is to change the address of the device to another address, so that the phone will treat it as a new device. This is what we do when the device is started directly in bootloader (with a button press for examle).
This way you can get away with the ATT cache issue. But the link when doing DFU is not encrypted.&lt;/p&gt;
&lt;p&gt;If you want to use an app to tell the device to restart in bootloader mode. You just have to define a &amp;quot;enter bootloader&amp;quot; command, and use a write command to write to one of your characteristic to trigger the &amp;quot;restart to bootloader&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from application</title><link>https://devzone.nordicsemi.com/thread/33090?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2015 02:00:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6bf2054-0c17-48f7-af5c-1d34c21df75c</guid><dc:creator>Alex Zhang</dc:creator><description>&lt;p&gt;BTW, except the nrf51 device, i am also developing Android&amp;#39;s application like nrf toolbox for my device. So please show me how to deal with my case, that is, nrf application has no DFU but force a NVIC_SystemReset, but bootloader has DFU. Is it enough that i just set  IS_SRVC_CHANGED_CHARACT_PRESENT=1? How does Android Java code clear ATT cache without manually using settings?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from application</title><link>https://devzone.nordicsemi.com/thread/33089?ContentTypeID=1</link><pubDate>Wed, 02 Sep 2015 15:39:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df3bc508-d154-47bc-a1d8-44ceb9a9951e</guid><dc:creator>Alex Zhang</dc:creator><description>&lt;p&gt;Hi Hung, thanks for your answer. You know, my application has no DFU service but bootloader has. As your suggestion, when I do use retention register to force  a NVIC softreset, the bootloader will advertise a new DFU service to central. Do you mean I should set IS_SRVC_CHANGED_CHARACT_PRESENT to 1 both for application and bootloader? Seen from FAQ, seems I should share bonded information to bootloader, but if not, how Android app reconnect with this DFU servive? As I tested on my Android phone with nRF tooblox, is this the reason why I can see DFU device but when trying to connect, the connection is closed in a short time?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU from application</title><link>https://devzone.nordicsemi.com/thread/33088?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2015 09:08:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cbc211f6-ce73-430a-b618-373b98101b64</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Alex,
You can set the GPREGRET retention register before you call  NVIC_SystemReset() and then in the bootloader you can check if the correct flag is written to GPREGRET you can enter bootloader mode.
Please have a look at section C in this &lt;a href="https://devzone.nordicsemi.com/blogs/685/common-faq-on-dfu/"&gt;FAQ&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regarding the issue with nRFToolbox and nRFUART, could you make sure you have un-pair the device, and also try to turn off and on Bluetooth ? This is to make sure the ATT table cache is cleared. In your application and in the bootloader, you should also set IS_SRVC_CHANGED_CHARACT_PRESENT to 1.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>