This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Android 6 Master Control Panel Bonded DFU + Android 6 gets stuck in a loop

I'm not sure why I didn'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 in a loop. It never attempts to trigger the switch to the bootloader.

However if I manually write the start command to the DFU control point, everything works just fine.

Android 5.1.1 on a Nexus 4 works just fine.

master-control-panel-log.txt or: gist.github.com/.../a51e30a8a41d5f02bb3c

  • 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'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't remember).

  • That apk fixes the problem in the nRF Toolbox. I was able to upload firmware from a non-bonded device without a crash.

    While on the topic of crashing :-) I get a number of different nRF Master Control panel crashes as well:

    Something that looks like the bug above:

    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)
    

    Along with:

    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)
    

    No clue what I was doing when that crash occurred.

Related