This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

nRF52805 OTA DFU not working

Hi 

I'm using nRF52805 to realize the DFU function using the buttonless_dfu example project. I follow the instruction of this and use commands in this discussion

After flashing the hex file into the nRF52805, I can see the Bluetooth signal on the nRF Connect app. But in iOS, it shows this device does not support DFU (attached image below). In Android, it allows me to do the DFU but when I upload the program zip file, it just connects to DFUTARG and stops there. 

I have attached my hex file for OTA and commands used for creating these files. Can anyone please help me with this? I am not sure which step is wrong. Thanks in advance

        

OTA_DFU.zip

Parents
  • Hello,

    You are using the nRF5 SDK, right?

    Do you see the same services in both iOS and Android?

    it just connects to DFUTARG and stops there

    Does the log from nRF Connect for Android say anything? Can you paste the log here?

    What does your DFU image contain? What sort of upgrade are you trying to do? Is it just an application, or is it a softdevice upgrade?

    Best regards,

    Edvin

  • Hi Edvin,

    Yes, I'm using nRF5 SDK.

    Do you see the same services in both iOS and Android?

    I see different services in iOS. In iOS, it is "Services: Device information".

    Does the log from nRF Connect for Android say anything? Can you paste the log here?

    The log showed one error "Error 8 (0x8): GATT CONN TIMEOUT". I have attached the log from "nordic_buttonless" and from "DFETARG" here.

    nRF Connect, 2022-02-17
    Nordic_Buttonless (C4:32:0D:4D:4A:1D)
    V	14:02:53.058	Connecting to C4:32:0D:4D:4A:1D...
    D	14:02:53.058	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	14:02:55.028	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	14:02:55.040	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	14:02:55.040	Connected to C4:32:0D:4D:4A:1D
    V	14:02:55.060	Discovering services...
    D	14:02:55.060	gatt.discoverServices()
    I	14:02:55.454	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	14:02:55.535	[Callback] Services discovered with status: 0
    I	14:02:55.535	Services discovered
    V	14:02:55.557	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    Secure DFU Service (0xFE59)
    - Buttonless DFU [I W] (8ec90003-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    D	14:02:55.558	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    I	14:02:55.625	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
    I	14:03:00.456	Connection parameters updated (interval: 150.0ms, latency: 0, timeout: 4000ms)
    V	14:05:36.911	[DFU] DFU service started
    V	14:05:36.912	[DFU] Opening file...
    I	14:05:39.982	[DFU] Firmware file opened successfully
    V	14:05:39.983	[DFU] Connecting to DFU target...
    D	14:05:39.984	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    I	14:05:40.021	[DFU] Connected to C4:32:0D:4D:4A:1D
    V	14:05:40.023	[DFU] Discovering services...
    D	14:05:40.023	[DFU] gatt.discoverServices()
    I	14:05:40.032	[DFU] Services discovered
    D	14:05:40.059	[DFU] wait(1000)
    W	14:05:41.049	[DFU] Application with buttonless update found
    V	14:05:41.050	[DFU] Jumping to the DFU Bootloader...
    V	14:05:41.050	[DFU] Enabling indications for 8ec90003-f315-4f60-9fb8-838830daea50
    D	14:05:41.050	[DFU] gatt.setCharacteristicNotification(8ec90003-f315-4f60-9fb8-838830daea50, true)
    D	14:05:41.050	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x02-00)
    I	14:05:41.111	[DFU] Data written to descr.8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 02-00
    V	14:05:41.111	[DFU] Notifications enabled for 8ec90003-f315-4f60-9fb8-838830daea50
    A	14:05:41.111	[DFU] Indications enabled
    D	14:05:41.112	[DFU] wait(1000)
    V	14:05:42.133	[DFU] Writing to characteristic 8ec90003-f315-4f60-9fb8-838830daea50
    D	14:05:42.133	[DFU] gatt.writeCharacteristic(8ec90003-f315-4f60-9fb8-838830daea50)
    A	14:05:42.178	[DFU] Enter bootloader sent (Op Code = 1)
    I	14:05:42.178	[DFU] Notification received from 8ec90003-f315-4f60-9fb8-838830daea50, value (0x): 20-01-01
    A	14:05:42.178	[DFU] Response received (Op Code = 1, Status = 1)
    D	14:05:46.362	[Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
    E	14:05:46.363	Error 8 (0x8): GATT CONN TIMEOUT
    I	14:05:46.363	Disconnected
    I	14:05:46.364	[DFU] Disconnected by the remote device
    D	14:05:46.397	[DFU] gatt.refresh() (hidden)
    D	14:05:46.397	[DFU] gatt.disconnect()
    D	14:05:46.397	[DFU] gatt.close()
    V	14:05:46.397	[DFU] Scanning for the DFU Bootloader...
    D	14:05:46.397	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	14:05:46.403	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    I	14:05:46.500	[DFU] DFU Bootloader found with address C4:32:0D:4D:4A:1E
    V	14:05:46.514	[DFU] DFU service started
    I	14:05:46.514	[DFU] Firmware file opened successfully
    D	14:05:46.514	[DFU] wait(1000)
    D	14:05:47.514	[DFU] wait(1000)
    V	14:05:48.524	[DFU] Connecting to DFU target...
    D	14:05:48.563	[DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
    I	14:05:48.689	[DFU] Connected to C4:32:0D:4D:4A:1E
    V	14:05:48.689	[DFU] Discovering services...
    D	14:05:48.689	[DFU] gatt.discoverServices()
    D	14:05:48.936	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	14:05:49.488	[DFU] Services discovered
    D	14:05:49.489	[DFU] wait(1000)
    V	14:05:50.486	[DFU] Requesting new MTU...
    D	14:05:50.486	[DFU] gatt.requestMtu(517)
    I	14:05:50.514	[DFU] MTU changed to: 247
    V	14:05:50.514	[DFU] Enabling notifications for 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:50.514	[DFU] gatt.setCharacteristicNotification(8ec90001-f315-4f60-9fb8-838830daea50, true)
    D	14:05:50.514	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
    I	14:05:50.524	[DFU] Data written to descr.8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-00
    V	14:05:50.524	[DFU] Notifications enabled for 8ec90001-f315-4f60-9fb8-838830daea50
    A	14:05:50.525	[DFU] Notifications enabled
    D	14:05:50.525	[DFU] wait(1000)
    V	14:05:51.612	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:51.612	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:51.612	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 06-01
    I	14:05:51.612	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-06-01-00-02-00-00-00-00-00-00-00-00-00-00
    A	14:05:51.612	[DFU] Command object info received (Max size = 512, Offset = 0, CRC = 00000000)
    V	14:05:51.612	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:51.612	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:51.612	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 02-00-00
    I	14:05:51.612	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-02-01
    A	14:05:51.612	[DFU] Packet Receipt Notif disabled (Op Code = 2, Value = 0)
    V	14:05:51.612	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:51.612	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:51.612	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-01-8D-00-00-00
    I	14:05:51.623	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:51.623	[DFU] Command object created
    V	14:05:51.623	[DFU] Writing to characteristic 8ec90002-f315-4f60-9fb8-838830daea50
    D	14:05:51.623	[DFU] gatt.writeCharacteristic(8ec90002-f315-4f60-9fb8-838830daea50)
    I	14:05:51.623	[DFU] Data written to 8ec90002-f315-4f60-9fb8-838830daea50, value (0x): 12-8A-01-0A-44-08-01-12-40-08-01-10-34-1A-02-83-02-20-00-28-00-30-00-38-9C-99-03-42-24-08-03-12-20-C3-0C-99-56-96-BA-81-E5-22-28-73-55-72-80-D3-72-2F-EC-1D-BA-29-42-70-F5-86-7E-94-49-19-A3-2C-A8-48-00-52-04-08-01-12-00-10-00-1A-40-61-C0-09-08-32-2B-7D-4B-C0-BD-B5-70-45-E4-2C-1F-58-CD-37-03-07-2D-CA-B0-00-31-4B-8A-BA-2C-1A-F8-55-11-BE-A8-B5-F0-6D-AC-04-A7-E1-52-4C-27-A3-1C-24-DF-C8-29-A3-57-2D-B0-FB-B7-99-4A-C0-69-76-85
    A	14:05:51.624	[DFU] Command object sent (CRC = 9986FC44)
    V	14:05:51.625	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:51.625	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:51.638	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:51.647	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-8D-00-00-00-44-FC-86-99
    A	14:05:51.648	[DFU] Checksum received (Offset = 141, CRC = 9986FC44)
    V	14:05:51.648	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:51.648	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:51.663	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:51.830	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:51.830	[DFU] Command object executed
    V	14:05:51.831	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:51.831	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:51.844	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 06-02
    I	14:05:51.859	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-06-01-00-10-00-00-00-00-00-00-00-00-00-00
    A	14:05:51.860	[DFU] Data object info received (Max size = 4096, Offset = 0, CRC = 00000000)
    V	14:05:51.894	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:51.894	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:51.980	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    I	14:05:51.980	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:51.981	[DFU] Data object (1/13) created
    D	14:05:51.981	[DFU] wait(400)
    A	14:05:52.382	[DFU] Uploading firmware...
    V	14:05:52.382	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:52.458	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:52.458	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:52.715	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:52.728	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-10-00-00-18-47-54-EC
    A	14:05:52.729	[DFU] Checksum received (Offset = 4096, CRC = EC544718)
    V	14:05:52.729	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:52.729	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:52.744	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:52.758	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:52.758	[DFU] Data object executed
    V	14:05:52.758	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:52.759	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:52.774	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:52.788	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:52.789	[DFU] Data object (2/13) created
    D	14:05:52.789	[DFU] wait(400)
    A	14:05:53.190	[DFU] Uploading firmware...
    V	14:05:53.190	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:53.264	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:53.264	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:53.498	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:53.509	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-20-00-00-41-86-47-86
    A	14:05:53.510	[DFU] Checksum received (Offset = 8192, CRC = 86478641)
    V	14:05:53.510	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:53.510	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:53.555	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:53.556	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:53.556	[DFU] Data object executed
    V	14:05:53.556	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:53.557	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:53.570	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:53.584	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:53.584	[DFU] Data object (3/13) created
    D	14:05:53.584	[DFU] wait(400)
    A	14:05:53.985	[DFU] Uploading firmware...
    V	14:05:53.985	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:54.077	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:54.077	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:54.484	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-30-00-00-20-A3-FA-8B
    I	14:05:54.484	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-30-00-00-20-A3-FA-8B
    A	14:05:54.484	[DFU] Checksum received (Offset = 12288, CRC = 8BFAA320)
    V	14:05:54.484	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:54.484	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:54.484	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:54.484	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:54.484	[DFU] Data object executed
    V	14:05:54.484	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:54.484	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:54.484	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:54.484	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:54.484	[DFU] Data object (4/13) created
    D	14:05:54.484	[DFU] wait(400)
    A	14:05:54.793	[DFU] Uploading firmware...
    V	14:05:54.793	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:54.889	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:54.889	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:55.191	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:55.203	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-40-00-00-67-F1-2F-55
    A	14:05:55.204	[DFU] Checksum received (Offset = 16384, CRC = 552FF167)
    V	14:05:55.204	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:55.205	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:55.234	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:55.249	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:55.249	[DFU] Data object executed
    V	14:05:55.249	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:55.250	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:55.264	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:55.279	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:55.279	[DFU] Data object (5/13) created
    D	14:05:55.279	[DFU] wait(400)
    A	14:05:55.679	[DFU] Uploading firmware...
    V	14:05:55.680	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:55.745	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:55.745	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:55.995	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:55.995	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-50-00-00-A4-BE-70-A0
    A	14:05:55.995	[DFU] Checksum received (Offset = 20480, CRC = A070BEA4)
    V	14:05:55.995	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:55.995	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:56.027	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:56.027	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:56.027	[DFU] Data object executed
    V	14:05:56.027	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:56.027	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:56.107	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:56.107	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:56.107	[DFU] Data object (6/13) created
    D	14:05:56.107	[DFU] wait(400)
    A	14:05:56.475	[DFU] Uploading firmware...
    V	14:05:56.476	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:56.529	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:56.529	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:56.809	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-60-00-00-92-95-4D-5B
    I	14:05:56.810	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-60-00-00-92-95-4D-5B
    A	14:05:56.810	[DFU] Checksum received (Offset = 24576, CRC = 5B4D9592)
    V	14:05:56.810	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:56.810	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:56.823	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:56.838	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:56.838	[DFU] Data object executed
    V	14:05:56.838	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:56.838	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:56.854	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:56.884	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:56.884	[DFU] Data object (7/13) created
    D	14:05:56.884	[DFU] wait(400)
    A	14:05:57.286	[DFU] Uploading firmware...
    V	14:05:57.286	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:57.322	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:57.322	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:57.605	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:57.605	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-70-00-00-70-B0-DC-29
    A	14:05:57.605	[DFU] Checksum received (Offset = 28672, CRC = 29DCB070)
    V	14:05:57.605	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:57.605	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:57.638	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:57.638	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:57.638	[DFU] Data object executed
    V	14:05:57.638	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:57.638	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:57.671	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:57.671	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:57.671	[DFU] Data object (8/13) created
    D	14:05:57.671	[DFU] wait(400)
    A	14:05:58.083	[DFU] Uploading firmware...
    V	14:05:58.083	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:58.086	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:58.086	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:58.382	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:58.382	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-80-00-00-6F-7B-80-62
    A	14:05:58.382	[DFU] Checksum received (Offset = 32768, CRC = 62807B6F)
    V	14:05:58.382	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:58.382	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:58.397	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:58.397	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:58.397	[DFU] Data object executed
    V	14:05:58.397	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:58.397	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:58.429	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:58.429	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:58.429	[DFU] Data object (9/13) created
    D	14:05:58.429	[DFU] wait(400)
    A	14:05:58.838	[DFU] Uploading firmware...
    V	14:05:58.838	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:58.886	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:58.887	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:59.153	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:59.153	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-90-00-00-AF-89-EB-74
    A	14:05:59.153	[DFU] Checksum received (Offset = 36864, CRC = 74EB89AF)
    V	14:05:59.153	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:59.153	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:59.168	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:59.186	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:59.186	[DFU] Data object executed
    V	14:05:59.186	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:59.186	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:59.202	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:59.222	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:59.222	[DFU] Data object (10/13) created
    D	14:05:59.222	[DFU] wait(400)
    A	14:05:59.632	[DFU] Uploading firmware...
    V	14:05:59.632	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:05:59.672	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:59.672	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:59.923	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:05:59.928	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-A0-00-00-97-52-A4-98
    A	14:05:59.928	[DFU] Checksum received (Offset = 40960, CRC = 98A45297)
    V	14:05:59.928	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:59.928	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:59.943	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:05:59.957	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:05:59.957	[DFU] Data object executed
    V	14:05:59.958	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:05:59.958	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:05:59.973	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:05:59.988	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:05:59.988	[DFU] Data object (11/13) created
    D	14:05:59.988	[DFU] wait(400)
    A	14:06:00.389	[DFU] Uploading firmware...
    V	14:06:00.389	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:06:00.446	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:06:00.446	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:06:00.695	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:06:00.707	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-B0-00-00-C5-68-6F-F3
    A	14:06:00.707	[DFU] Checksum received (Offset = 45056, CRC = F36F68C5)
    V	14:06:00.707	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:06:00.707	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:06:00.722	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:06:00.737	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:06:00.737	[DFU] Data object executed
    V	14:06:00.737	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:06:00.737	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:06:00.753	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-00-10-00-00
    I	14:06:00.767	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:06:00.767	[DFU] Data object (12/13) created
    D	14:06:00.767	[DFU] wait(400)
    A	14:06:01.167	[DFU] Uploading firmware...
    V	14:06:01.167	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:06:01.207	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:06:01.207	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:06:01.489	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:06:01.502	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-00-C0-00-00-DC-EC-36-A3
    A	14:06:01.502	[DFU] Checksum received (Offset = 49152, CRC = A336ECDC)
    V	14:06:01.502	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:06:01.502	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:06:01.517	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:06:01.532	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:06:01.532	[DFU] Data object executed
    V	14:06:01.532	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:06:01.532	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:06:01.547	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 01-02-9C-0C-00-00
    I	14:06:01.565	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-01-01
    A	14:06:01.565	[DFU] Data object (13/13) created
    D	14:06:01.565	[DFU] wait(400)
    A	14:06:01.962	[DFU] Uploading firmware...
    V	14:06:01.962	[DFU] Sending firmware to characteristic 8ec90002-f315-4f60-9fb8-838830daea50...
    V	14:06:01.998	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:06:01.998	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:06:02.209	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 03
    I	14:06:02.209	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-03-01-9C-CC-00-00-F8-89-DE-46
    A	14:06:02.209	[DFU] Checksum received (Offset = 52380, CRC = 46DE89F8)
    V	14:06:02.209	[DFU] Writing to characteristic 8ec90001-f315-4f60-9fb8-838830daea50
    D	14:06:02.209	[DFU] gatt.writeCharacteristic(8ec90001-f315-4f60-9fb8-838830daea50)
    I	14:06:02.237	[DFU] Data written to 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 04
    I	14:06:02.657	[DFU] Notification received from 8ec90001-f315-4f60-9fb8-838830daea50, value (0x): 60-04-01
    A	14:06:02.657	[DFU] Data object executed
    A	14:06:02.657	[DFU] Upload completed in 10791 ms
    I	14:06:03.070	[DFU] Disconnected by the remote device
    D	14:06:03.070	[DFU] gatt.refresh() (hidden)
    D	14:06:03.070	[DFU] gatt.disconnect()
    D	14:06:03.070	[DFU] gatt.close()
    D	14:06:03.124	[DFU] wait(1400)
    D	14:06:03.160	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	14:06:04.481	gatt.close()
    D	14:06:04.482	wait(200)
    V	14:06:04.683	Connecting to C4:32:0D:4D:4A:1D...
    D	14:06:04.683	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	14:06:05.232	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    D	14:06:05.241	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	14:06:05.241	Connected to C4:32:0D:4D:4A:1D
    V	14:06:05.260	Discovering services...
    D	14:06:05.260	gatt.discoverServices()
    I	14:06:05.672	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	14:06:05.743	[Callback] Services discovered with status: 0
    I	14:06:05.743	Services discovered
    V	14:06:05.757	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    - Service Changed [I] (0x2A05)
       Client Characteristic Configuration (0x2902)
    Secure DFU Service (0xFE59)
    - Buttonless DFU [I W] (8ec90003-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    D	14:06:05.757	gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
    I	14:06:05.855	Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
    I	14:06:11.136	Connection parameters updated (interval: 150.0ms, latency: 0, timeout: 4000ms)
    
    nRF Connect, 2022-02-17
    DfuTarg (C4:32:0D:4D:4A:1E)
    D	14:05:48.688	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    V	14:05:48.938	Connecting to C4:32:0D:4D:4A:1E...
    D	14:05:48.939	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, opportunistic = true, preferred PHY = LE 1M) (hidden)
    D	14:05:48.950	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	14:05:48.950	Connected to C4:32:0D:4D:4A:1E
    V	14:05:49.009	Discovering services...
    D	14:05:49.009	gatt.discoverServices()
    I	14:05:49.400	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 6000ms)
    D	14:05:49.476	[Callback] Services discovered with status: 0
    I	14:05:49.476	Services discovered
    V	14:05:49.498	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    - Central Address Resolution [R] (0x2AA6)
    Generic Attribute (0x1801)
    Secure DFU Service (0xFE59)
    - DFU Packet [WNR] (8ec90002-f315-4f60-9fb8-838830daea50)
    - DFU Control Point [N W] (8ec90001-f315-4f60-9fb8-838830daea50)
       Client Characteristic Configuration (0x2902)
    I	14:05:49.540	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    I	14:05:49.622	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 6000ms)
    D	14:06:03.064	[Callback] Connection state changed with status: 19 and new state: DISCONNECTED (0)
    W	14:06:03.064	Connection terminated by peer (status 19)
    I	14:06:03.064	Disconnected
    D	14:06:03.124	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    

    What does your DFU image contain? What sort of upgrade are you trying to do? Is it just an application, or is it a softdevice upgrade?

    For now, I just use the example ble_app_buttonless_dfu in the ble_peripheral folder. I would like to upgrade the application firmware in the future. But I have not reached that far yet. I just flash the merged file and it does not work as DFU. Please see my attached hex file in the initial post. Maybe you can try that hex file and see whether it work or not?

  • What do you see if you press the "Client" tab in iOS? What I wanted to see is whether the iphone has cached some old services, or if it sees the buttonless_dfu service. 

    Usually at this point I would ask you to try to enable logging on the nRF, especially since it looks like the nRF Disconnects. However, the nRF52805 is very limited on flash, so I don't think you would be able to do so. 

    I was able to test using nrfutil, nRF Connect for Desktop -> Bluetooth Low Energy and nRF Connect for iOS, and I managed to perform the DFU on all three using the SD, BL, BL-settings and APP that you provided. (I don't have an Android phone to test with). 

    What HW are you running on?

    Do you have the possibility to test using either nrfutil or nRF Connect for Desktop (requires an additional DK/Dongle). 

    I didn't manage to get your merged file to work (It didn't advertise on my end), but I flashed the bootloader-settings.hex, nordic_buttonless_dfu.hex, s112_nrf52_7.2.0_softdevice.hex and secure_bootloader.hex, and the attached dfu_test.zip file:

    1780.dfu_test.zip

    which is generated using the command:

    nrfutil pkg generate --application nordic_buttonless_dfu.hex --application-version 4 --sd-req 0x0103 --hw-version 52 --key-file private.key dfu_test.zip

    What nrfutil version do you use?

    And again, what does it say under the "client" tab on the iPhone?

    Best regards,

    Edvin

Reply
  • What do you see if you press the "Client" tab in iOS? What I wanted to see is whether the iphone has cached some old services, or if it sees the buttonless_dfu service. 

    Usually at this point I would ask you to try to enable logging on the nRF, especially since it looks like the nRF Disconnects. However, the nRF52805 is very limited on flash, so I don't think you would be able to do so. 

    I was able to test using nrfutil, nRF Connect for Desktop -> Bluetooth Low Energy and nRF Connect for iOS, and I managed to perform the DFU on all three using the SD, BL, BL-settings and APP that you provided. (I don't have an Android phone to test with). 

    What HW are you running on?

    Do you have the possibility to test using either nrfutil or nRF Connect for Desktop (requires an additional DK/Dongle). 

    I didn't manage to get your merged file to work (It didn't advertise on my end), but I flashed the bootloader-settings.hex, nordic_buttonless_dfu.hex, s112_nrf52_7.2.0_softdevice.hex and secure_bootloader.hex, and the attached dfu_test.zip file:

    1780.dfu_test.zip

    which is generated using the command:

    nrfutil pkg generate --application nordic_buttonless_dfu.hex --application-version 4 --sd-req 0x0103 --hw-version 52 --key-file private.key dfu_test.zip

    What nrfutil version do you use?

    And again, what does it say under the "client" tab on the iPhone?

    Best regards,

    Edvin

Children
  • Hi Edvin

    What do you see if you press the "Client" tab in iOS? What I wanted to see is whether the iphone has cached some old services, or if it sees the buttonless_dfu service. 

    Yes, the iPhone showed the old service that I uploaded before.

    But I do clean the chip every time I flash the buttonless dfu example using this command.

    nrfjprog --eraseall -f NRF52

    What HW are you running on?

    I am not sure what HW you ask for. I am using my own customized nRF52805 board and using nRF 52 DK as the media to flash the firmware into nRF52805. The SDK I am using is nRF5_SDK_17.1.0_ddde560 and s112_nrf52_7.2.0_softdevice. For generating DFU zip file I used the command --hw-version 52. The whole command is 

    nrfutil pkg generate --hw-version 52 --application-version 1 --application customize_app.hex --sd-req 0x0103 --key-file private.key customize_app.zip
    

    Since the board is customized so that i made some changes in secure_bootloader and ble_app_buttonless_dfu shown below:

    This is the extra setting for secure_bootloader. I enable the buttonless and disable the DFU_button

    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #define NRF_SDH_CLOCK_LF_SRC 0
    
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    
    
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    #define NRF_SDH_CLOCK_LF_ACCURACY 1
    
    
    
    //==========================================================
    // <e> NRF_BL_DFU_ENTER_METHOD_BUTTON - Enter DFU mode on button press.
    //==========================================================
    
    #define NRF_BL_DFU_ENTER_METHOD_BUTTON 0
    
    
    // <q> NRF_BL_DFU_ENTER_METHOD_BUTTONLESS  - Enter DFU mode when the Boolean enter_buttonless_dfu in DFU settings is true.
     
    
    #define NRF_BL_DFU_ENTER_METHOD_BUTTONLESS 1
    
    
    
    // <i> Whether to check the incoming version against the version of the existing app and/or
    // <i> the incoming SoftDevice requirements against the existing SoftDevice.
    // <i> This applies to application updates, and possibly to SoftDevice updates.
    // <i> Disabling this causes the checks to always ignore the incoming firmware version and
    // <i> to ignore the SoftDevice requirements if the first requirement is 0.
    // <i> This does not apply the bootloader updates. If the bootloader depends on the SoftDevice
    // <i> e.g. for BLE transport, this does not apply to SoftDevice updates.
    // <i> See @ref lib_bootloader_dfu_validation for more information.
    // <i> When signed updates are required, version checking should always be enabled.
    
    #define NRF_DFU_APP_DOWNGRADE_PREVENTION 0
    

    Below is my setting about ble_app_buttonless_dfu. Mainly about clock setting.

    // <o> NRFX_CLOCK_CONFIG_LF_SRC  - LF Clock Source
     
    // <0=> RC 
    // <1=> XTAL 
    // <2=> Synth 
    // <131073=> External Low Swing 
    // <196609=> External Full Swing 
    
    
    #define NRFX_CLOCK_CONFIG_LF_SRC 0
    
    
    // <o> CLOCK_CONFIG_LF_SRC  - LF Clock Source
     
    // <0=> RC 
    // <1=> XTAL 
    // <2=> Synth 
    // <131073=> External Low Swing 
    // <196609=> External Full Swing 
    
    
    #define CLOCK_CONFIG_LF_SRC 0
    
    
    // <o> NRF_SDH_CLOCK_LF_SRC  - SoftDevice clock source.
     
    // <0=> NRF_CLOCK_LF_SRC_RC 
    // <1=> NRF_CLOCK_LF_SRC_XTAL 
    // <2=> NRF_CLOCK_LF_SRC_SYNTH 
    
    #define NRF_SDH_CLOCK_LF_SRC 0
    
    
    // <o> NRF_SDH_CLOCK_LF_RC_CTIV - SoftDevice calibration timer interval. 
    #define NRF_SDH_CLOCK_LF_RC_CTIV 16
    
    
    // <o> NRF_SDH_CLOCK_LF_RC_TEMP_CTIV - SoftDevice calibration timer interval under constant temperature. 
    // <i> How often (in number of calibration intervals) the RC oscillator shall be calibrated
    // <i>  if the temperature has not changed.
    
    #define NRF_SDH_CLOCK_LF_RC_TEMP_CTIV 2
    
    
    // <o> NRF_SDH_CLOCK_LF_ACCURACY  - External clock accuracy used in the LL to compute timing.
     
    // <0=> NRF_CLOCK_LF_ACCURACY_250_PPM 
    // <1=> NRF_CLOCK_LF_ACCURACY_500_PPM 
    // <2=> NRF_CLOCK_LF_ACCURACY_150_PPM 
    // <3=> NRF_CLOCK_LF_ACCURACY_100_PPM 
    // <4=> NRF_CLOCK_LF_ACCURACY_75_PPM 
    // <5=> NRF_CLOCK_LF_ACCURACY_50_PPM 
    // <6=> NRF_CLOCK_LF_ACCURACY_30_PPM 
    // <7=> NRF_CLOCK_LF_ACCURACY_20_PPM 
    // <8=> NRF_CLOCK_LF_ACCURACY_10_PPM 
    // <9=> NRF_CLOCK_LF_ACCURACY_5_PPM 
    // <10=> NRF_CLOCK_LF_ACCURACY_2_PPM 
    // <11=> NRF_CLOCK_LF_ACCURACY_1_PPM 
    
    
    #define NRF_SDH_CLOCK_LF_ACCURACY 1
    

    Do you have the possibility to test using either nrfutil or nRF Connect for Desktop (requires an additional DK/Dongle). 

    I have one nRF 52 DK but I am not sure how to test the DFU using nrfutil or nRF Connect for Desktop. Could you give me any link about testing, please?

    I have tried the process in this link. So instead of merging hex files altogether. I just flashed in softdevice and secure bootloader. I did see the DFUTARG and successfully upload the ble_app_buttonless_dfu zip file and see a new application. However, after successfully uploading the zip file, I cannot use DFU just like I flashed the merge file, while I suppose in the ble_app_buttonless_dfu application, I should still be able to use DFU(I tried the zip you attached as well. the same result). So I think the secure_bootloader is alright. But it is not properly merged with the application so we cannot see DFU in the mobile end?

    What nrfutil version do you use?

    my nrfutil version 6.1.3

    Really thank you for your help.

    Best regards

    Jeremy

  • Hello Jeremy,

    Jeremy Wu said:

    Yes, the iPhone showed the old service that I uploaded before.

    But I do clean the chip every time I flash the buttonless dfu example using this command.

    It is the phone that stores the services. So even though they do not exist on the nRF, the phone still thinks they are there.

    Try to disable bluetooth properly from the iphone's settings menu (not just the pull up menu from home screen), and wait a couple of minutes before turning it back on. Sometimes this helps the phone forget the old services.

    To use either nrfutil or nRF Connect for Desktop for DFU, you need an extra nRF52 DK or nRF52 Dongle. Perhaps you can use the one you already have, but you need to detatch the debugger from your custom nRF52805 board when doing so, so that the computer can use the nRF52 on the DK. 

    Jeremy Wu said:
    I have tried the process in this link. So instead of merging hex files altogether. I just flashed in softdevice and secure bootloader. I did see the DFUTARG and successfully upload the ble_app_buttonless_dfu zip file and see a new application. However, after successfully uploading the zip file, I cannot use DFU just like I flashed the merge file, while I suppose in the ble_app_buttonless_dfu application, I should still be able to use DFU(I tried the zip you attached as well. the same result). So I think the secure_bootloader is alright. But it is not properly merged with the application so we cannot see DFU in the mobile end?

    I agree that it sounds like the bootloader is working, but there is something about the application, then. However, on my end I was able to run DFU after flashing BL-settings, BL, APP and SD (using an nRF52805 board). 

    To perform the DFU using nrfutil, first I connected two boards, one as the nRF52805 debugger, and the other as the nrfutil connectivity board. I started by erasing both devices using "nrfjprog -e"

    First I flashed the 805 using:

    nrfjprog --program bootloader-settings.hex --verify
    nrfjprog --program nordic_buttonless_dfu.hex --verify
    nrfjprog --program s112_nrf52_7.2.0_softdevice.hex --verify
    nrfjprog --program secure_bootloader.hex --verify
    nrfjprog --reset

    And then, to perform the DFU, use the command:

    nrfutil dfu ble -pkg dfu_test.zip -ic NRF52 -p COM5 -n "Nordic_Buttonless_" -f

    (COM5 refers to the COM port where the connectivity bard is connected. So not the DK that the debugger for the nRF52805 is connected). 

    The .zip packet is the one that I sent in the previous reply.

    Try that, and let me know what it says.

  • Hi Edvin,

    I turned off the bluetooth for couple of minutes just as you instructed.

    I have connected the nRF52 DK to my computer and use the SWDIO & SWDCLK to program my nRF52805 customized board. I have tried the commands you mentioned above and have the results shown below when I tried to perform the DFU from command prompt.

    C:\Users\JeremyWu\Desktop\OTA_pass_version\OTA_1.0>nrfutil dfu ble -pkg dfu_test.zip -ic NRF52 -p COM4 -n "Nordic_Buttonless_" -f
    Flashing connectivity firmware...
    Traceback (most recent call last):
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 3201, in call_cmd
        return subprocess.check_output(argstr, stderr=subprocess.STDOUT, shell=True)
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\subprocess.py", line 415, in check_output
        return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\subprocess.py", line 516, in run
        raise CalledProcessError(retcode, process.args,
    subprocess.CalledProcessError: Command 'nrfjprog --snr 682956030 --program c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\pc_ble_driver_py\hex\sd_api_v5\connectivity_4.1.4_1m_with_s132_5.1.0.hex --family NRF52' returned non-zero exit status 52.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "C:\Users\JeremyWu\AppData\Local\Programs\Python\Python38\Scripts\nrfutil-script.py", line 33, in <module>
        sys.exit(load_entry_point('nrfutil==6.1.3', 'console_scripts', 'nrfutil')())
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1128, in __call__
        return self.main(*args, **kwargs)
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1053, in main
        rv = self.invoke(ctx)
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1659, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1659, in invoke
        return _process_result(sub_ctx.command.invoke(sub_ctx))
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 1395, in invoke
        return ctx.invoke(self.callback, **ctx.params)
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\click\core.py", line 754, in invoke
        return __callback(*args, **kwargs)
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\nordicsemi\__main__.py", line 1172, in ble
        flasher.fw_flash()
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 3166, in fw_flash
        self.program(hex_file)
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 3194, in program
        self.call_cmd(args)
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\wrapt\decorators.py", line 469, in _synchronized
        return wrapped(*args, **kwargs)
      File "c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\pc_ble_driver_py\ble_driver.py", line 3206, in call_cmd
        raise RuntimeError(f"{e.__str__()}\n{e.output}")
    RuntimeError: Command 'nrfjprog --snr 682956030 --program c:\users\jeremywu\appdata\local\programs\python\python38\lib\site-packages\pc_ble_driver_py\hex\sd_api_v5\connectivity_4.1.4_1m_with_s132_5.1.0.hex --family NRF52' returned non-zero exit status 52.
    b'Parsing image file.\r\nERROR: The file specified is not a valid hex file, has data outside valid areas\r\nERROR: or does not have data in valid areas.\r\nNOTE: For additional output, try running again with logging enabled (--log).\r\nNOTE: Any generated log error messages will be displayed.\r\n'

    However, the OTA DFU function is enabled when I use your commands as below to flash into the chip. It works fine and I can upload the firmware successfully.

    nrfjprog --program bootloader-settings.hex --verify
    nrfjprog --program nordic_buttonless_dfu.hex --verify
    nrfjprog --program s112_nrf52_7.2.0_softdevice.hex --verify
    nrfjprog --program secure_bootloader.hex --verify
    nrfjprog --reset

    In addition, I found my original command works fine as well somehow! 

    It is great that they are working, but I am a bit confused about why it happened. My guessing is I may be misled by the cached service in iOS. I found it always happens when I change the board function. Is there anything that could prevent such thing? What do you suggest?

    Thank you

    Jeremy

  • Hello Jeremy,

    Jeremy Wu said:
    It is great that they are working, but I am a bit confused about why it happened. My guessing is I may be misled by the cached service in iOS. I found it always happens when I change the board function. Is there anything that could prevent such thing? What do you suggest?

    Good that it is working. Yes, it is a bit annoying to run into these kinds of issues when developing. Luckily, this is rarely an issue in a product, as they rarely add/remove services. The only time this occurs is typically through a DFU update (which you are working on now, ironically). 

    There is a service that is used to tell the central that the service table has been updated, and it is included in the buttonless DFU service sample. It is called "Service Changed" service. Search for PM_SERVICE_CHANGED_ENABLED in sdk_config.h to see that it is enabled. This service is not set up and handled like other services, but it is handled by the SDK.

    The issue, though, and the reason I didn't mention it before, is that if the service changed service wasn't present before the phone cached the services, then it wouldn't see the service changed service either. But since it is included in the buttonless_dfu implementation, it makes it so that whenever you add new services/characteristics through DFU, the phone will be told to check for new services after updates, which sort of solves this issue all together. 

    Another way of forcing the phone to do a service discovery is to change the BLE address. The reason I didn't mention this is because that is a bit more complicated when you are doing a DFU. Acutally, the bootloader is using this to force the phone to discover the bootloader service, so the bootloader and the application uses two different addresses (bootloader addr = application addr+1). So if you change the address in the application, you need to change it equally in the bootloader. 

    But in the end, in a final product where the application doesn't change, this is rarely an issue at all. But during development, if you are bothered by this, you can change the address to force the phone to do a service discovery (it will be seen as a completely new device). Just be aware that you need to implement this in the bootloader as well, if you are working on DFU. 

    One way to change the address is to use this function:

    void change_addr(void)
    {
    	ret_code_t err_code;
    	ble_gap_addr_t my_addr;
    	
    	err_code = sd_ble_gap_addr_get(&my_addr);
    	APP_ERROR_CHECK(err_code);
    	
    	my_addr.addr[0] = 0x54;
    	err_code = sd_ble_gap_addr_set(&my_addr);
    	APP_ERROR_CHECK(err_code);
    	
    	NRF_LOG_INFO("Changed addr");
    }

    Note that 0x54 is just a random number. If you are working with DFU, remember to change the address to 0x54 = 0x55. Search for "sd_ble_gap_addr_set" to find where the bootloader changes the address.

    Best regards,

    Edvin

  • Hi Edvin,

    Thank you so much for the detailed explanation!

    Just one more thing I would like to make clear. So once the PM_SERVICE_CHANGED_ENABLED is active, the service change service will be activated? Or do we have to modify our code to make it activated? Because my program (Nordic UART Service) actually sets the parameter 1(active) as the default setting. And it still cached the old service instead of updating the new service. The service I had before is only UART service and the new service I tried to upload is only DFU service.

    Best regards

    Jeremy

Related