<?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>Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/90744/failure-on-dfu-process-android</link><description>Dear Support Team, 
 
 We are encountering an issue when trying to flash the firmware of our B810 smart tag using the Android DFU Library ( https://github.com/NordicSemiconductor/Android-DFU-Library ) version ‘ no.nordicsemi.android:dfu:1.11.1’ from a</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 14 Dec 2022 14:55:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/90744/failure-on-dfu-process-android" /><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/400669?ContentTypeID=1</link><pubDate>Wed, 14 Dec 2022 14:55:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01ed7444-e0a6-4842-b790-f9938befc6d7</guid><dc:creator>Carmelo Ruota</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/afnowakowski"&gt;Aleksander Nowakowski&lt;/a&gt;&amp;nbsp;&lt;br /&gt;Unfortunately, changing the reboot time as you described didn&amp;#39;t work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/400078?ContentTypeID=1</link><pubDate>Mon, 12 Dec 2022 09:28:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7cdb0c62-0b00-496d-aa7b-3155c3d3fd00</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;From the logs I see that the device needs ~12 seconds to reboot and start advertising directly. Did you try setting the reboot time using &lt;a href="https://github.com/NordicSemiconductor/Android-DFU-Library/blob/38dad6229fa949dca090cfc8a65aa26f0e4ea7f9/lib_dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java#L299"&gt;https://github.com/NordicSemiconductor/Android-DFU-Library/blob/38dad6229fa949dca090cfc8a65aa26f0e4ea7f9/lib_dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java#L299&lt;/a&gt; ? So that the following connection is delayed until the device is &amp;quot;for sure disconnected&amp;quot;. You may set it to 15 sec, or something like.&lt;/p&gt;
&lt;p&gt;Also, do you know why it takes so long for it to reboot? Is it expected?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/400075?ContentTypeID=1</link><pubDate>Mon, 12 Dec 2022 09:14:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ccab27d-02f5-4244-8002-bf5871d82040</guid><dc:creator>Carmelo Ruota</dc:creator><description>&lt;p&gt;Hi, any update?&lt;/p&gt;
&lt;p&gt;From our side, no further progresses.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/397282?ContentTypeID=1</link><pubDate>Wed, 23 Nov 2022 20:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10ca085f-8d53-44e4-9233-011a02e9d911</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;I&amp;#39;ll look at the traces tomorrow. You may also try initiating dfu majorally on the phone where it works and trying to connect on the device under test.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/396174?ContentTypeID=1</link><pubDate>Thu, 17 Nov 2022 10:51:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6803c854-8f63-4e70-83a2-a437ef64c4ff</guid><dc:creator>Carmelo Ruota</dc:creator><description>&lt;p&gt;Hi Aleksander, we tried as you described with the following steps:&lt;br /&gt;- from NrFConnect app we connected to the BLE device starting the DFU process writing on the characteristic&lt;br /&gt;- then, the BLE device is rebooted waiting for &amp;quot;someone&amp;quot; to connect&lt;br /&gt;- trying to connect to the BLE we wasn&amp;#39;t able to connect&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Trying the same process from another phone the process was ok&lt;br /&gt;&lt;br /&gt;I&amp;#39;ve attached both logs.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/0486.manual_5F00_fota_5F00_KO.pcapng"&gt;devzone.nordicsemi.com/.../0486.manual_5F00_fota_5F00_KO.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8814.manual_5F00_fota_5F00_OK.pcapng"&gt;devzone.nordicsemi.com/.../8814.manual_5F00_fota_5F00_OK.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/394234?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2022 16:53:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b03ea936-ac7b-45ec-bcdd-314229e02753</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Try repeating the initial steps using nRF Connect for Android on those phones that done work. But manually. Connect, enable notifications and send Dfu Start command. This should trigger notification and disconnection. When finally does, try to reconnect and see it that works during those 30 sec of direct advertising.&lt;/p&gt;
&lt;p&gt;If possible, please provide the logs.&lt;/p&gt;
&lt;p&gt;Have a good weekend!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/394225?ContentTypeID=1</link><pubDate>Fri, 04 Nov 2022 15:21:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11a7e66b-984d-4e32-9a7b-8d0b5b0f10ea</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Thank you for sending the log, I may have a clue now.&lt;/p&gt;
&lt;p&gt;You&amp;#39;re using Legacy DFU. In the default implementation of Legacy DFU the bootloader, after switching from app mode, starts advertising with Direct Advertising using the same MAC address.&lt;/p&gt;
&lt;p&gt;In frame 170 the app sends &amp;quot;Jump to bootloader&amp;quot; command (0x0104). This should be replied with a notification 0x0601, but I don&amp;#39;t see that in the sniffer logs. That&amp;#39;s issue number 1.&lt;/p&gt;
&lt;p&gt;Instead of rebooting (Issue number 2) to the bootloader mode immediately, the device holds connection to the phone for next 12 seconds until frame 206, when it finally sends LL_TERMINATE_IND:&lt;/p&gt;
&lt;p&gt;Error Code: Remote User Terminated Connection (0x13)&lt;/p&gt;
&lt;p&gt;Here how it looks from Android side (your listing Samsung S9 2nd attempt):&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;// Android sends &amp;quot;Jump to bootlaoder command&amp;quot;
A 16:20:42.295 [DFU] Jump to bootloader sent (Op Code = 1, Upload Mode = 4)

// It doesn&amp;#39;t wait for the notification (no reason to, disconnects instead)
D 16:20:42.295 [DFU] gatt.refresh() (hidden)
D 16:20:42.312 [DFU] gatt.disconnect()
D 16:20:42.312 [DFU] gatt.close()

// And restarts hoping to connect to bootlaoder mode
V 16:20:42.345 [DFU] DFU service started
I 16:20:42.345 [DFU] Firmware file opened successfully
D 16:20:42.345 [DFU] wait(1000)
D 16:20:43.331 [DFU] wait(1000)
V 16:20:44.346 [DFU] Connecting to DFU target...
D 16:20:44.347 [DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)

// The library gets CONNECTED state, as... the device is still connected here (didn&amp;#39;t reboot)
I 16:20:44.368 [DFU] Connected to FF:EC:FF:FE:CE:66
V 16:20:44.368 [DFU] Discovering services...
D 16:20:44.368 [DFU] gatt.discoverServices()

// Here Android does something weird. 
// Usually, before service discovery it switches to 7.5 ms interval, so it tires to,
// but as it&amp;#39;s in a weird state, no such packet is sent.
I 16:20:45.091 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)

// Finally, the termination sent from the slave is received.
D 16:20:54.868 [Callback] Connection state changed with status: 19 and new state: DISCONNECTED (0)
W 16:20:54.869 Connection terminated by peer (status 19)
I 16:20:54.869 Disconnected
E 16:20:54.979 [DFU] Connection failed (0x13): GATT CONN TERMINATE PEER USER&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The termination matches one sent from the device (0x13).&lt;/p&gt;
&lt;p&gt;Then, 5 seconds later, the device begins advertising directly for 30 seconds.&lt;/p&gt;
&lt;p&gt;DFU library tries to connect twice and fails (Issue number 3, the main one). There may be different reasons for the failure. Most probably, it is related to how Android started reacting to Direct advertising. Have a look at: &lt;a href="https://github.com/NordicSemiconductor/Android-DFU-Library/blob/38dad6229fa949dca090cfc8a65aa26f0e4ea7f9/lib_dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java#L334"&gt;https://github.com/NordicSemiconductor/Android-DFU-Library/blob/38dad6229fa949dca090cfc8a65aa26f0e4ea7f9/lib_dfu/src/main/java/no/nordicsemi/android/dfu/DfuServiceInitiator.java#L334&lt;/a&gt; and &lt;a id="" href="https://github.com/NordicSemiconductor/IOS-DFU-Library/pull/374"&gt;https://github.com/NordicSemiconductor/IOS-DFU-Library/pull/374&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Some phones, as we observed, don&amp;#39;t respond to direct advertising correctly, they don&amp;#39;t connect to it. The solution was to modify the bootloader to use +1 address instead and ADV_IND, not ADV_DIRECT_IND. Then you&amp;#39;d have to set the flag from the first link to make the app scan for a new address after switching to bootloader mode. You may try it if you have a way to trigger dfu mode with a button. Then it should be using normal advertising, as no data are passed from the app, I think.&lt;/p&gt;
&lt;p&gt;Also, investigate why the device does not reboot properly just after switching to bootloader mode. Perhaps this is the root cause?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/392857?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 13:45:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9088925f-484b-4b2e-96b3-f246eac7228a</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;We cannot find&amp;nbsp;&lt;span&gt;anything interesting there. That&amp;#39;s why we ask for the ble sniffer log.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/392854?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 13:38:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4323e5c4-89c2-458d-810f-e955a695905b</guid><dc:creator>Carmelo Ruota</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/amanda"&gt;Amanda Hsieh&lt;/a&gt;&amp;nbsp;we&amp;#39;re trying to retrieve a dongle in order to sniff BLE traffic. In the meantime, is the attachment&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/btsnoop_5F00_hci_5F00_202209131717.cfa"&gt;btsnoop_hci_202209131717.cfa&lt;/a&gt;&amp;nbsp;enough for the analysis?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/392843?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 13:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bffaf61a-8bf2-4b9f-8071-d323b61508d2</guid><dc:creator>Amanda Hsieh</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please provide a &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Sniffer-for-Bluetooth-LE"&gt;ble sniffer&lt;/a&gt; log as&amp;nbsp;&lt;span&gt;Aleksander required.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;-Amanda&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/392754?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 07:48:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e0113bd-f5f7-40f5-ad92-2c9d13d37585</guid><dc:creator>Carmelo Ruota</dc:creator><description>&lt;p&gt;Hi Aleksander, do you have any updates&amp;nbsp;regarding the latest information we have provided?&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/386115?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 09:10:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8b710ef-0c10-4e6e-b541-0f4386890348</guid><dc:creator>Carmelo Ruota</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;we retried a test on Samsung S9 and recovered the hci logs from the smartphone. The device&amp;#39;s address we tried to put in DFU for the test case is&amp;nbsp;DC:95:CC:CE:BF:9E, attached the logs.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/btsnoop_5F00_hci_5F00_202209131717.cfa"&gt;devzone.nordicsemi.com/.../btsnoop_5F00_hci_5F00_202209131717.cfa&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/382721?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 13:59:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:816b09df-2291-4c40-bd2b-ef0942f62e0c</guid><dc:creator>Carmelo Ruota</dc:creator><description>&lt;p&gt;Hi Aleksander, The nRF5 SDK version is&amp;nbsp;10.0.0&lt;br /&gt;I&amp;#39;m going to try to use a sniffer log hoping to get back to you with details.&lt;/p&gt;
&lt;p&gt;Regarding the bluetooth, we restarted it and also the phone.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for your support.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/382099?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 16:32:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:84fc2850-5a21-4eae-be3d-ea01e585a038</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Which nRF5 SDK is your fw based on?&lt;/p&gt;
&lt;p&gt;Did you try a different Samsung S9 phone? Does it work sometimes, or never on this phone? Did you try restarting Bluetooth or the phone?&lt;/p&gt;
&lt;p&gt;A sniffer log could be helpful, but if the lib works on most phones, but fails on some, most probably it&amp;#39;s an issue with that phone, but the library. There may be some workarounds, that can be done, but that&amp;#39;s not always possible. Anyway, replicating it on our side would also help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/382098?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 15:53:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eae52ab2-8026-44c5-a795-ab1f65a1419f</guid><dc:creator>Carmelo Ruota</dc:creator><description>&lt;p&gt;It seems that also the library version 2.1.0 doesn&amp;#39;t fix the issue&amp;nbsp;&lt;br /&gt;Trying on Samsung Galaxy S9, we obtain the same error reported. What I can provide in order to deeply analyze?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Failure on DFU process (Android)</title><link>https://devzone.nordicsemi.com/thread/380589?ContentTypeID=1</link><pubDate>Mon, 08 Aug 2022 11:44:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d573891a-c5a8-4c14-97ff-d7cd7a9e0091</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I think I may know why this issue happens. I&amp;#39;ll was about to release a new version of the library (2.1.0), which should solve your issue.&lt;/p&gt;
&lt;p&gt;The issue has been introduced here: &lt;a id="" href="https://github.com/NordicSemiconductor/Android-DFU-Library/pull/319"&gt;https://github.com/NordicSemiconductor/Android-DFU-Library/pull/319&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In order to improve reconnection speed I removed awaiting disconnection. However, this should only be removed for devices that change the MAC address in bootloader mode. If the bootloader uses the same MAC, like in your case, or in Secure DFU when the device uses Buttonless Service with Bonds, the phone has to await disconnection, or will use the same connection instead even before it closes. Then it goes into a weird state and starts throwing 133 (0x85).&lt;/p&gt;
&lt;p&gt;Please, check version 2.1 when it&amp;#39;s out.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>