<?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>Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/50741/questions-regarding-dfu-bonding-and-ios-caching</link><description>Hi, 
 I have some questions regarding DFU, Bonding and iOS (caching). In my current project I have a DFU bootloader which does not use bonds, however the application uses bonds. 
 The current setup is that the DFU bootloader uses a different MAC-address</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 12 Sep 2019 09:25:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/50741/questions-regarding-dfu-bonding-and-ios-caching" /><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/209362?ContentTypeID=1</link><pubDate>Thu, 12 Sep 2019 09:25:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0829fc03-eee2-472f-acc6-dca32da033fc</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Hi Bj&amp;ouml;rn,&lt;/p&gt;
&lt;p&gt;So for the late reply here aswell.&lt;/p&gt;
&lt;p&gt;Everything works now, I moved over to letting the Peer Manager send out the notifications. After resolving a bug in SDK &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/51172/service-changed-characteristic-not-enabled-on-ios"&gt;described here&lt;/a&gt; everything works as expected.&lt;br /&gt;&lt;br /&gt;Br,&lt;br /&gt;Anton&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/206379?ContentTypeID=1</link><pubDate>Tue, 27 Aug 2019 12:30:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c6d1ddb1-e139-4866-944e-6b297a062ec2</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Anton,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I apologize for the late reply, I have been on vacation the past week.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What start handle are you passing to&amp;nbsp;sd_ble_gatts_service_changed(), i.e. which handle value is system_service_get_service_handle() returning? Can you post the code for&amp;nbsp;system_service_get_service_handle()?&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/204199?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2019 07:02:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:183bf889-21f0-4ab3-a893-477a4ecfd056</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Hi again Bj&amp;ouml;rn,&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve managed to get it all working. I was missing some necessary things such as Service Changed Characterstic in the application and so on. After adding them I can enter the DFU bootloader using the shared bond.&lt;br /&gt;&lt;br /&gt;One thing I&amp;#39;ve noticed is that when the DFU is complete and I reconnect the DFU services are still there and I have to refresh the services on my Android device. I&amp;#39;m guessing I should call sd_ble_gatts_service_changed() to notify the Central that the services has changed in the application, is there in any specific event that you recommend that I call this function? Like BLE_GAP_EVT_CONNECTED?&lt;/p&gt;
&lt;p&gt;Edit:&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve found another question here on Devzone where the call to sd_ble_gatts_service_changed() is placed in BLE_GAP_EVT_CONN_SEC_UPDATE. I placed it there and notifications are sent when i disconnect / reconnect. But after DFU I get BLE_ERROR_INVALID_ATTR_HANDLE, I have pretty much copied how I send notifications from nrf_dfu_ble.c&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;err_code = sd_ble_gatts_sys_attr_set(
            p_ble_evt-&amp;gt;evt.gap_evt.conn_handle,
            sys_serv_attr,
            len,                               
            BLE_GATTS_SYS_ATTR_FLAG_SYS_SRVCS
        );

        if (err_code != NRF_SUCCESS)
        {
            NRF_LOG_INFO(&amp;quot;Error setting system attributes!&amp;quot;);
        }


        err_code = sd_ble_gatts_sys_attr_set(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle,
                                         NULL,
                                         0,
                                         BLE_GATTS_SYS_ATTR_FLAG_USR_SRVCS);
        if (err_code != NRF_SUCCESS)
        {
            NRF_LOG_INFO(&amp;quot;Failed to set system attributes!&amp;quot;);
        }

        err_code = sd_ble_gatts_service_changed(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, system_service_get_service_handle(), 0xFFFF);
        if (err_code != NRF_SUCCESS)
        {
            NRF_LOG_INFO(&amp;quot;Failed to send service changed indication!, err_code: %d&amp;quot;, err_code);
        }
        else
        {
            NRF_LOG_INFO(&amp;quot;Service changed indication sent!&amp;quot;);
        }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/204096?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2019 13:18:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:677b6596-aa79-4cfb-8d95-38c52906da43</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;I found the issue, I was looking in the wrong file (ble_dfu_unbonded.c, my ctags took me there instead of ble_dfu_bonded). All that was needed was to move the Peer Manager initialization to before init of ble dfu buttonless service.&lt;br /&gt;&lt;br /&gt;I&amp;#39;m now struggling with entering the bootloader. After I have bonded and try to write to the DFU characteristic I receive this in the logs:&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;app: Read/Write Authorization request.
&amp;lt;info&amp;gt; app: Writing peer data to the bootloader...
&amp;lt;error&amp;gt; app: Request to enter bootloader mode failed asynchroneously.
&amp;lt;info&amp;gt; app: Handle Value Confirmation
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;the issue seems to be that ble_dfu_bonded.c cannot find the bonding information, retrieve_peer_data() returns NRF_ERROR_NOT_FOUND. Not really sure where to go from here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/204034?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2019 11:01:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:750f2ac7-cac9-43e5-a024-1198ef49de68</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Right.&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve added some debug logs to ble_dfu, and its seems to be the function ble_dfu_buttonless_backend_init which returns NRF_ERROR_INVALID_STATE.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/204002?ContentTypeID=1</link><pubDate>Wed, 14 Aug 2019 09:19:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edded213-c08d-40e7-8e58-5c20248618a8</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;If it was the UUID count then you should have gotten the&amp;nbsp;NRF_ERROR_NO_MEM return value.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are getting&amp;nbsp;&lt;span&gt;NRF_ERROR_INVALID_STATE, then this suggests that there is some wrong with the service context passed to&amp;nbsp;sd_ble_gatts_characteristic_add()&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;NRF_ERROR_INVALID_STATE Invalid state to perform operation, a service context is required.&lt;/p&gt;
&lt;p&gt;What service handle is returned by&amp;nbsp;sd_ble_gatts_service_add(), which is called prior to sd_ble_uuid_vs_add() and ble_dfu_buttonless_char_add()?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203881?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 14:31:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e2eab5c-9b5b-469f-972f-9b05a745a8e5</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;I was a bit quick there.&lt;br /&gt;&lt;br /&gt;It is actually the function ble_dfu_buttonless_init() that returns NRF_INVALID_STATE.&lt;/p&gt;
&lt;p&gt;Edit: I&amp;#39;ve been going through that function and the only call that I can see which can possibly return NRF_INVALID_STATE is sd_ble_gatts_characteristic_add() which seems really strange.&lt;/p&gt;
&lt;p&gt;Edit:&lt;br /&gt;I have tried to incrementing the UUID count in sdk_config by one. Still gives NRF_INVALID_STATE.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203876?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 14:23:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a3ffda03-665f-420d-a454-564d1c3825ff</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;So its not&amp;nbsp;nrf_dfu_svci_vector_table_unset() that returns&amp;nbsp;&lt;span&gt;NRF_INVALID_STATE? Is a function that is called after&amp;nbsp;ble_dfu_buttonless_async_svci_init() then?&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203873?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 14:17:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08e6cb51-3f0e-4a34-9b14-4d4b3c31b5e3</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Ok so It&amp;#39;s not the async SVC interface that&amp;#39;s giving me NRF_INVALID_STATE, it&amp;#39;s when I try to initialize the service.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203860?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 13:51:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddc72992-6dcf-4044-a000-bb5bf32e1e0f</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Updated my answer with the error code it&amp;#39;s giving me, I missed the APP_ERROR_CHECK.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203857?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 13:49:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60efaa6d-7d4d-493e-af8c-7f33302d0bbb</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;The log line&lt;/p&gt;
&lt;p&gt;Setting vector table to main app: 0x00026000&lt;/p&gt;
&lt;p&gt;indicates that&amp;nbsp;ble_dfu_buttonless_async_svci_init has returned, but it could be that it returned a non-zero error code and that it was caught by&amp;nbsp;APP_ERROR_CHECK(err_code).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you&amp;nbsp;compile the application in the debug configuration(add&amp;nbsp;DEBUG to the preprocessor definintions) and then&amp;nbsp;set a breakpoint in&amp;nbsp;app_error_fault_handler()?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;-Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203848?ContentTypeID=1</link><pubDate>Tue, 13 Aug 2019 13:36:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3035e97b-b342-4f29-ad49-6af388e299d3</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;I&amp;#39;ve got the build working now.&lt;br /&gt;&lt;br /&gt;However when I try to initialize the async SVC interface it fails with error code 8 (NRF_INVALID_STATE).&lt;br /&gt;&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;&amp;lt;info&amp;gt; app: Initialized GATT
&amp;lt;info&amp;gt; app: Initialized services.
&amp;lt;info&amp;gt; app: Setting vector table to bootloader: 0x00072000
&amp;lt;info&amp;gt; app: Setting vector table to main app: 0x00026000
*Reboot*&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Edit: With DEBUG enabled:&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;lt;info&amp;gt; app: Initialized GATT
&amp;lt;info&amp;gt; app: Setting vector table to bootloader: 0x00072000
&amp;lt;debug&amp;gt; app: nrf_dfu_svci_vector_table_set() -&amp;gt; success
&amp;lt;debug&amp;gt; app: nrf_dfu_set_peer_data_init() -&amp;gt; success
&amp;lt;info&amp;gt; app: Setting vector table to main app: 0x00026000
&amp;lt;debug&amp;gt; app: nrf_dfu_svci_vector_table_unset() -&amp;gt; success
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203654?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 15:10:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:08295afe-7164-4be5-81b9-8957a80ea1df</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Yes, enabling&amp;nbsp;&lt;span&gt;NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS in sdk_config.h&amp;nbsp;in both the application and bootloader is all that is needed for bond sharing.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The application will then call&amp;nbsp;nrf_dfu_set_peer_data() prior to resetting to the bootloader.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203644?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 14:30:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd37538f-d3dc-4539-bee3-d82e186f5423</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Thanks for the tips.&lt;/p&gt;
&lt;p&gt;I think I understand how to pass the information now.&lt;br /&gt;&lt;br /&gt;However I&amp;#39;m struggling to call the bootloader SVC interface. All I&amp;#39;m getting is implicit declaration when I try to call nrf_dfu_set_peer_data. NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS is set to 1, and I&amp;#39;ve tried to include various dfu files without any success.&lt;/p&gt;
&lt;p&gt;Edit: I&amp;#39;m doing it wrong I think. If I understand the source code correctly If I just enable NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS the Buttonless DFU service will call nrf_dfu_set_peer_data() when a bonded device writes to the characteristic?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203604?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 13:06:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ee394949-db8e-4b7b-a71f-1debc1ec1405</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Anton,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I recommend taking a look at the &lt;a title="Buttonless DFU Template Application" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.3.0/ble_sdk_app_buttonless_dfu.html?cp=5_1_4_4_1"&gt;Buttonless DFU Template Application&lt;/a&gt; and the ble_dfu_bonded.c file. It shows how we use&amp;nbsp;pm_peer_data_bonding_load() to retreive the bonding data and then pass it on to the bootloader using&amp;nbsp;nrf_dfu_set_peer_data().&lt;/p&gt;
&lt;p&gt;Note that&amp;nbsp;we do not support bond sharing for more than one peer, i.e. the&amp;nbsp;central that will initiate the DFU process.&lt;/p&gt;
&lt;p&gt;Best regards&lt;/p&gt;
&lt;p&gt;Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203520?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 09:31:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5641cac6-40ae-440e-a82b-fca6b6e048a6</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Hi again Bj&amp;ouml;rn,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve started working on calling nrf_dfu_set_peer_data.&lt;/p&gt;
&lt;p&gt;From nrf_dfu_set_peer_data_on_call() I can see that it takes two parameters, a struct (nrf_dfu_peer_data_t) and an enum (nrf_dfu_peer_data_state_t).&lt;br /&gt;&lt;br /&gt;Currently I&amp;#39;m trying to fill the nrf_dfu_peer_data_t struct with the correct information:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint32_t            crc;                                    
ble_gap_id_key_t    ble_id;
ble_gap_enc_key_t   enc_key;
uint8_t             sys_serv_attr[SYSTEM_SERVICE_ATT_SIZE];
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using pm_peer_data_load() to retrieve the system attributes, ble id (IRK) and encryption key for all bonded peers.&lt;/p&gt;
&lt;p&gt;To calculate crc the plan is to use crc32_compute() to calculate the CRC for each bonded peer.&lt;/p&gt;
&lt;p&gt;Does this sound correct?&lt;/p&gt;
&lt;p&gt;Edit: Im also slightly unsure which file to include from my application to make the function nrf_dfu_set_peer_data available. NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS is set to 1 in the application sdk_config.h.&lt;/p&gt;
&lt;p&gt;/ Anton&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203510?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 08:55:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0d318f5-eb21-4608-881e-f46699411642</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Happy to help :) Let me know if you run into any issues.&lt;/p&gt;
&lt;p&gt;-Bjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203470?ContentTypeID=1</link><pubDate>Mon, 12 Aug 2019 06:43:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1559b4dc-6025-4730-bdf6-a8b985880017</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p&gt;Thanks for the information. I will try it out today and get back to you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203243?ContentTypeID=1</link><pubDate>Fri, 09 Aug 2019 09:18:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d415756-1bcc-4366-9526-7b2f3b072a63</guid><dc:creator>bjorn-spockeli</dc:creator><description>[quote user="AntonHellbe"]Where can I read more about nrf_dfu_set_peer_data()? I&amp;#39;ve tried looking through the Infocenter but the closest relevant information I can find is &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/group__nrf__dfu__svci__bond__sharing.html?cp=5_5_1_6_11_7_0_1"&gt;this&lt;/a&gt;.[/quote]
&lt;p&gt;&amp;nbsp;The async SVC interface is not particularly well documented, so I would&amp;nbsp;recommend that you take a look at the source code in the bootloader, i.e.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nRF5_SDK_15.0.0_a53641a&lt;/span&gt;\components\libraries\bootloader\dfu\nrf_dfu_svci_handler.c&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nRF5_SDK_15.0.0_a53641a&lt;/span&gt;\components\libraries\svc\nrf_svc_handler.c&lt;/p&gt;
&lt;p&gt;&lt;span&gt;nRF5_SDK_15.0.0_a53641a&lt;/span&gt;\components\libraries\bootloader\dfu\nrf_dfu_svci.c&lt;/p&gt;
&lt;p&gt;the most relevant function is&amp;nbsp;nrf_dfu_set_peer_data_on_call() in&amp;nbsp;&lt;span&gt;nrf_dfu_svci_handler.c.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="AntonHellbe"]I&amp;#39;m no quite sure how to ensure that the settings hex only contains data on the bootloader settings page. I&amp;#39;ve followed the steps that you provided in an &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/42879/dfu-with-bonds-issue"&gt;answer to another user &lt;/a&gt;here on the dev zone. It fails on step 8 when I try to merge the settings file.[/quote]
&lt;p&gt;&amp;nbsp;This is taken care of by nrfutil, but if you are using nRF5 SDK v15.0.0, then make sure that you use the&amp;nbsp;&lt;span&gt;--no-backup when generating the settings page. Otherwise the generated settings hex file will contain an extra backup page that was introduced in SDK v15.1.0 I believe.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203122?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 14:14:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5a810fcc-4e45-4f3a-8a8a-b9ab63c4cd8d</guid><dc:creator>AntonHellbe</dc:creator><description>&lt;p style="padding-left:30px;"&gt;&lt;span&gt;The application will then use the function&amp;nbsp;nrf_dfu_set_peer_data(), which is defined in the bootloader through a async SVC interface, to share the bonding data with the peer. When the device restes to bootloader mode, it will then use that bonding information to re-establish and re-encrypt the connection&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Where can I read more about nrf_dfu_set_peer_data()? I&amp;#39;ve tried looking through the Infocenter but the closest relevant information I can find is &lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/group__nrf__dfu__svci__bond__sharing.html?cp=5_5_1_6_11_7_0_1"&gt;this&lt;/a&gt;.&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;span&gt;It should only be a matter of defining&amp;nbsp;NRF_DFU_BLE_REQUIRES_BONDS in the sdk_config.h file in the bootloader and defining&amp;nbsp;NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS&amp;nbsp; in the sdk_config.h file of the application.&amp;nbsp; The settings hex should only contain data on the bootloader settings page. You can also write it to the nRF device with nrfjprog using the --sectorerase option after flashing the bootloader.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m no quite sure how to ensure that the settings hex only contains data on the bootloader settings page. I&amp;#39;ve followed the steps that you provided in an &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/42879/dfu-with-bonds-issue"&gt;answer to another user &lt;/a&gt;here on the dev zone. It fails on step 8 when I try to merge the settings file.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note: Im also getting NRF_ERROR_INTERNAL if I just try to flash the bootloader.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Questions regarding DFU, Bonding and iOS (caching)</title><link>https://devzone.nordicsemi.com/thread/203084?ContentTypeID=1</link><pubDate>Thu, 08 Aug 2019 13:07:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d56f43b-d4bd-4ca2-8d32-29df46a15835</guid><dc:creator>bjorn-spockeli</dc:creator><description>[quote user=""]The current setup is that the DFU bootloader uses a different MAC-address than the application, this way iOS will treat the DFU bootloader and the application as two different devices and caching is not an issue. Is this an okay solution or would it be preferable to use bonds in the DFU FW since the application uses it?[/quote]
&lt;p&gt;The Secure bootloader in our SDK is considered production code so we do consider it a &amp;#39;OK&amp;#39; solution for our customers.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you configure the bootloader to use bonds, then the bootloader will only allow bonded devices to write to the DFU Control Point and DFU Packet characteristics. The same thing applies to the Buttonless DFU service characteritics in the application, only bonded peers will able to put the nRF device in bootloader mode. The BLE link that the DFU is performed over will also be encrypted.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If the bootloader and the Buttonless DFU service does not require bonds, then any central device can put the nRF in bootloader mode and write to the&amp;nbsp;&lt;span&gt;DFU Control Point and DFU Packet characteristics.&amp;nbsp;The BLE link that the DFU is performed over will in this case not be encrypted.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Note that a DFU package will only be accepted if&amp;nbsp;BLE central has an DFU image that has been signed with the private key that the public key was derived from in the bootloader on the nRF Device. Any other image will be rejected.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]If using bonds with the DFU and adding the Services Changed characteristic and the application is it possible to share the bonding information between Application and DFU FWs? Is there any example that uses bonds for both DFU and application? From what I&amp;#39;ve read the DFU FW does not know where the App stores the bonding information and vice versa.[/quote]
&lt;p&gt;&amp;nbsp;Yes, it is possible for the application to share the bonding information with the bootloader. This is done when you definine&amp;nbsp;&lt;span&gt;NRF_DFU_BLE_REQUIRES_BONDS in the sdk_config.h file in the bootloader and defining&amp;nbsp;NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS&amp;nbsp; in the sdk_config.h file of the application.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The application will then use the function&amp;nbsp;nrf_dfu_set_peer_data(), which is defined in the bootloader through a async SVC interface, to share the bonding data with the peer. When the device restes to bootloader mode, it will then use that bonding information to re-establish and re-encrypt the connection&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote user=""]I&amp;#39;ve have tried changing the DFU FW to also use bonds, however I run into issues when I try to mergehex the settings file for the application with the hex for SD + APP + Bootloader, I&amp;#39;m assuming this is because there are overlapping memory addresses.[/quote]
&lt;p&gt;&amp;nbsp;It should only be a matter of defining&amp;nbsp;&lt;span&gt;NRF_DFU_BLE_REQUIRES_BONDS in the sdk_config.h file in the bootloader and defining&amp;nbsp;&lt;/span&gt;&lt;span&gt;NRF_DFU_BLE_BUTTONLESS_SUPPORTS_BONDS&amp;nbsp; in the sdk_config.h file of the application.&amp;nbsp; The settings hex should only contain data on the bootloader settings page. You can also write it to the nRF device with nrfjprog using the --sectorerase option after flashing the bootloader.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Bjørn&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>