<?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 is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/69627/dfu-is-failed-on-nrf-connect-for-desktop-when-use-public-device-address</link><description>I modified, My application&amp;#39;s bdaddr is set public device address. secure bootloader&amp;#39;s bdaddr is set same public device address. 
 When run DFU on nrf connect for desktop, nrf connect for desktop is hung up. 
 When use nrf connect for mobile(Android),</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Jun 2021 07:50:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/69627/dfu-is-failed-on-nrf-connect-for-desktop-when-use-public-device-address" /><item><title>RE: DFU is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/thread/315514?ContentTypeID=1</link><pubDate>Wed, 16 Jun 2021 07:50:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e7df399b-dfcd-48e4-8c50-51e0eace2025</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;If the problem here is that nRF Connect assumes the address is incremented by 1 and the bootloader do not do it (as is the case with the original issue in this thread), then you could modify the &lt;a href="https://github.com/NordicSemiconductor/pc-nrfconnect-ble"&gt;nRF Connect BLE&lt;/a&gt; app to do that (possibly within the &lt;a href="https://github.com/NordicSemiconductor/pc-nrf-dfu-js/"&gt;pc-nrf-dfu-js&lt;/a&gt; module).&lt;/p&gt;
&lt;p&gt;The name is not relevant for nRF Connect for desktop as it searches for the BT address (in buttonless DFU context name is needed for iOS only, as the iOS BT API does not provide the BT address, so a special name is set and used to connect to the same device again to work around that).&lt;/p&gt;
&lt;p&gt;Update: to not increment the address, remove / comment out&amp;nbsp;&lt;code&gt;this._addOneToAddress()&lt;/code&gt;&amp;nbsp;on &lt;a href="https://github.com/NordicSemiconductor/pc-ble-driver-js/blob/master/api/dfu/bleTransport.js#L253"&gt;line 253 in bleTransport.js&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/thread/315492?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 23:55:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b4a5ddc1-f544-47f5-b5b5-1d36772d78ec</guid><dc:creator>RVM</dc:creator><description>&lt;p&gt;Is there any way I can change the desktop application to use the name &amp;#39;DfuTarg&amp;#39; instead of the +1 MAC address?&lt;/p&gt;
&lt;p&gt;We have about 5000 devices with a boot loader that we cannot change, and we are trying to avoid being forced to use the mobile version of the nRF Connect since it is a nightmare trying to match the MAC addresses to the devices on hand.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/thread/286197?ContentTypeID=1</link><pubDate>Tue, 22 Dec 2020 03:31:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b6d3bbbc-cf5c-4ecf-84ad-6de9d3f3a5e7</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;OK.&lt;/p&gt;
&lt;p&gt;Thnak you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/thread/285992?ContentTypeID=1</link><pubDate>Mon, 21 Dec 2020 09:22:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57008b58-8dc4-4276-91fa-ecad2dd63978</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user="loquat"]Please tell me the best place to set BDADDR.[/quote]
&lt;p&gt;The problem here is that you set the address after it has allready been set by the bootloader, which reads the address increments by one and writes it. This is done in&amp;nbsp;gap_address_change() in nrf_dfu_ble.c. I suggest you either change that function directly, or add another function that is called immediately before it, that sets the public address,&amp;nbsp;and then&amp;nbsp;gap_address_change() will be called to increment it again by 1 only if appropriate (which is when not using bonding in the bootloader, which is the most sensible in most cases).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/thread/285772?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2020 09:06:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f070a0bd-9cb9-49f0-910a-8de060a6f64c</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span&gt;I added the following:&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;,&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;nrf_dfu_ble.c
................
static uint32_t advertising_init(uint8_t adv_flags, ble_gap_adv_params_t const * const p_adv_params)
{
    uint32_t err_code;
    uint16_t actual_device_name_length = BLE_GAP_ADV_SET_DATA_SIZE_MAX - APP_ADV_DATA_HEADER_SIZE;

    /* This needs to be static because of SoftDevice API requirements. */
    static uint8_t m_enc_advdata[BLE_GAP_ADV_SET_DATA_SIZE_MAX];

    ble_gap_adv_data_t m_adv_data =
    {
        .adv_data =
        {
            .p_data = m_enc_advdata,
            .len    = APP_ADV_DATA_HEADER_SIZE,
        }
    };
 /****** Add start ********/
    ble_gap_addr_t bdaddr;
    bdaddr.addr_id_peer = 0;
    bdaddr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC;
    memcpy(&amp;amp;bdaddr.addr, PUBLIC_DEVICE_ADDRESS, BLE_GAP_ADDR_LEN);
    sd_ble_gap_addr_set(&amp;amp;bdaddr);
 /****** Add end   ********/
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span&gt;Please tell me the best place to set BDADDR.&lt;br /&gt;(top of gap_params_init()?)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/thread/285762?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2020 08:25:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c05279a-63f2-49b8-8015-66aeb23c7e05</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Now I see the problem. You have the exact same address in bootloader mode and in normal mode, but nRF Connect will assume that the address is incremented by one when not using bonding in the bootloader.&lt;/p&gt;
&lt;p&gt;Where did you set the public BLE address in the bootloader? Referring to&amp;nbsp;components\libraries\bootloader\ble_dfu\nrf_dfu_ble.c you have a&amp;nbsp;gap_address_change() function there, which takes the address and increments it (when not using bonding in bootloader). You should change your address immediately before that runs, or modify that function to set it to your public address + 1. (I admit though that this approach is a bit odd with public addresses as there is a higher likelihood of having a device in range with this +1 address, but that is how this has been solved).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/thread/285757?ContentTypeID=1</link><pubDate>Fri, 18 Dec 2020 07:56:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d369e8b4-43ed-4270-83fe-46a82973229d</guid><dc:creator>loquat</dc:creator><description>&lt;p&gt;1.&amp;nbsp; Connect to Allication.&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1608278296056v1.png" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2. run the DFU. &lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span&gt;wait a bit. (nrf connect is down to white screen.)&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1608278367232v2.png" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span&gt;&lt;br /&gt;3. rescan and connect.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1608278428400v3.png" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class="VIiyi" lang="en"&gt;&lt;span class="JLqJ4b ChMk0b"&gt;&lt;span&gt;Aditional,&lt;br /&gt;If you execute DFU on DfuTarg, it will work normally.&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: DFU is Failed on nrf connect for desktop, when use public device address.</title><link>https://devzone.nordicsemi.com/thread/285692?ContentTypeID=1</link><pubDate>Thu, 17 Dec 2020 15:58:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:73dd8852-62c2-44f2-88ad-29cea1e0838c</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have not been able to reproduce this issue. Can you double check that the nRF uses the expected address when in bootloader mode?&amp;nbsp;Depending on&amp;nbsp;NRF_DFU_BLE_REQUIRES_BONDS, that should be either your public address or public address + 1. nRF Connect for mobile can also use device name to separate devices so it might work even if the address is not correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>