<?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>Can central master(nrf52840) discover the characteristics of the DFU service on peripheral(nrf52840)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/70797/can-central-master-nrf52840-discover-the-characteristics-of-the-dfu-service-on-peripheral-nrf52840</link><description>Hi All, 
 I want to use DFU to update the firmware from central to peripheral over BLE , both central master and peripheral are nrf52840. 
 Central master can find unknown service(0263000a..) and its characteristics (0x0b and 0x0c) and DFU service (0xfe59</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 25 Jan 2021 09:49:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/70797/can-central-master-nrf52840-discover-the-characteristics-of-the-dfu-service-on-peripheral-nrf52840" /><item><title>RE: Can central master(nrf52840) discover the characteristics of the DFU service on peripheral(nrf52840)</title><link>https://devzone.nordicsemi.com/thread/290964?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 09:49:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18455db4-46f4-43ac-a8ee-455250e9477d</guid><dc:creator>lolifrog</dc:creator><description>&lt;p&gt;&lt;span&gt;Hi Hung,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Thanks for the reply.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The&amp;nbsp;peripheral has bootloader, my work is sending image&amp;nbsp;from central master(nrf52840) to&amp;nbsp;peripheral and bootloader will handle the reciving of the image. The image has been stored in master Flash(GD25VE16C)&amp;nbsp;as below&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/4201.png" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I will study documentation and examples&amp;nbsp;you provided in the next few days.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;T&lt;/span&gt;&lt;span&gt;hanks again.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Steven&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can central master(nrf52840) discover the characteristics of the DFU service on peripheral(nrf52840)</title><link>https://devzone.nordicsemi.com/thread/290951?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 09:03:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50cf8b4d-d52f-4db7-888d-2b0d51ab56b0</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Steven,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you planning to handle the receiving of the new image in your application (background DFU) ? Or you plan to switch from application to the bootloader (buttonless DFU) and the bootloader will handle the receiving of the image ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Regarding the protocol to send the image, please have a look at the documentation &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.0.2/lib_dfu_transport_ble.html?cp=7_1_3_5_2_2"&gt;here&lt;/a&gt;. Note that when the nRF Connect app sending the image,&amp;nbsp;it unzips the files and send the binary image inside , not the .zip itself.&amp;nbsp;&lt;br /&gt;I have made an example on how to do DFU update from an nRF52 to another nRF52 on UART and SPI. It&amp;#39;s not for BLE but I think it&amp;#39;s a good source of reference. Have a look &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/software-development-kit/posts/getting-started-with-nordics-secure-dfu-bootloader#h108sjziaxo3m81rkgr1has5r1d72qtu"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can central master(nrf52840) discover the characteristics of the DFU service on peripheral(nrf52840)</title><link>https://devzone.nordicsemi.com/thread/290928?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 07:36:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05373887-e2bb-439a-9f39-d492e42df892</guid><dc:creator>lolifrog</dc:creator><description>&lt;p&gt;I&amp;#39;ve solved this problem,&amp;nbsp; the DFU service and its &lt;span&gt;characteristics&lt;/span&gt;&amp;nbsp;are not based on&amp;nbsp;the same service.&lt;/p&gt;
&lt;p&gt;In my first picture,&amp;nbsp; I changed the &lt;span&gt;characteristic&amp;#39;s base UUID as same as DFU service base UUID but the program has some bugs which&amp;nbsp;cause&amp;nbsp;the characteristic UUID not to be read.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Another problem arises, how can I use the&amp;nbsp;central master(nrf52840) transmits upgrade program to upgrade the peripheral? In &amp;quot;nRF Connect&amp;quot; APP , just send the zip file and wait for upgrading, but I don&amp;#39;t know how it&amp;nbsp;works,&amp;nbsp;where can I get details?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; steven&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can central master(nrf52840) discover the characteristics of the DFU service on peripheral(nrf52840)</title><link>https://devzone.nordicsemi.com/thread/290909?ContentTypeID=1</link><pubDate>Mon, 25 Jan 2021 03:04:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:476c5fdd-dfec-4dbe-8f1c-6f6dd51c6344</guid><dc:creator>lolifrog</dc:creator><description>&lt;p&gt;Hi Hung,&lt;/p&gt;
&lt;p&gt;Thanks for the reply.&lt;/p&gt;
&lt;p&gt;I used the example of &amp;quot;nRF5_SDK_16.0.0_98a08e2\examples\ble_central\ble_app_hrs_c\pca10056\s140\arm5_no_packs&amp;quot; and changed the UUID.I have&amp;nbsp;fed DFU&amp;nbsp;service base UUID to the softdevice by calling&amp;nbsp;sd_ble_uuid_vs_add()&amp;nbsp;&amp;nbsp;in&amp;nbsp;ble_hrs_c_init()&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;//the funcion is from &amp;quot;nRF5_SDK_16.0.0_98a08e2\examples\ble_central\ble_app_hrs_c&amp;quot; and I changed the UUID
uint32_t ble_hrs_c_init(ble_hrs_c_t * p_ble_hrs_c, ble_hrs_c_init_t * p_ble_hrs_c_init)
{
	uint32_t      err_code;
    VERIFY_PARAM_NOT_NULL(p_ble_hrs_c);
    VERIFY_PARAM_NOT_NULL(p_ble_hrs_c_init);

	uint8_t dfu_uuid_type;
    ble_uuid_t dfu_uuid;
	ble_uuid_t dfu_nus_uuid;
	//DFU_BASE_UUID = {{0xfb,0x34,0x9b,0x5f,0x80,0x00,0x00,0x80,0x00,0x10,0x00,0x00,0x0,0x0,0x00,0x00}};
	// the 128 bits uuid above was found by Android Studio
	ble_uuid128_t dfu_base_uuid = DFU_BASE_UUID;
    err_code = sd_ble_uuid_vs_add(&amp;amp;dfu_base_uuid, &amp;amp;dfu_uuid_type);
	VERIFY_SUCCESS(err_code);
    dfu_uuid.type = dfu_uuid_type;    	
    dfu_uuid.uuid = BLE_DFU_SERVER_UUID; 	//0xFE59	
	
    p_ble_hrs_c-&amp;gt;evt_handler                 = p_ble_hrs_c_init-&amp;gt;evt_handler;
    p_ble_hrs_c-&amp;gt;error_handler               = p_ble_hrs_c_init-&amp;gt;error_handler;
    p_ble_hrs_c-&amp;gt;p_gatt_queue                = p_ble_hrs_c_init-&amp;gt;p_gatt_queue;
    p_ble_hrs_c-&amp;gt;conn_handle                 = BLE_CONN_HANDLE_INVALID;
    p_ble_hrs_c-&amp;gt;peer_hrs_db.hrm_cccd_handle = BLE_GATT_HANDLE_INVALID;
    p_ble_hrs_c-&amp;gt;peer_hrs_db.hrm_handle      = BLE_GATT_HANDLE_INVALID;

    return ble_db_discovery_evt_register(&amp;amp;dfu_uuid);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;service discovery function is below,just show&amp;nbsp;which service and&amp;nbsp;characteristic is found&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;pre class="ui-code" data-mode="text"&gt;void ble_hrs_on_db_disc_evt(ble_hrs_c_t * p_ble_hrs_c, const ble_db_discovery_evt_t * p_evt)
{
	NRF_LOG_INFO(&amp;quot;discovered_db.srv_uuid.uuid :%x&amp;quot;,p_evt-&amp;gt;params.discovered_db.srv_uuid.uuid);
    if (p_evt-&amp;gt;evt_type == BLE_DB_DISCOVERY_COMPLETE &amp;amp;&amp;amp;
        p_evt-&amp;gt;params.discovered_db.srv_uuid.uuid == BLE_DFU_SERVER_UUID &amp;amp;&amp;amp;
        p_evt-&amp;gt;params.discovered_db.srv_uuid.type == BLE_UUID_TYPE_BLE)
    {
		NRF_LOG_INFO(&amp;quot;discovered_db.char_count:%x&amp;quot;,p_evt-&amp;gt;params.discovered_db.char_count);
		NRF_LOG_INFO(&amp;quot;discovered_db.charateristics[i].uuid:%d&amp;quot;,p_evt-&amp;gt;params.discovered_db.charateristics[0].characteristic.uuid.uuid);
	
    }
}
&lt;/pre&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;nbsp;have noted&amp;nbsp;that the base UUID of NFC service and its&amp;nbsp;characteristics&amp;nbsp;are&amp;nbsp;different&amp;nbsp;in &amp;quot;nRF5_SDK_16.0.0_98a08e2\examples\ble_peripheral\ble_app_buttonless_dfu&amp;quot; , and I tried to feed the characteristic base UUID&amp;nbsp;to the softdevice by calling&amp;nbsp;sd_ble_uuid_vs_add() and&amp;nbsp;ble_db_discovery_evt_register() in&amp;nbsp;ble_hrs_c_init(), but the result was central master cound not connect with peripheral at all.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; steven&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can central master(nrf52840) discover the characteristics of the DFU service on peripheral(nrf52840)</title><link>https://devzone.nordicsemi.com/thread/290761?ContentTypeID=1</link><pubDate>Fri, 22 Jan 2021 13:27:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:264598fe-6552-4e61-a3bd-6f053003275c</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Could you let me know&amp;nbsp;how did you do the service discovery ?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please note that the DFU service has different UUID to the NUS service. So you would need to feed the base UUID to the softdevice by calling&amp;nbsp;sd_ble_uuid_vs_add() similar to what implemented in ble_nus_c.c make sure you used the uuid_type returned from that function as the input for&amp;nbsp;ble_db_discovery_evt_register() calls.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>