<?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>Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/56919/start-secure-dfu-button-in-application</link><description>Hi, 
 We are testing Buttonless Secure DFU without bonds using the windows nRF Connect app. If I open the &amp;quot;Secure DFU&amp;quot; service in our app, enable notification for &amp;quot;Buttonless Secure DFU without bonds&amp;quot;, and write 01 to it, the device directly reboots to</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 29 Jan 2020 15:28:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/56919/start-secure-dfu-button-in-application" /><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231721?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 15:28:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bbcb8f16-ffb5-4be0-b9c4-144061b0fb9b</guid><dc:creator>sjerlhagen</dc:creator><description>&lt;p&gt;Thanks, now I understand.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231700?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 14:46:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e8ccf72a-c4e5-4fd1-9600-02e43c26cb2f</guid><dc:creator>Vidar Berg</dc:creator><description>[quote user="sjerlhagen"]If a complete service discovery is needed before writing the DFU attribute, why was it faster with the manual write to the DFU attribute, as opposed to the DFU button ?[/quote]
&lt;p&gt;&amp;nbsp;This is something that could have been implemented more efficiently. When you press the button, the app starts searching for the CCCD for the buttonless DFU characteristic from the beginning of the attribute table instead of limiting the search to the&amp;nbsp;handle range for the buttonless service as it does when you do it manually. The handle range for each service is found through the primary discovery at the beginning of the connection.&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s the part showing the primary service discovery:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-13125b27f3aa434ebeb52ae3c96201ad/pastedimage1580307052957v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;With regards to connection intervals, I guess you can leave it to the phone to decide&amp;nbsp;considering you don&amp;#39;t have a tight power budget. I.e., you don&amp;#39;t have to send connection parameter update requests to the phone. Phones will usually select an interval between 30-50 ms by default in my experience. And there are phones that will start with 7.5 ms intervals&amp;nbsp;until the discovery is complete,&amp;nbsp;then automatically switch to a longer interval, or accept interval requested by peripheral. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Apple provides some recommendations for selecting connection parameters in section 25.6 of this document:&amp;nbsp;&lt;a href="https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf"&gt;https://developer.apple.com/accessories/Accessory-Design-Guidelines.pdf&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231658?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 13:15:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f98dfdf-dbd3-4635-a4ee-e80bd1c0cb69</guid><dc:creator>sjerlhagen</dc:creator><description>&lt;p&gt;No I have not tried Android or iOS yet.&amp;nbsp;I tried to set connection interval 10 ms which got the service discovery time down to 9 seconds&amp;nbsp;after requesting DFU. I thought&amp;nbsp;complete service discovery was done at connection and saved but I see now that it is only done when needed, after clicking DFU. I can live with a permanent fast interval as our device is not power limited, but I still want to play nice with the phone, both for power and compatibility. Is it good to suggest min 10 and max 100 ms connection interval, or what do you suggest ? If a complete service discovery is needed before writing the DFU attribute, why was it faster with the manual write to the DFU attribute, as opposed to the DFU button ?&lt;/p&gt;
&lt;p&gt;Sven&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231636?ContentTypeID=1</link><pubDate>Wed, 29 Jan 2020 12:26:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7901a682-1cf5-43a0-b5b5-103af3312b1e</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The server gives the invalid attribute handle response in packet&amp;nbsp; #2003 to 2309 because the PC client is issuing a request where the starting handle is set higher than the end handle. That might be a bug in our service discovery implementation in nRF connect. However, this is not what&amp;#39;s causing the delay you are experiencing.&amp;nbsp; And the last&amp;nbsp;&amp;quot;Attribute not found&amp;quot; response is returned in this case because the client has reached the end of the attribute table (no attribute that matches the request).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Invalid handle response&lt;/p&gt;
&lt;p&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-13125b27f3aa434ebeb52ae3c96201ad/pastedimage1580299234951v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;To improve the timing for the PC app you may try delay the connection parameter update request in your app by a few seconds to allow the client to complete service discovery at the initial fast interval&amp;nbsp; ( is configurable, see &lt;a title="Connection Parameters Negotiation" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/lib_ble_conn_params.html?cp=7_1_3_2_4"&gt;Connection Parameters Negotiation&lt;/a&gt;). And you can initialize the DFU service first, so it gets moved to the top of your attribute table.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t expect our nRF connect on Android and iOS to have the same problem. Have you tried DFU with those as well?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231445?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 14:38:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19783930-394d-416e-be14-57f9ac570781</guid><dc:creator>sjerlhagen</dc:creator><description>&lt;p&gt;No, when I do it manually it does much less service discovery, at log 6508 in the new log. In the hang-log at 2003, 2077, 2309, 2397 there are errors, why ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dfu_5F00_manual_5F00_no_5F00_hang.pcapng"&gt;devzone.nordicsemi.com/.../dfu_5F00_manual_5F00_no_5F00_hang.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231429?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 13:46:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:751b7e86-d326-4d11-8096-95788373db7a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Thanks for providing the sniffer trace! It looks nRF connect is&amp;nbsp;starting to retrieve information about every attribute handle as soon as you click &amp;quot;DFU start&amp;quot;. It would have been interesting to know if it did&amp;nbsp;the same when you do it manually.&lt;/p&gt;
&lt;p&gt;In any case, the DFU start command&amp;nbsp;appears to get&amp;nbsp;delayed until the service discovery is completed, which takes quite a while considering the large attribute table and&amp;nbsp;long connection interval (400 ms). As a test, please try to use a shorter connection interval and see how it impacts the delay. To do that you can either change the preferred connection interval range in your FW app, or you can make nRF connection ignore the connection parameter update requests from your device.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231368?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 11:02:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d5655c4-776c-45ea-9e19-e4adccaea324</guid><dc:creator>sjerlhagen</dc:creator><description>&lt;p&gt;I managed to capture a wireshark trace of the event which I believe holds the answer, though I don&amp;#39;t understand it. At log no 1986 (27 seconds) I push the DFU button. The nRF Connect app queries my app on a number of faulty handles which takes exactly 100 seconds. At log no 2532 nRF Connect writes the DFU attribute and things proceed (though that&amp;#39;s not in the log as I didn&amp;#39;t capture the bootloader traffic). My app must be declaring something wrong at connection.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/dfu_5F00_hang_5F00_2.pcapng"&gt;devzone.nordicsemi.com/.../dfu_5F00_hang_5F00_2.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231316?ContentTypeID=1</link><pubDate>Tue, 28 Jan 2020 08:37:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0f57039a-00e3-4c84-b2d5-801837e27813</guid><dc:creator>sjerlhagen</dc:creator><description>&lt;p&gt;After connecting to the application the log has reached &amp;lt;&amp;lt;&amp;lt;1&amp;gt;&amp;gt;&amp;gt; below. Clicking the DFU button in nRF Connect&amp;#39;s application window has no immediate effect except nRF Connect says status initializing... Our application is still running and is not aware of the action, I have a breakpoint at ble_dfu_buttonless_on_ctrl_pt_write() and it has not been reached. After 100 sec the breakpoint is reached or if it is inactivated the DFU download proceeds in the expected way with the rest of the log below.&lt;/p&gt;
&lt;p&gt;Something is wrong in either our application or the nRF Connect app (probably the former).&lt;/p&gt;
&lt;p&gt;Our app uses free rtos and is based on ble_app_hrs_freertos from SDK 15.3.0. Where can I set a breakpoint to see the start of the chain of events, I thought the above breakpoint was pretty early in the chain ?&lt;/p&gt;
&lt;p&gt;Thanks&lt;br /&gt;Sven&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;00&amp;gt; J-Link V6.54c - Real time terminal output&lt;br /&gt;00&amp;gt; J-Link OB-SAM3U128-V2-NordicSemi compiled Jan 7 2019 14:07:15 V1.0, SN=682444101&lt;br /&gt;00&amp;gt; Process: IarIdePm.exe&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: *** App main_Init() ***&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Enter BLE_GeneralInit&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Creating a SoftDevice task.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Return from BLE_GeneralInit&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Enter softdevice_task.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Requesting to update ATT MTU to 247 bytes on connection 0x0.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Connected&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: ATT MTU updated to 247 bytes on connection 0x0 (response).&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Data len is set to 0xF4(244)&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7&lt;br /&gt;00&amp;gt; &lt;br /&gt;&amp;lt;&amp;lt;&amp;lt;1&amp;gt;&amp;gt;&amp;gt;&lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Updating data length to 27 on connection 0x0.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: Data length updated to 27 on connection 0x0.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_octets: 27&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_octets: 27&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_rx_time: 2120&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_ble_gatt: max_tx_time: 2120&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: ATT MTU exchange completed. central 0xF7 peripheral 0xF7&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Received indication state 1&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Device is preparing to enter bootloader mode.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Disconnected connection handle 0&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Disconnected 1 links.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: In ble_dfu_buttonless_bootloader_start_finalize&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Device will enter bootloader mode.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: *** App main_Init() ***&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Enter BLE_GeneralInit&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Creating a SoftDevice task.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; app: Return from BLE_GeneralInit&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;debug&amp;gt; nrf_sdh_freertos: Enter softdevice_task.&lt;br /&gt;00&amp;gt; &lt;br /&gt;00&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising.&lt;br /&gt;00&amp;gt; &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Start Secure DFU button in application</title><link>https://devzone.nordicsemi.com/thread/231129?ContentTypeID=1</link><pubDate>Mon, 27 Jan 2020 12:33:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb864723-4378-40c0-a5d8-3072ba76e4fb</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi, &lt;/p&gt;
[quote user=""]enable notification for &amp;quot;Buttonless Secure DFU without bonds&amp;quot;, and write 01 to it, the device directly reboots to DFU mode.[/quote]
&lt;p&gt;&amp;nbsp;The DFU start button does the same as you describe. It starts by enabling indications on the buttonless characteristic, then it writes 0x1 to make the app enter Bootloader DFU mode. This should not be any slower than doing it manually. I tried to replicate this as well with the template app, but there was no noticeable delay.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do you have logging/LED indications to indicate what state the board is in during the 100s delay? E.g., if the app or bootloader is running, and if it&amp;#39;s an active connection or advertising during this time.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>