NordicSemiconductor / Flutter-nRF-Connect-Device-Manager

A Flutter plugin for McuMgr libraries for Android and iOS.
BSD 3-Clause "New" or "Revised" License
36 stars 17 forks source link

No way to soft reset the device after transferring image done #43

Closed ptienchuan closed 10 months ago

ptienchuan commented 1 year ago

Hi development team,

I have no idea how to soft reset the device after transferring image done when using this package. Please tell me:

Env:

philips77 commented 10 months ago

Hello, The protocol for updating devices using McuManager over SMP protocol is using the following commands:

You may also choose a "mode" of the DFU: Test & Confirm, Test Only, Confirm Only or Upload Only. In all of them the Reset command is sent, which should reset the device. In Test & Confirm mode, after the device resets the library will reconnect to it and send Confirm command. There won't be another Reset command sent after that. Other 3 modes finish after sending Reset.

ptienchuan commented 10 months ago

@philips77 Thanks for your response. Could you tell me how to choose "mode" ?

NickKibish commented 10 months ago

Hi @ptienchuan,

You can set FirmwareUpgradeConfiguration in the update method in UpdateManager.

final updateManager = await _updateManagerFactory
        .getUpdateManager(request.peripheral!.identifier);

    updateManager.setup();
    updateManager.update(
      request.firmwareImages!,
      configuration: FirmwareUpgradeConfiguration(
        // firmwareUpgradeMode: FirmwareUpgradeMode.confirmOnly,
        // firmwareUpgradeMode: FirmwareUpgradeMode.testAndConfirm,
        // firmwareUpgradeMode: FirmwareUpgradeMode.testOnly,
        // firmwareUpgradeMode: FirmwareUpgradeMode.uploadOnly,
      ),
    );