DFU update with custom application

I am trying to do the dfu update in my custom flutter application like it does in the nrf connect application. My device is correctly being put in bootloader mode and the update is working fine in the nrf connect app. I have tried to use the nordic_dfu package from flutter to update the dfu but I kept getting the error message "[DFU] Buttonless DFU characteristic not found!" when doing start dfu, but the device was correctly in the dfu bootloader mode. After that I have also tried to use mcumgr_flutter package but I am getting the following error every time: "MissingPluginException(No implementation found for method getPlatformVersion on channel mcumgr_flutter/method_channel)" and basically the only solution that I have found for that issue is to clean and get the libraries again and restart the app which have also not worked. Is there another way that I could do the dfu update from my custom application? Or maybe a solution to one of my issues with any of the previous packages that I mentioned I used? Thanks in advance!

Parents
  • Hello!

    If your device is based on nRF5 SDK and you are using Legacy DFU (SDK v4.3-11) or Secure DFU (SDK v12-17.x) you should use `nordic_dfu` package. The `mcumgr_flutter` supports SMP protocol, which is used in nRF Connect SDK and Zephyr. The fact that you say, that your device is put to bootlaoder mode suggests that you're using nRF5 SDK, in some version.

    Could you please paste here logs from nRF Connect for Android gathered during successful DFU operation?

  • Good morning!
    I think that the SDK is in fact nRF5 SDK. I got the log of doing the DFU operation on nRF Connect for Android and I have attached the txt with it.

    nRF Connect, 2025-05-08
    New Sura Basic 000 (DA:FA:AF:24:60:EF)
    V	08:46:16.463	Connecting to DA:FA:AF:24:60:EF...
    D	08:46:16.463	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	08:46:17.605	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	08:46:17.605	Connected to DA:FA:AF:24:60:EF
    V	08:46:17.606	Discovering services...
    D	08:46:17.606	gatt.discoverServices()
    D	08:46:17.646	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	08:46:18.033	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	08:46:18.356	[Callback] Services discovered with status: 0
    I	08:46:18.356	Services discovered
    V	08:46:18.365	Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    - Client Supported Features [R W] (0x2B29)
    - Database Hash [R] (0x2B2A)
    Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
    - Button [N R] (00001524-1212-efde-1523-785feabcd123)
       Client Characteristic Configuration (0x2902)
    - LED [W] (00001525-1212-efde-1523-785feabcd123)
    SMP Service (8d53dc1d-1db7-4cd3-868b-8a527460aa84)
    - SMP Characteristic [N WNR] (da2e7828-fbce-4e01-ae9e-261174997c48)
       Client Characteristic Configuration (0x2902)
    D	08:46:18.365	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	08:46:18.370	gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
    I	08:46:18.420	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
    I	08:46:22.922	Connection parameters updated (interval: 40.0ms, latency: 0, timeout: 420ms)
    V	08:47:18.239	[McuMgr] Connecting...
    D	08:47:18.245	[McuMgr] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, LE 1M)
    D	08:47:18.304	[McuMgr] [Callback] Connection state changed with status: 0 and new state: 2 (CONNECTED)
    I	08:47:18.307	[McuMgr] Connected to DA:FA:AF:24:60:EF
    D	08:47:18.316	[McuMgr] wait(300)
    V	08:47:18.619	[McuMgr] Discovering services...
    D	08:47:18.626	[McuMgr] gatt.discoverServices()
    I	08:47:18.640	[McuMgr] Services discovered
    V	08:47:18.645	[McuMgr] Primary service found
    V	08:47:18.649	[McuMgr] Requesting new MTU...
    D	08:47:18.653	[McuMgr] gatt.requestMtu(498)
    I	08:47:18.699	[McuMgr] MTU changed to: 498
    D	08:47:18.704	[McuMgr] gatt.setCharacteristicNotification(da2e7828-fbce-4e01-ae9e-261174997c48, true)
    V	08:47:18.709	[McuMgr] Enabling notifications for da2e7828-fbce-4e01-ae9e-261174997c48
    D	08:47:18.711	[McuMgr] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
    I	08:47:18.840	[McuMgr] Data written to descr. 00002902-0000-1000-8000-00805f9b34fb
    V	08:47:18.845	[McuMgr] Waiting for value change...
    V	08:47:18.849	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:47:18.852	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x000000010000FF06A0, WRITE COMMAND)
    I	08:47:18.865	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:47:18.930	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 01-00-00-19-00-00-FF-06-BF-68-62-75-66-5F-73-69-7A-65-19-09-AB-69-62-75-66-5F-63-6F-75-6E-74-04-FF
    I	08:47:18.934	[McuMgr] Wait for value changed complete
    A	08:47:18.937	[McuMgr] Received Header (Version: 0, Op: 1, Flags: 0, Len: 25, Group: 0, Seq: 255, Command: 6) CBOR {"buf_size":2475,"buf_count":4}
    I	08:47:18.942	[McuMgr] SMP reassembly supported with buffer size: 2475 bytes and count: 4
    V	08:47:18.945	[McuMgr] Requesting connection priority: HIGH (11.25–15ms, 0, 5s)...
    D	08:47:18.948	[McuMgr] gatt.requestConnectionPriority(HIGH)
    A	08:47:18.959	[McuMgr] Sending (9 bytes) Header (Version: 1, Op: 0, Flags: 0, Len: 1, Group: 0, Seq: 0, Command: 8) CBOR {}
    V	08:47:19.156	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:47:19.163	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0800000100000008A0, WRITE COMMAND)
    I	08:47:19.181	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:47:19.241	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 09-00-00-15-00-00-00-08-BF-6A-62-6F-6F-74-6C-6F-61-64-65-72-67-4D-43-55-62-6F-6F-74-FF
    A	08:47:19.246	[McuMgr] Received Header (Version: 1, Op: 1, Flags: 0, Len: 21, Group: 0, Seq: 0, Command: 8) CBOR {"bootloader":"MCUboot"}
    A	08:47:19.258	[McuMgr] Sending (20 bytes) Header (Version: 1, Op: 0, Flags: 0, Len: 12, Group: 0, Seq: 1, Command: 8) CBOR {"query":"mode"}
    V	08:47:19.264	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:47:19.266	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0800000C00000108A1657175657279646D6F6465, WRITE COMMAND)
    I	08:47:19.277	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:47:19.284	[McuMgr] Connection parameters updated (interval: 11.25ms, latency: 0, timeout: 420ms)
    I	08:47:19.284	Connection parameters updated (interval: 11.25ms, latency: 0, timeout: 420ms)
    I	08:47:19.319	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 09-00-00-08-00-00-01-08-BF-64-6D-6F-64-65-03-FF
    A	08:47:19.328	[McuMgr] Received Header (Version: 1, Op: 1, Flags: 0, Len: 8, Group: 0, Seq: 1, Command: 8) CBOR {"mode":3}
    A	08:47:19.335	[McuMgr] Sending (9 bytes) Header (Version: 1, Op: 0, Flags: 0, Len: 1, Group: 1, Seq: 2, Command: 0) CBOR {}
    V	08:47:19.337	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:47:19.339	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0800000100010200A0, WRITE COMMAND)
    I	08:47:19.345	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:47:19.390	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 09-00-00-F4-00-01-02-00-BF-66-69-6D-61-67-65-73-9F-BF-64-73-6C-6F-74-00-67-76-65-72-73-69-6F-6E-65-32-2E-30-2E-30-64-68-61-73-68-58-20-62-1F-CC-C3-73-18-FF-DC-EA-25-F6-79-8A-38-70-9A-53-E2-9F-5F-5A-2E-1E-46-EB-C9-77-BD-7E-5A-C8-41-68-62-6F-6F-74-61-62-6C-65-F5-67-70-65-6E-64-69-6E-67-F4-69-63-6F-6E-66-69-72-6D-65-64-F5-66-61-63-74-69-76-65-F5-69-70-65-72-6D-61-6E-65-6E-74-F4-FF-BF-64-73-6C-6F-74-01-67-76-65-72-73-69-6F-6E-65-32-2E-30-2E-30-64-68-61-73-68-58-20-B8-B6-10-29-64-73-8F-D0-5F-17-B8-64-5C-4A-54-1C-0B-10-4F-FE-E4-3D-D4-3C-0A-DA-6B-90-18-20-67-AF-68-62-6F-6F-74-61-62-6C-65-F5-67-70-65-6E-64-69-6E-67-F4-69-63-6F-6E-66-69-72-6D-65-64-F4-66-61-63-74-69-76-65-F4-69-70-65-72-6D-61-6E-65-6E-74-F4-FF-FF-6B-73-70-6C-69-74-53-74-61-74-75-73-00-FF
    A	08:47:19.395	[McuMgr] Received Header (Version: 1, Op: 1, Flags: 0, Len: 244, Group: 1, Seq: 2, Command: 0) CBOR {"images":[{"slot":0,"version":"2.0.0","hash":"Yh/Mw3MY/9zqJfZ5ijhwmlPin19aLh5G68l3vX5ayEE=","bootable":true,"pending":false,"confirmed":true,"active":true,"permanent":false},{"slot":1,"version":"2.0.0","hash":"uLYQKWRzj9BfF7hkXEpUHAsQT/7kPdQ8CtprkBggZ68=","bootable":true,"pending":false,"confirmed":false,"active":false,"permanent":false}],"splitStatus":0}
    V	08:47:19.402	[McuMgr] Uploading firmware...
    I	08:47:19.419	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 5000ms)
    V	08:47:20.344	[McuMgr] New state: TEST
    A	08:47:20.358	[McuMgr] Sending (57 bytes) Header (Version: 1, Op: 2, Flags: 0, Len: 49, Group: 1, Seq: 4, Command: 0) CBOR {"confirm":false,"hash":"uLYQKWRzj9BfF7hkXEpUHAsQT/7kPdQ8CtprkBggZ68="}
    V	08:47:20.362	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:47:20.366	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0A00003100010400A267636F6E6669726DF464686173685820B8B6102964738FD05F17B8645C4A541C0B104FFEE43DD43C0ADA6B90182067AF, WRITE COMMAND)
    I	08:47:20.401	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:47:20.467	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 0B-00-00-F4-00-01-04-00-BF-66-69-6D-61-67-65-73-9F-BF-64-73-6C-6F-74-00-67-76-65-72-73-69-6F-6E-65-32-2E-30-2E-30-64-68-61-73-68-58-20-62-1F-CC-C3-73-18-FF-DC-EA-25-F6-79-8A-38-70-9A-53-E2-9F-5F-5A-2E-1E-46-EB-C9-77-BD-7E-5A-C8-41-68-62-6F-6F-74-61-62-6C-65-F5-67-70-65-6E-64-69-6E-67-F4-69-63-6F-6E-66-69-72-6D-65-64-F5-66-61-63-74-69-76-65-F5-69-70-65-72-6D-61-6E-65-6E-74-F4-FF-BF-64-73-6C-6F-74-01-67-76-65-72-73-69-6F-6E-65-32-2E-30-2E-30-64-68-61-73-68-58-20-B8-B6-10-29-64-73-8F-D0-5F-17-B8-64-5C-4A-54-1C-0B-10-4F-FE-E4-3D-D4-3C-0A-DA-6B-90-18-20-67-AF-68-62-6F-6F-74-61-62-6C-65-F5-67-70-65-6E-64-69-6E-67-F5-69-63-6F-6E-66-69-72-6D-65-64-F4-66-61-63-74-69-76-65-F4-69-70-65-72-6D-61-6E-65-6E-74-F4-FF-FF-6B-73-70-6C-69-74-53-74-61-74-75-73-00-FF
    A	08:47:20.473	[McuMgr] Received Header (Version: 1, Op: 3, Flags: 0, Len: 244, Group: 1, Seq: 4, Command: 0) CBOR {"images":[{"slot":0,"version":"2.0.0","hash":"Yh/Mw3MY/9zqJfZ5ijhwmlPin19aLh5G68l3vX5ayEE=","bootable":true,"pending":false,"confirmed":true,"active":true,"permanent":false},{"slot":1,"version":"2.0.0","hash":"uLYQKWRzj9BfF7hkXEpUHAsQT/7kPdQ8CtprkBggZ68=","bootable":true,"pending":true,"confirmed":false,"active":false,"permanent":false}],"splitStatus":0}
    V	08:47:20.483	[McuMgr] New state: RESET
    A	08:47:20.490	[McuMgr] Sending (9 bytes) Header (Version: 1, Op: 2, Flags: 0, Len: 1, Group: 0, Seq: 5, Command: 5) CBOR {}
    V	08:47:20.493	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:47:20.495	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0A00000100000505A0, WRITE COMMAND)
    I	08:47:20.508	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:47:20.528	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 0B-00-00-02-00-00-05-05-BF-FF
    A	08:47:20.532	[McuMgr] Received Header (Version: 1, Op: 3, Flags: 0, Len: 2, Group: 0, Seq: 5, Command: 5) CBOR {}
    D	08:47:25.782	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
    I	08:47:25.782	Disconnected
    D	08:47:25.792	[McuMgr] [Callback] Connection state changed with status: 0 and new state: 0 (DISCONNECTED)
    I	08:47:25.795	[McuMgr] Disconnected
    D	08:47:25.962	[McuMgr] gatt.close()
    D	08:47:25.971	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	08:47:30.540	gatt.close()
    D	08:47:30.542	wait(200)
    V	08:47:30.743	Connecting to DA:FA:AF:24:60:EF...
    D	08:47:30.744	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	08:48:00.323	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	08:48:00.324	Connected to DA:FA:AF:24:60:EF
    V	08:48:00.325	Discovering services...
    D	08:48:00.325	gatt.discoverServices()
    D	08:48:00.418	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	08:48:00.743	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	08:48:01.151	[Callback] Services discovered with status: 0
    I	08:48:01.151	Services discovered
    V	08:48:01.168	Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    - Client Supported Features [R W] (0x2B29)
    - Database Hash [R] (0x2B2A)
    Generic Access (0x1800)
    - Device Name [R] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
    - Button [N R] (00001524-1212-efde-1523-785feabcd123)
       Client Characteristic Configuration (0x2902)
    - LED [W] (00001525-1212-efde-1523-785feabcd123)
    SMP Service (8d53dc1d-1db7-4cd3-868b-8a527460aa84)
    - SMP Characteristic [N WNR] (da2e7828-fbce-4e01-ae9e-261174997c48)
       Client Characteristic Configuration (0x2902)
    Mesh Provisioning Service (0x1827)
    - Mesh Provisioning Data In [WNR] (0x2ADB)
    - Mesh Provisioning Data Out [N] (0x2ADC)
       Client Characteristic Configuration (0x2902)
    D	08:48:01.168	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	08:48:01.173	gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
    D	08:48:01.177	gatt.setCharacteristicNotification(00002adc-0000-1000-8000-00805f9b34fb, true)
    I	08:48:01.252	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
    I	08:48:05.599	Connection parameters updated (interval: 40.0ms, latency: 0, timeout: 420ms)
    V	08:49:03.288	[McuMgr] Connecting...
    D	08:49:03.295	[McuMgr] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, LE 1M)
    D	08:49:03.371	[McuMgr] [Callback] Connection state changed with status: 0 and new state: 2 (CONNECTED)
    I	08:49:03.375	[McuMgr] Connected to DA:FA:AF:24:60:EF
    D	08:49:03.378	[McuMgr] wait(300)
    V	08:49:03.682	[McuMgr] Discovering services...
    D	08:49:03.690	[McuMgr] gatt.discoverServices()
    I	08:49:03.700	[McuMgr] Services discovered
    V	08:49:03.705	[McuMgr] Primary service found
    V	08:49:03.709	[McuMgr] Requesting new MTU...
    D	08:49:03.712	[McuMgr] gatt.requestMtu(498)
    I	08:49:03.798	[McuMgr] MTU changed to: 498
    D	08:49:03.803	[McuMgr] gatt.setCharacteristicNotification(da2e7828-fbce-4e01-ae9e-261174997c48, true)
    V	08:49:03.809	[McuMgr] Enabling notifications for da2e7828-fbce-4e01-ae9e-261174997c48
    D	08:49:03.813	[McuMgr] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
    I	08:49:03.957	[McuMgr] Data written to descr. 00002902-0000-1000-8000-00805f9b34fb
    V	08:49:03.963	[McuMgr] Waiting for value change...
    V	08:49:03.969	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:49:03.972	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x000000010000FF06A0, WRITE COMMAND)
    I	08:49:03.980	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:49:04.077	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 01-00-00-19-00-00-FF-06-BF-68-62-75-66-5F-73-69-7A-65-19-09-AB-69-62-75-66-5F-63-6F-75-6E-74-04-FF
    I	08:49:04.082	[McuMgr] Wait for value changed complete
    A	08:49:04.086	[McuMgr] Received Header (Version: 0, Op: 1, Flags: 0, Len: 25, Group: 0, Seq: 255, Command: 6) CBOR {"buf_size":2475,"buf_count":4}
    I	08:49:04.091	[McuMgr] SMP reassembly supported with buffer size: 2475 bytes and count: 4
    V	08:49:04.094	[McuMgr] Requesting connection priority: HIGH (11.25–15ms, 0, 5s)...
    D	08:49:04.098	[McuMgr] gatt.requestConnectionPriority(HIGH)
    A	08:49:04.110	[McuMgr] Sending (9 bytes) Header (Version: 1, Op: 0, Flags: 0, Len: 1, Group: 0, Seq: 0, Command: 8) CBOR {}
    V	08:49:04.306	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:49:04.312	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0800000100000008A0, WRITE COMMAND)
    I	08:49:04.319	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:49:04.408	Connection parameters updated (interval: 11.25ms, latency: 0, timeout: 420ms)
    I	08:49:04.409	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 09-00-00-15-00-00-00-08-BF-6A-62-6F-6F-74-6C-6F-61-64-65-72-67-4D-43-55-62-6F-6F-74-FF
    I	08:49:04.419	[McuMgr] Connection parameters updated (interval: 11.25ms, latency: 0, timeout: 420ms)
    A	08:49:04.422	[McuMgr] Received Header (Version: 1, Op: 1, Flags: 0, Len: 21, Group: 0, Seq: 0, Command: 8) CBOR {"bootloader":"MCUboot"}
    A	08:49:04.430	[McuMgr] Sending (20 bytes) Header (Version: 1, Op: 0, Flags: 0, Len: 12, Group: 0, Seq: 1, Command: 8) CBOR {"query":"mode"}
    V	08:49:04.434	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:49:04.438	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0800000C00000108A1657175657279646D6F6465, WRITE COMMAND)
    I	08:49:04.448	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:49:04.489	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 09-00-00-08-00-00-01-08-BF-64-6D-6F-64-65-03-FF
    A	08:49:04.496	[McuMgr] Received Header (Version: 1, Op: 1, Flags: 0, Len: 8, Group: 0, Seq: 1, Command: 8) CBOR {"mode":3}
    A	08:49:04.509	[McuMgr] Sending (9 bytes) Header (Version: 1, Op: 0, Flags: 0, Len: 1, Group: 1, Seq: 2, Command: 0) CBOR {}
    V	08:49:04.517	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:49:04.520	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0800000100010200A0, WRITE COMMAND)
    I	08:49:04.530	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:49:04.546	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 5000ms)
    I	08:49:04.553	[McuMgr] Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 5000ms)
    I	08:49:04.607	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 09-00-00-F4-00-01-02-00-BF-66-69-6D-61-67-65-73-9F-BF-64-73-6C-6F-74-00-67-76-65-72-73-69-6F-6E-65-32-2E-30-2E-30-64-68-61-73-68-58-20-B8-B6-10-29-64-73-8F-D0-5F-17-B8-64-5C-4A-54-1C-0B-10-4F-FE-E4-3D-D4-3C-0A-DA-6B-90-18-20-67-AF-68-62-6F-6F-74-61-62-6C-65-F5-67-70-65-6E-64-69-6E-67-F4-69-63-6F-6E-66-69-72-6D-65-64-F4-66-61-63-74-69-76-65-F5-69-70-65-72-6D-61-6E-65-6E-74-F4-FF-BF-64-73-6C-6F-74-01-67-76-65-72-73-69-6F-6E-65-32-2E-30-2E-30-64-68-61-73-68-58-20-62-1F-CC-C3-73-18-FF-DC-EA-25-F6-79-8A-38-70-9A-53-E2-9F-5F-5A-2E-1E-46-EB-C9-77-BD-7E-5A-C8-41-68-62-6F-6F-74-61-62-6C-65-F5-67-70-65-6E-64-69-6E-67-F4-69-63-6F-6E-66-69-72-6D-65-64-F5-66-61-63-74-69-76-65-F4-69-70-65-72-6D-61-6E-65-6E-74-F4-FF-FF-6B-73-70-6C-69-74-53-74-61-74-75-73-00-FF
    A	08:49:04.613	[McuMgr] Received Header (Version: 1, Op: 1, Flags: 0, Len: 244, Group: 1, Seq: 2, Command: 0) CBOR {"images":[{"slot":0,"version":"2.0.0","hash":"uLYQKWRzj9BfF7hkXEpUHAsQT/7kPdQ8CtprkBggZ68=","bootable":true,"pending":false,"confirmed":false,"active":true,"permanent":false},{"slot":1,"version":"2.0.0","hash":"Yh/Mw3MY/9zqJfZ5ijhwmlPin19aLh5G68l3vX5ayEE=","bootable":true,"pending":false,"confirmed":true,"active":false,"permanent":false}],"splitStatus":0}
    V	08:49:04.622	[McuMgr] Uploading firmware...
    V	08:49:07.286	[McuMgr] New state: CONFIRM
    A	08:49:07.322	[McuMgr] Sending (57 bytes) Header (Version: 1, Op: 2, Flags: 0, Len: 49, Group: 1, Seq: 4, Command: 0) CBOR {"confirm":true,"hash":"uLYQKWRzj9BfF7hkXEpUHAsQT/7kPdQ8CtprkBggZ68="}
    V	08:49:07.329	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:49:07.334	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0A00003100010400A267636F6E6669726DF564686173685820B8B6102964738FD05F17B8645C4A541C0B104FFEE43DD43C0ADA6B90182067AF, WRITE COMMAND)
    I	08:49:07.390	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:49:07.457	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 0B-00-00-F4-00-01-04-00-BF-66-69-6D-61-67-65-73-9F-BF-64-73-6C-6F-74-00-67-76-65-72-73-69-6F-6E-65-32-2E-30-2E-30-64-68-61-73-68-58-20-B8-B6-10-29-64-73-8F-D0-5F-17-B8-64-5C-4A-54-1C-0B-10-4F-FE-E4-3D-D4-3C-0A-DA-6B-90-18-20-67-AF-68-62-6F-6F-74-61-62-6C-65-F5-67-70-65-6E-64-69-6E-67-F4-69-63-6F-6E-66-69-72-6D-65-64-F5-66-61-63-74-69-76-65-F5-69-70-65-72-6D-61-6E-65-6E-74-F4-FF-BF-64-73-6C-6F-74-01-67-76-65-72-73-69-6F-6E-65-32-2E-30-2E-30-64-68-61-73-68-58-20-62-1F-CC-C3-73-18-FF-DC-EA-25-F6-79-8A-38-70-9A-53-E2-9F-5F-5A-2E-1E-46-EB-C9-77-BD-7E-5A-C8-41-68-62-6F-6F-74-61-62-6C-65-F5-67-70-65-6E-64-69-6E-67-F4-69-63-6F-6E-66-69-72-6D-65-64-F4-66-61-63-74-69-76-65-F4-69-70-65-72-6D-61-6E-65-6E-74-F4-FF-FF-6B-73-70-6C-69-74-53-74-61-74-75-73-00-FF
    A	08:49:07.464	[McuMgr] Received Header (Version: 1, Op: 3, Flags: 0, Len: 244, Group: 1, Seq: 4, Command: 0) CBOR {"images":[{"slot":0,"version":"2.0.0","hash":"uLYQKWRzj9BfF7hkXEpUHAsQT/7kPdQ8CtprkBggZ68=","bootable":true,"pending":false,"confirmed":true,"active":true,"permanent":false},{"slot":1,"version":"2.0.0","hash":"Yh/Mw3MY/9zqJfZ5ijhwmlPin19aLh5G68l3vX5ayEE=","bootable":true,"pending":false,"confirmed":false,"active":false,"permanent":false}],"splitStatus":0}
    V	08:49:07.479	[McuMgr] New state: RESET
    A	08:49:07.487	[McuMgr] Sending (9 bytes) Header (Version: 1, Op: 2, Flags: 0, Len: 1, Group: 0, Seq: 5, Command: 5) CBOR {}
    V	08:49:07.493	[McuMgr] Writing characteristic da2e7828-fbce-4e01-ae9e-261174997c48 (WRITE COMMAND)
    D	08:49:07.496	[McuMgr] gatt.writeCharacteristic(da2e7828-fbce-4e01-ae9e-261174997c48, value=0x0A00000100000505A0, WRITE COMMAND)
    I	08:49:07.526	[McuMgr] Data written to da2e7828-fbce-4e01-ae9e-261174997c48
    I	08:49:07.534	[McuMgr] Notification received from da2e7828-fbce-4e01-ae9e-261174997c48, value: (0x) 0B-00-00-02-00-00-05-05-BF-FF
    A	08:49:07.538	[McuMgr] Received Header (Version: 1, Op: 3, Flags: 0, Len: 2, Group: 0, Seq: 5, Command: 5) CBOR {}
    D	08:49:12.829	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
    I	08:49:12.829	Disconnected
    D	08:49:12.850	[McuMgr] [Callback] Connection state changed with status: 0 and new state: 0 (DISCONNECTED)
    I	08:49:12.859	[McuMgr] Disconnected
    D	08:49:12.927	[McuMgr] gatt.close()
    D	08:49:12.941	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	08:49:17.550	gatt.close()
    D	08:49:17.555	wait(200)
    V	08:49:17.756	Connecting to DA:FA:AF:24:60:EF...
    D	08:49:17.756	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	08:49:18.167	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	08:49:18.167	Connected to DA:FA:AF:24:60:EF
    V	08:49:18.169	Discovering services...
    D	08:49:18.169	gatt.discoverServices()
    D	08:49:18.184	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	08:49:18.594	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	08:49:18.995	[Callback] Services discovered with status: 0
    I	08:49:18.995	Services discovered
    V	08:49:19.009	Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    - Client Supported Features [R W] (0x2B29)
    - Database Hash [R] (0x2B2A)
    Generic Access (0x1800)
    - Device Name [R] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Nordic LED Button Service (00001523-1212-efde-1523-785feabcd123)
    - Button [N R] (00001524-1212-efde-1523-785feabcd123)
       Client Characteristic Configuration (0x2902)
    - LED [W] (00001525-1212-efde-1523-785feabcd123)
    SMP Service (8d53dc1d-1db7-4cd3-868b-8a527460aa84)
    - SMP Characteristic [N WNR] (da2e7828-fbce-4e01-ae9e-261174997c48)
       Client Characteristic Configuration (0x2902)
    Mesh Provisioning Service (0x1827)
    - Mesh Provisioning Data In [WNR] (0x2ADB)
    - Mesh Provisioning Data Out [N] (0x2ADC)
       Client Characteristic Configuration (0x2902)
    D	08:49:19.010	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    D	08:49:19.015	gatt.setCharacteristicNotification(00001524-1212-efde-1523-785feabcd123, true)
    D	08:49:19.020	gatt.setCharacteristicNotification(00002adc-0000-1000-8000-00805f9b34fb, true)
    I	08:49:19.219	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
    I	08:49:23.516	Connection parameters updated (interval: 40.0ms, latency: 0, timeout: 420ms)

  • I see in the logs, that the service found on the device is SMP Service:

    SMP Service (8d53dc1d-1db7-4cd3-868b-8a527460aa84)
    - SMP Characteristic [N WNR] (da2e7828-fbce-4e01-ae9e-261174997c48)

    This means, that your device is based on nRF Connect SDK, not nRF5 SDK, and `mcumgr_flutter` is the right library, if you're using Flutter.

    There is no method "getPlatformVersion" in this library.

  • I realized that in the post I copied the wrong error, when doing the firmware update the error I get is the following: "Error during firmware update: MissingPluginException(No implementation found for method update on channel mcumgr_flutter/method_channel)". I will also add below the code of how I did the firmware update. Thanks in advance!

    try {
                      // Load firmware data
                      final byteData = await rootBundle.load('assets/dfu_application.zip');
                      final firmwareBytes = byteData.buffer.asUint8List();

                      final image = mcumgr.Image(
                        image: 0,
                        data: firmwareBytes,
                      );

                      // Initialize manager
                      final updateManagerFactory = mcumgr.FirmwareUpdateManagerFactory();
                      final updateManager = await updateManagerFactory.getUpdateManager(device.remoteId.str);

                      // Setup streams
                      final updateStream = updateManager.setup();

                      updateManager.updateStateStream?.listen((event) {
                        print("Update State: $event");
                        if (event == mcumgr.FirmwareUpgradeState.success) {
                          ScaffoldMessenger.of(context).showSnackBar(
                            SnackBar(content: Text('Firmware update completed successfully!')),
                          );
                        }
                      });

                      updateManager.progressStream.listen((event) {
                        print("Progress: ${event.bytesSent} / ${event.imageSize} bytes sent");
                      });

                      updateManager.logger.logMessageStream
                          .where((log) => log.level.rawValue > 1)
                          .listen((log) => print("Log: ${log.message}"));

                      // Configuration
                      const config = mcumgr.FirmwareUpgradeConfiguration(
                        eraseAppSettings: true,
                        firmwareUpgradeMode: FirmwareUpgradeMode.testAndConfirm,
                      );

                      // Perform update
                      await updateManager.update([image], configuration: config);
                    } catch (e) {
                      print("Error during firmware update: $e");
                      ScaffoldMessenger.of(context).showSnackBar(
                        SnackBar(content: Text('Firmware update failed: $e')),
                      );
                    }
  • Are you using version 0.4.2 of mcumgr_flutter library?

Reply Children
Related