<?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>Possible to enter DFU only when bonded?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8208/possible-to-enter-dfu-only-when-bonded</link><description>Unless I am not understanding the code correctly (highly possible...), once the bootloader has restarted into DFU mode, no bond is required to upload new firmware. This works great if you have to physically press a button to enter DFU mode. 
 Not so</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 02 Oct 2015 08:54:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8208/possible-to-enter-dfu-only-when-bonded" /><item><title>RE: Possible to enter DFU only when bonded?</title><link>https://devzone.nordicsemi.com/thread/29544?ContentTypeID=1</link><pubDate>Fri, 02 Oct 2015 08:54:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9ee7dad7-0c86-4c9a-95ec-a497ccb77a15</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Chris: they should be very similar. Please let me know the result.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Possible to enter DFU only when bonded?</title><link>https://devzone.nordicsemi.com/thread/29543?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 07:03:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66311c81-72e6-48f8-9637-4e2651c9fd3b</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;Is there a difference with the ble_app_hrs_dfu in SDK8.0.0 and SDK9.0.0?  I will test the original SDK8.0.0 example tomorrow and get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Possible to enter DFU only when bonded?</title><link>https://devzone.nordicsemi.com/thread/29542?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 06:43:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44a1f815-10a8-4c2e-aa83-a1fd80a45834</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Chris: When it&amp;#39;s not bonded, the phone will try to do service discovery again when reconnected (service changed indication only apply when devices are bonded). This explains why you don&amp;#39;t have the issue.
I would prefer to have a sniffer trace to understand what could be wrong in your case.
Have you tested with the ble_app_hrs_dfu example, to check if it has the same issue ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Possible to enter DFU only when bonded?</title><link>https://devzone.nordicsemi.com/thread/29541?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 06:04:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa4bb35b-5ee0-45b0-b2ff-6da9b5889afe</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;But it works perfectly when set to OPEN, so the service changed indication must be working correctly, no?&lt;/p&gt;
&lt;p&gt;Making that one change to NO_MITM breaks it.&lt;/p&gt;
&lt;p&gt;Btw, I am using SDK8.0.0.&lt;/p&gt;
&lt;p&gt;I assume you are talking about:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_enable_params.gatts_enable_params.service_changed = IS_SRVC_CHANGED_CHARACT_PRESENT; //=1
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It&amp;#39;s in there and my bootloader is based on the ble_app_hrs example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Possible to enter DFU only when bonded?</title><link>https://devzone.nordicsemi.com/thread/29540?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 05:59:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9fb45909-3f31-438c-a3d6-9397ce90d895</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Chris,&lt;/p&gt;
&lt;p&gt;I suspect that you haven&amp;#39;t handled the service changed indication correctly. Make sure you have sent the indication in bootloader when reconnected.
The error &amp;quot;Error on BLE Notification Message: The handle is invalid...&amp;quot; tells that the attribute table is not updated.&lt;/p&gt;
&lt;p&gt;Did you test with the &lt;a href="http://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v9.0.0%2Fexamples_ble_dfu.html&amp;amp;cp=4_1_0_4_3"&gt;ble_app_hrs_withdfu example&lt;/a&gt; ? If not please test with that example, and follow how we handle switching back and forth between application and bootloader.
The example is not by default require bonding, but you can modify as you did above, or force a bonding using our nRFMaster Control Panel app.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Possible to enter DFU only when bonded?</title><link>https://devzone.nordicsemi.com/thread/29539?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2015 05:31:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4cad2062-9208-4a26-8f21-c1026be2d1c2</guid><dc:creator>Chris</dc:creator><description>&lt;p&gt;When I change this in the dfu_ctrl_pt_add function from:&lt;/p&gt;
&lt;p&gt;BLE_GAP_CONN_SEC_MODE_SET_OPEN(&amp;amp;attr_md.write_perm);&lt;/p&gt;
&lt;p&gt;Changed to:&lt;/p&gt;
&lt;p&gt;BLE_GAP_CONN_SEC_MODE_SET_ENC_NO_MITM(&amp;amp;attr_md.write_perm);&lt;/p&gt;
&lt;p&gt;nRF Toolbox asks me to pair, which is what I want, I see the device reset into the bootloader, but then it errors out with &amp;quot;Error on BLE Notification Message: The handle is invalid...&amp;quot;.&lt;/p&gt;
&lt;p&gt;I tried keeping it OPEN in the bootloader and encrypted in the application, but that throws the same error.&lt;/p&gt;
&lt;p&gt;It works perfectly if just set to OPEN.&lt;/p&gt;
&lt;p&gt;What do I need to do to require a paired connection to DFU?&lt;/p&gt;
&lt;p&gt;Btw, I am using SDK8.0.0.&lt;/p&gt;
&lt;p&gt;Thanks.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Possible to enter DFU only when bonded?</title><link>https://devzone.nordicsemi.com/thread/29538?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2015 11:17:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da030f35-ddab-424a-8646-ce3f92102959</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Chris: It&amp;#39;s a good point that there should be a security check before we allow a master to tell the device to enter bootloader mode in the example.
Recently we provided signing solution as an experimental project in SDK 9.0. However, this only block attacker to flash non-genuine firmware but not blocking him to flash the device with older or wrong firmwares that come from the vendor.&lt;/p&gt;
&lt;p&gt;But it&amp;#39;s not too difficult to implement some security check before you allow the application to start the bootloader. As you mentioned, you can set the write permission on the DFU characteristic to require encryption. So that bonding is needed if the central want to write 0x01 here to start DFU.
If it&amp;#39;s the case, you should also block unwanted central to connect to your device by using whitelist.&lt;/p&gt;
&lt;p&gt;If your application should have an open connection and allow any central to bond, then you may want to implement proprietary password and/or public+private key authentication procedure before you allow the application to enter bootloader mode.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>