<?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>Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10286/android-6-master-control-panel-bonded-dfu-android-6-gets-stuck-in-a-loop</link><description>I&amp;#39;m not sure why I didn&amp;#39;t notice this sooner. 
 When trying to do a bonded DFU with a Nexus 6P and Master Control Panel it seems to get stuck in a loop reconnecting. 
 I connect, bond and trigger a DFU and then MCP disconnects, reconnects, disconnects</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 19 Nov 2015 07:50:32 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10286/android-6-master-control-panel-bonded-dfu-android-6-gets-stuck-in-a-loop" /><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38169?ContentTypeID=1</link><pubDate>Thu, 19 Nov 2015 07:50:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5d44a4d-e258-4ae5-a24b-6915a87151ea</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;That apk fixes the problem in the nRF Toolbox. I was able to upload firmware from a non-bonded device without a crash.&lt;/p&gt;
&lt;p&gt;While on the topic of crashing :-) I get a number of different nRF Master Control panel crashes as well:&lt;/p&gt;
&lt;p&gt;Something that looks like the bug above:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;11-10 19:06:56.707 18218 21775 E AndroidRuntime: FATAL EXCEPTION: IntentService[DfuBaseService]
11-10 19:06:56.707 18218 21775 E AndroidRuntime: Process: no.nordicsemi.android.mcp, PID: 18218
11-10 19:06:56.707 18218 21775 E AndroidRuntime: java.lang.NullPointerException: Attempt to get length of null array
11-10 19:06:56.707 18218 21775 E AndroidRuntime:        at android.bluetooth.BluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.java:445)
11-10 19:06:56.707 18218 21775 E AndroidRuntime:        at no.nordicsemi.android.dfu.DfuBaseService.readVersion(DfuBaseService.java:2187)
11-10 19:06:56.707 18218 21775 E AndroidRuntime:        at no.nordicsemi.android.dfu.DfuBaseService.onHandleIntent(DfuBaseService.java:1339)
11-10 19:06:56.707 18218 21775 E AndroidRuntime:        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
11-10 19:06:56.707 18218 21775 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
11-10 19:06:56.707 18218 21775 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
11-10 19:06:56.707 18218 21775 E AndroidRuntime:        at android.os.HandlerThread.run(HandlerThread.java:61)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Along with:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;11-13 16:59:20.338  6283  6283 E AndroidRuntime: FATAL EXCEPTION: main
11-13 16:59:20.338  6283  6283 E AndroidRuntime: Process: no.nordicsemi.android.mcp, PID: 6283
11-13 16:59:20.338  6283  6283 E AndroidRuntime: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.support.v4.app.FragmentManagerImpl.checkStateLoss(FragmentManager.java:1377)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.support.v4.app.FragmentManagerImpl.enqueueAction(FragmentManager.java:1395)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.support.v4.app.BackStackRecord.commitInternal(BackStackRecord.java:637)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.support.v4.app.BackStackRecord.commit(BackStackRecord.java:616)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at no.nordicsemi.android.mcp.scanner.connection.ConnectedDevicesActivity.onItemSelected(ConnectedDevicesActivity.java:161)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.widget.AdapterView.fireOnSelected(AdapterView.java:931)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.widget.AdapterView.dispatchOnItemSelected(AdapterView.java:920)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.widget.AdapterView.-wrap1(AdapterView.java)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.widget.AdapterView$SelectionNotifier.run(AdapterView.java:890)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.os.Handler.handleCallback(Handler.java:739)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:95)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at android.app.ActivityThread.main(ActivityThread.java:5417)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at java.lang.reflect.Method.invoke(Native Method)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
11-13 16:59:20.338  6283  6283 E AndroidRuntime:        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;No clue what I was doing when that crash occurred.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38168?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 13:05:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:90c061d4-7637-4bd6-a115-be09f5457019</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;One more thing. Since some time the DFU lib waits 1 second before it start connecting to the target. Also it waits after switching from app to bootloader mode. Maybe that&amp;#39;s why it does not end up in a loop, like MCP does (the current version of MCP was release some time ago and may not have this delay implemented, I don&amp;#39;t remember).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38167?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 13:02:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da35f4c6-357e-4d29-9498-2baeb7eed0c1</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi, I&amp;#39;ve managed to fix the bug now. The app should be on Google Play soon, it&amp;#39;s already available on github &lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Toolbox/releases"&gt;github.com/.../releases&lt;/a&gt;. I&amp;#39;ve published new version of the DFU library on both GitHub: &lt;a href="https://github.com/NordicSemiconductor/Android-DFU-Library"&gt;github.com/.../Android-DFU-Library&lt;/a&gt; and jcenter. New version is 0.6.1. Could you please test it?
The new version of nRF Master Control Panel will also have the newest version of this lib when released (couple of weeks, I&amp;#39;m doing my best).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38166?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 10:46:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1bd9cefd-bdbd-4ef0-9af6-8e9bf464a689</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi, I managed to crashed the nRF Toolbox the way you described. I&amp;#39;ll fix the app asap.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38176?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 07:21:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e82eb513-5b7e-45f1-b9b7-25dc094f9c67</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;Yeah my DFU stuff requires bonding. It dies after entering the pin. The bond is created, so it tends to work the second time I try or if the bond was already present.&lt;/p&gt;
&lt;p&gt;Yes, my device is in developer mode and no I do not get anything other then a &amp;quot;Ok&amp;quot; in the crash dialog. There is absolutely no way I would submit a full android bug report form my personal device, those bug reports leak way to much personal data. Sadly, I don&amp;#39;t have any Android test only devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38175?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 07:16:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd00994f-3603-48a6-9b0d-01b737e2dcbc</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;BTW, if you tap Build Version in Android settings 7 times you&amp;#39;ll enable the Developer Settings (also in Android settings). There is a chance that you&amp;#39;ll then have a Report button next to OK. But the log you posted is enough, I&amp;#39;d get the same from Google play console.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38174?ContentTypeID=1</link><pubDate>Wed, 18 Nov 2015 07:13:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:104f1fcf-4c43-4f32-9a5e-73b9164eaf23</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Thanks! You&amp;#39;re saying this happen when your device needs bonding with pin. And also I understand it triggers bonding when the service wants to read the DFU Version characteristic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38173?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 23:15:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25c424ee-da3e-4f12-877b-d4f7f962d11b</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;FYI, the dialog box just say &amp;quot;Ok&amp;quot;, there is no option to report the bug. The above was pulled from an Android bug report.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38172?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 23:10:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78461128-9818-4377-8105-78d2f968d5fa</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;This should be the most recent crash:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;11-17 17:41:52.737 28845 28862 I BluetoothBondStateMachine: bondStateChangeCallback: Status: 0 Address: E0:4B:75:64:34:DE newState: 2
11-17 17:41:52.737 28845 28878 I bt_bta_dm: bta_dm_gatt_disc_result service_id_uuid_len=2   
11-17 17:41:52.738 28845 28878 I bt_bta_dm: bta_dm_gatt_disc_result service_id_uuid_len=2
11-17 17:41:52.738 28845 28878 I bt_bta_dm: bta_dm_gatt_disc_result service_id_uuid_len=16
11-17 17:41:52.738 28845 28878 I bt_bta_dm: bta_dm_gatt_disc_result service_id_uuid_len=2
11-17 17:41:52.738 28845 28869 D BluetoothAdapterProperties: Adding bonded device:E0:4B:75:64:34:DE
11-17 17:41:52.738 28845 28878 I bt_bta_dm: bta_dm_gatt_disc_result service_id_uuid_len=2
11-17 17:41:52.738 28845 28878 I bt_bta_dm: bta_dm_gatt_disc_result service_id_uuid_len=16
11-17 17:41:52.739 28845 28869 I BluetoothBondStateMachine: Bond State Change Intent:E0:4B:75:64:34:DE OldState: 11 NewState: 12
11-17 17:41:52.739 28845 28869 I BluetoothBondStateMachine: StableState(): Entering Off State
11-17 17:41:52.740 24976 29192 E AndroidRuntime: FATAL EXCEPTION: IntentService[DfuBaseService]
11-17 17:41:52.740 24976 29192 E AndroidRuntime: Process: no.nordicsemi.android.nrftoolbox, PID: 24976
11-17 17:41:52.740 24976 29192 E AndroidRuntime: java.lang.NullPointerException: Attempt to get length of null array
11-17 17:41:52.740 24976 29192 E AndroidRuntime:        at android.bluetooth.BluetoothGattCharacteristic.getIntValue(BluetoothGattCharacteristic.java:445)
11-17 17:41:52.740 24976 29192 E AndroidRuntime:        at no.nordicsemi.android.dfu.DfuBaseService.readVersion(DfuBaseService.java:2218)
11-17 17:41:52.740 24976 29192 E AndroidRuntime:        at no.nordicsemi.android.dfu.DfuBaseService.onHandleIntent(DfuBaseService.java:1370)
11-17 17:41:52.740 24976 29192 E AndroidRuntime:        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:66)
11-17 17:41:52.740 24976 29192 E AndroidRuntime:        at android.os.Handler.dispatchMessage(Handler.java:102)
11-17 17:41:52.740 24976 29192 E AndroidRuntime:        at android.os.Looper.loop(Looper.java:148)
11-17 17:41:52.740 24976 29192 E AndroidRuntime:        at android.os.HandlerThread.run(HandlerThread.java:61)
11-17 17:41:52.741  6178  6444 W BluetoothEventManager: CachedBluetoothDevice for device E0:4B:75:64:34:DE not found, calling readPairedDevices().
11-17 17:41:52.743 24220 24220 W BluetoothEventManager: CachedBluetoothDevice for device E0:4B:75:64:34:DE not found, calling readPairedDevices().
11-17 17:41:52.743  4556  6650 W ActivityManager:   Force finishing activity no.nordicsemi.android.nrftoolbox/.dfu.DfuActivity
11-17 17:41:52.774 28845 28862 I bt_btif_gatt: set_read_value unformat.len = 2
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38171?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 22:28:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59b1cf40-06bc-4e61-a4da-4dbb6654c107</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi, yes, we&amp;#39;ve tested it with Nexus 9 and 6, both with Android 6. Could you report the crash using the Unfortunately, ... dialog box? I&amp;#39;ll have a look at it tomorrow.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38170?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 22:10:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36668d49-c30a-45c8-bbd0-d7b930613446</guid><dc:creator>Clem Taylor</dc:creator><description>&lt;p&gt;MCP is never attempting to issue the start command, it is just disconnecting and reconnecting. The device side is happily accepting connections. When I manually do the write to DFU control point it is properly switching to bootloader mode (passing bond data and cleanly disconnecting). I&amp;#39;m not sure what you mean by giving more time to the device to setup, it can&amp;#39;t reconnect until the device starts advertising and it doesn&amp;#39;t start advertising until is is ready to go.&lt;/p&gt;
&lt;p&gt;The 6p just happens to be the only device I have with Android 6, I&amp;#39;d imagine that the same issue would happen with other devices with Android 6. The BLE hardware on the Nexus 6P is fairly standard for current android devices. Has Nordic tested MCP DFU with Android 6 on any recent device?&lt;/p&gt;
&lt;p&gt;I did manage to get the nRF toolbox to work, but it really likes to die with &amp;#39;Unfortunately, nRF Toolbox has stopped&amp;#39;. nRF toolbox does not start out connected, it connects, does the CCCD write and then writes the &amp;#39;start&amp;#39; DFU command. The device switches to bootloader mode, starts advertising, and the toolbox reconnects. From sending the &amp;#39;start command&amp;#39; to reconnecting is ~1.5s.&lt;/p&gt;
&lt;p&gt;The nRF toolbox crash seems to be related to having to bond to trigger the switch to DFU mode. It likes to die after I enter the pin. If I try a second time, Android remembers the bond and it the DFU upload works.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop</title><link>https://devzone.nordicsemi.com/thread/38165?ContentTypeID=1</link><pubDate>Tue, 17 Nov 2015 13:11:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:726a7c2b-d7cc-44d0-9280-889ed82c9da8</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hi, the reason thy it gets in a loop is that the DFU Version is always read as 0.1, which means that that&amp;#39;s the application mode, not the bootloader mode. If it works when you manually write the start command, it means that the chip restarts after it disconnects, and does not start the DFU mode at all (or does, but immediately resets afterwards). The question is why..? I&amp;#39;m not quite sure. Nexus 4 sends just 1 packet each connection interval so it&amp;#39;s very slow. Maybe it gives more time to the device to set itself up. We don&amp;#39;t have the 6P yet, so it&amp;#39;s hard to test, but it&amp;#39;s a metter of time only.&lt;/p&gt;
&lt;p&gt;Did you try the DFU with nRF Toolbox? It has a slightly newer version of the DFU library... There is a small chance it would work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>