<?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>OTA fail after set the public address</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/18568/ota-fail-after-set-the-public-address</link><description>Hi, 
 I&amp;#39;m using the nRF5_sdk V11.0 and S130 on nRF51822, we need to write a 6 bytes address to the CUSTOMER register(address is 0x100010f8) of the UICR when mass production, then I will read it out to use sd_ble_gap_address_set function change the gap</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 13 May 2024 08:13:19 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/18568/ota-fail-after-set-the-public-address" /><item><title>RE: OTA fail after set the public address</title><link>https://devzone.nordicsemi.com/thread/482956?ContentTypeID=1</link><pubDate>Mon, 13 May 2024 08:13:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c98f4319-5bb2-46da-8660-7ba53c8e17d3</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Very good to hear. The best of luck with your project &lt;span class="emoticon" data-url="https://devzone.nordicsemi.com/cfs-file/__key/system/emoji/1f642.svg" title="Slight smile"&gt;&amp;#x1f642;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA fail after set the public address</title><link>https://devzone.nordicsemi.com/thread/482405?ContentTypeID=1</link><pubDate>Wed, 08 May 2024 04:56:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:771fbedd-5a39-42f5-ad6d-8e6e170b93d3</guid><dc:creator>Gin</dc:creator><description>&lt;p&gt;&lt;span&gt;My problem has been resolved because the version of the nrf connect software I am using is too low. I switched to the latest version 4.28 and everything has been resolved&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA fail after set the public address</title><link>https://devzone.nordicsemi.com/thread/482234?ContentTypeID=1</link><pubDate>Tue, 07 May 2024 10:12:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36664a8e-c807-4859-8e7d-ba23d13584f5</guid><dc:creator>Gin</dc:creator><description>&lt;p&gt;&lt;span class="MachTrans__hl__6hdYK"&gt;The initial mobile system I used was Android 10 but couldn&amp;#39;t be upgraded. Later, I used Android 14, but it couldn&amp;#39;t be upgraded the first time.&lt;/span&gt;&lt;span class=""&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;If I try to use a program that can be upgraded to insert nrf52832 and perform DFU upgrade on it, then erase all the programs and burn my program, then I can upgrade using my phone, but when I change the public MAC address, I cannot upgrade again&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=""&gt;&lt;span&gt;Here are the functions for me to change the public MAC and write to the UICR register&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=""&gt;&lt;pre class="ui-code" data-mode="text"&gt;void load_dvc_mac(void)
{

    uint32_t err_code = 0;
    ble_gap_addr_t addr;
    err_code = sd_ble_gap_addr_get(&amp;amp;addr);
    APP_ERROR_CHECK(err_code);

    //  LOG(&amp;quot;mac:%X:%X:%X:%X:%X:%X&amp;quot;,dvc_ble_info.ble_mac[0],dvc_ble_info.ble_mac[1],dvc_ble_info.ble_mac[2], dvc_ble_info.ble_mac[3],dvc_ble_info.ble_mac[4],dvc_ble_info.ble_mac[5]);

    addr.addr[0] = dvc_ble_info.ble_mac[5];
    addr.addr[1] = dvc_ble_info.ble_mac[4];
    addr.addr[2] = dvc_ble_info.ble_mac[3];
    addr.addr[3] = dvc_ble_info.ble_mac[2];
    addr.addr[4] = dvc_ble_info.ble_mac[1];
    addr.addr[5] = dvc_ble_info.ble_mac[0];

    addr.addr_type = BLE_GAP_ADDR_TYPE_PUBLIC; // 公共类型的广播地址;  如果是静态随机，最高2位需要为11:  addr[5]|0xC0

    if (addr.addr_type == BLE_GAP_ADDR_TYPE_RANDOM_STATIC)
    {
        addr.addr[5] = (addr.addr[5] | 0xC0);
    }
    // LOG(&amp;quot;&amp;lt;%d-%d-%x&amp;gt;\n&amp;quot;, addr.addr_id_peer, addr.addr_type, addr.addr[5]);

    err_code = sd_ble_gap_addr_set(&amp;amp;addr);

    APP_ERROR_CHECK(err_code);

}
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=""&gt;&lt;pre class="ui-code" data-mode="text"&gt;void Save_mac_to_UICR(void)
{

    NRF_UICR_Type t_uicr = {0};
    memcpy((uint8_t *)&amp;amp;t_uicr, (uint8_t *)NRF_UICR, sizeof(NRF_UICR_Type));
    memcpy((uint8_t *)&amp;amp;t_uicr.UNUSED0, &amp;amp;dvc_ble_info.ble_mac[0], 6);

    nrf_nvmc_page_erase((uint32_t)&amp;amp;NRF_UICR-&amp;gt;UNUSED0); // 一次擦除连续写入
    nrf_nvmc_write_bytes((uint32_t)&amp;amp;NRF_UICR-&amp;gt;UNUSED0, (uint8_t *)&amp;amp;t_uicr, sizeof(NRF_UICR_Type));

}&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span class=""&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA fail after set the public address</title><link>https://devzone.nordicsemi.com/thread/481957?ContentTypeID=1</link><pubDate>Mon, 06 May 2024 09:36:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f9c4be3a-caba-4361-b16d-f9dc20b39943</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you are using SDK v12 or newer what you describe should work fine, as long as you make sure to write your data to one of the CUSTOMER registers in the UICR.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you&amp;#39;re still having issues with this please open a new ticket, and share the details of what you have tried and which problems you are experiencing. Then we can have a look.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA fail after set the public address</title><link>https://devzone.nordicsemi.com/thread/481003?ContentTypeID=1</link><pubDate>Mon, 29 Apr 2024 08:14:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e391059-42e8-45ab-b52b-8ecdef4c4308</guid><dc:creator>Gin</dc:creator><description>&lt;p&gt;I also encountered the same problem. The chip I used is NRF52832. I set a public address in the application and saved it in the NRF_UICR register to read the address when bootloader dfu starts. But there is a serious and unsolvable problem here. My phone keeps reminding me of connection timeout when performing DUF. Through simulation, I found that the application did not start the DFU process. If I do not set a public address, the DFU process is successful. Through low-power analysis of the current, I determined that the application did not enter the bootloader at all because the DFU process restarts and the current tends to decrease. However, the problem I encountered did not involve a restart. The routine I used was ble_uart, and I have no way to solve this problem. I am saddened&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: OTA fail after set the public address</title><link>https://devzone.nordicsemi.com/thread/71659?ContentTypeID=1</link><pubDate>Fri, 23 Dec 2016 13:00:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de7554a8-407f-4160-a004-873aeb3f1bb2</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Alice,&lt;/p&gt;
&lt;p&gt;The problem is that when we reset to the OTA bootloader, the softdevice is reinitialized, therefore the address used here is the original one. Not the one you set in your application. Therefore the app on the phone won&amp;#39;t be able to find the DFU bootloader to do DFU update since the address is changed.&lt;/p&gt;
&lt;p&gt;So what you need to do is to also set the address to the address you saved in UICR in the bootloader.&lt;/p&gt;
&lt;p&gt;Note that inside dfu_transport_update_start() we do an address change if there is no re-bond required, we increase the address by 1 to make the DFU look like a new device, just to make sure it&amp;#39;s not cached by the peer device, or the peer device try to re-bond with the DFU bootloader. The app do search for both the device address and the device address + 1 to do a re-connect.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>