<?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>ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7678/ble_dfus-with-ble_nus</link><description>I&amp;#39;ve been using the device firmware update service for quite some time now. I&amp;#39;m looking to add the ble_nus service, but this feature seems to fail when ble_dfus is re-enabled. I check all my err_code s and nothing ever fails. I just can&amp;#39;t ever get my</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 May 2016 15:28:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7678/ble_dfus-with-ble_nus" /><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27364?ContentTypeID=1</link><pubDate>Tue, 03 May 2016 15:28:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c193c02a-04fa-4882-85b3-7836fd5d719b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Szymon,&lt;/p&gt;
&lt;p&gt;Please create a new question and ask your question, you are using the &amp;quot;answer&amp;quot; section.&lt;/p&gt;
&lt;p&gt;Please add more information about the issue you are having and what showed when you try to debug it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27363?ContentTypeID=1</link><pubDate>Fri, 29 Apr 2016 14:40:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22fc9e0b-1979-4513-996e-52320ac2b1db</guid><dc:creator>Szymon-ek</dc:creator><description>&lt;p&gt;I have the same problem.&lt;/p&gt;
&lt;p&gt;Code below run first two services but last one (DFU) do not work&lt;/p&gt;
&lt;p&gt;Printf return errors : 0, 0, 4&lt;/p&gt;
&lt;p&gt;also i have no idea how to mark code as one piece, welcome help&lt;/p&gt;
&lt;p&gt;&amp;lt;code=c&amp;gt;&lt;/p&gt;
&lt;p&gt;static void services_init(void)
{
// YOUR_JOB: Add code to initialize the services used by the application.
uint32_t                           err_code;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_nus_init_t nus_init;

memset(&amp;amp;nus_init, 0, sizeof(nus_init));

  nus_init.data_handler = nus_data_handler;

err_code = ble_nus_init(&amp;amp;m_nus, &amp;amp;nus_init);
	printf(&amp;quot;Error: %d&amp;quot;, err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;//    APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Initialize Device Information Service.

ble_dis_init_t dis_init;
	
	memset(&amp;amp;dis_init, 0, sizeof(dis_init));

ble_srv_ascii_to_utf8(&amp;amp;dis_init.manufact_name_str, (char *)MANUFACTURER_NAME);

err_code = ble_dis_init(&amp;amp;dis_init);
	printf(&amp;quot;Error: %d&amp;quot;, err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;//    APP_ERROR_CHECK(err_code);
#ifdef BLE_DFU_APP_SUPPORT
/** @snippet [DFU BLE Service initialization] */
ble_dfu_init_t   dfus_init;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Initialize the Device Firmware Update Service.
memset(&amp;amp;dfus_init, 0, sizeof(dfus_init));

dfus_init.evt_handler   = dfu_app_on_dfu_evt;
dfus_init.error_handler = NULL;
dfus_init.evt_handler   = dfu_app_on_dfu_evt;
dfus_init.revision      = DFU_REVISION;

err_code = ble_dfu_init(&amp;amp;m_dfus, &amp;amp;dfus_init);
	printf(&amp;quot;Error: %d&amp;quot;, err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;//    APP_ERROR_CHECK(err_code);&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;dfu_app_reset_prepare_set(reset_prepare);
dfu_app_dm_appl_instance_set(m_app_handle);
/** @snippet [DFU BLE Service initialization] */
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;#endif // BLE_DFU_APP_SUPPORT
}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27362?ContentTypeID=1</link><pubDate>Mon, 03 Aug 2015 11:59:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95556fcc-ee70-4832-8ad0-6753c577986a</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@la-ble: Could you sum up what the issue you are having now?  I&amp;#39;m kind of lost. Why do you want to do add DFU service when you don&amp;#39;t flash the bootloader. How do you jump to the bootloader ? via a soft reset or a branching ?&lt;/p&gt;
&lt;p&gt;If possible please zip your project and update the file here. Also please don&amp;#39;t mark the answer as correct when it has not fixed your issue.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27361?ContentTypeID=1</link><pubDate>Sun, 02 Aug 2015 23:51:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c6efb87-be03-4509-b63d-d7d1ca428538</guid><dc:creator>la-ble</dc:creator><description>&lt;p&gt;@HungBui, Master Control Panel is a really useful tool, thank you.  Have it on PC now with PCA10000.  0x000E appears to be the handle for UART RX (from PC to nRF51822).  I&amp;#39;ve updated the OP with a screenshot of all the data I can capture.  There seems to be a conflict for pathway used to kick the firmware back to the bootloader (reset).  In another trial (sporatically working) the UART RX characteristic has value 0x0016 and the DFU ClientCharacteristicConfiguration has handle value 0x000E.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27359?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2015 08:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:085afde8-ba64-41e1-94d7-b9525bf8b0bb</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@la-ble: I meant Master Control Panel tool on PC, you would need a nRF51 dongle/dk to use it. Which central device are you testing now ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27360?ContentTypeID=1</link><pubDate>Thu, 16 Jul 2015 05:15:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57f6ecda-2e03-4bf5-8fdc-3bb64473b032</guid><dc:creator>la-ble</dc:creator><description>&lt;p&gt;@HungBui, I do not have an Android device.  Is there any to proceed without one?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27358?ContentTypeID=1</link><pubDate>Tue, 23 Jun 2015 13:45:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b70c546-25f2-4385-adc1-e5120ab7bdfd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;The &lt;code&gt;p_evt_write&lt;/code&gt; I mentioned is exactly the p_evt_write you used in &amp;quot;p_evt_write-&amp;gt;handle == p_nus-&amp;gt;tx_handles.value_handle 0x000E != 0x0016.&amp;quot;&lt;/p&gt;
&lt;p&gt;Could you check what characteristic is at handle 0x000E ?  You can find the handle using the Master Control Panel tool we have on PC. Note that you should add the breakpoint only after the CCCD has been enabled. When enabling CCCDs we also use write commands, so you will also have the BLE_GATTS_EVT_WRITE event for those commands.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27357?ContentTypeID=1</link><pubDate>Tue, 23 Jun 2015 05:41:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:22bf87d0-258d-4dce-bc95-1452b4aefd0f</guid><dc:creator>la-ble</dc:creator><description>&lt;p&gt;Is it better practice to execute &lt;code&gt;ble_dfu_on_ble_evt&lt;/code&gt; before anything else?  I&amp;#39;ve tried both with no difference.  If I breakpoint just after &lt;code&gt;ble_dfu_on_ble_evt&lt;/code&gt; my &lt;code&gt;.evt_handler&lt;/code&gt; and &lt;code&gt;.data_handler&lt;/code&gt; are correctly hooked up to my callback functions.  I&amp;#39;m not sure what you mean by &lt;code&gt;p_evt_write&lt;/code&gt;.  I&amp;#39;m running SD v8.0.0. and do NOT have a bootloader in place right now as I develop/debug.  On line 73 of ble_nus.c, the check isn&amp;#39;t succeeding which allows the callback to be executed: &lt;code&gt;p_evt_write-&amp;gt;handle == p_nus-&amp;gt;tx_handles.value_handle&lt;/code&gt;  0x000E != 0x0016.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ble_dfus WITH ble_nus</title><link>https://devzone.nordicsemi.com/thread/27356?ContentTypeID=1</link><pubDate>Mon, 22 Jun 2015 11:34:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e86ea5d0-2e5e-4d5d-9b61-e8aeeee7a939</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@la-ble: It&amp;#39;s pretty strange what you experienced. I can see in your code ble_nus_on_ble_evt() is called before ble_dfu_on_ble_evt().&lt;/p&gt;
&lt;p&gt;Could you add a breakpoint in ble_nus_on_ble_evt() at BLE_GATTS_EVT_WRITE event to check if the write command is correctly executed? There will be 2 write event, first is the one to set CCCD (only happens once), after that will be the write command for the actual data, checkout the p_evt_write-&amp;gt;handle when the event arrives.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>