<?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>Enable BLE FOTA DFU MCUBOOT in Zephyr only on button press</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/125582/enable-ble-fota-dfu-mcuboot-in-zephyr-only-on-button-press</link><description>Greetings, 
 
 I would like to enable triggered firmware update option (dfu icon to be shown and to work) in NRF Connect android app on button press or uart. I followed the nordic academy example about ble dfu update but i want to enable it only on button</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 13 Nov 2025 17:18:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/125582/enable-ble-fota-dfu-mcuboot-in-zephyr-only-on-button-press" /><item><title>RE: Enable BLE FOTA DFU MCUBOOT in Zephyr only on button press</title><link>https://devzone.nordicsemi.com/thread/554293?ContentTypeID=1</link><pubDate>Thu, 13 Nov 2025 17:18:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04b54a35-8340-4cc0-b20c-d5dd5905da2b</guid><dc:creator>vasimv</dc:creator><description>&lt;p&gt;mcumgr with zephyr uses BLE GATT services to communicate and update firmware You may add callback functions for GATT write/read and block reading/writing mcumgr attributes if button is not pressed.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Following code always authorizes requests, but you can return false in write_authorize/read_authorize (using&amp;nbsp;bt_uuid_cmp to check if it is OTA attribute read/write or just block all GATT attributes if that&amp;#39;s ok for you) and OTA will be blocked.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;bool write_authorize (struct bt_conn *conn, const struct bt_gatt_attr *attr) {
  return true;
}

bool read_authorize (struct bt_conn *conn, const struct bt_gatt_attr *attr) {
  return true;
}

static const struct bt_gatt_authorization_cb auth_callbacks = {
  .read_authorize = read_authorize,
  .write_authorize = write_authorize,
};


...
  err = bt_gatt_authorization_cb_register(&amp;amp;auth_callbacks);
  if (err) {
    printk(&amp;quot;Error at setting auth callbacks (err %d), probably already set\n&amp;quot;, err);
  }
...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Enable BLE FOTA DFU MCUBOOT in Zephyr only on button press</title><link>https://devzone.nordicsemi.com/thread/554289?ContentTypeID=1</link><pubDate>Thu, 13 Nov 2025 16:41:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab068831-9095-4077-9ad8-38857cc1e8ed</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/113350/how-can-i-add-an-enable-button-to-ncs-ble-dfu/495774"&gt;this post&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Amanda H.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>