Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF52832 dfu failure, but dfu success when connected customized board with Jlink RTT viewer by jlink(SWD) . How can i solve the bug?

environment:

1. nRF52832 

2. nRF5_SDK_11.0.0_89a8197

3. s132_nrf52_2.0.0_softdevice.hex

4. nRF5_SDK\nRF5_SDK_11.0.0_89a8197\examples\dfu\bootloader\pca10040\dual_bank_ble_s132\arm5_no_packs

5. win7 32bit

6. keil v5.26

7. nrf connect

bootloader rom&ram:

app rom&ram:

i use the nrf connect on the android phone to connect the customized board and then upgraded through the DFU in its upper right corner. But the upgrade failed.The error message is as follows.

D 22:13:40.431 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 22:13:40.434 gatt.setCharacteristicNotification(00000003-1212-efde-1523-785feabcd123, true)
I 22:13:40.499 Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)
V 22:14:13.035 [DFU] DFU service started
V 22:14:13.035 [DFU] Opening file...
I 22:14:13.035 [DFU] Firmware file opened successfully
V 22:14:13.035 [DFU] Connecting to DFU target...
D 22:14:13.051 [DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
I 22:14:13.094 [DFU] Connected to FA:8C:CB:A4:3A:0B
V 22:14:13.095 [DFU] Discovering services...
D 22:14:13.095 [DFU] gatt.discoverServices()
I 22:14:13.113 [DFU] Services discovered
D 22:14:13.121 [DFU] wait(1000)
V 22:14:14.138 [DFU] Reading DFU version number...
D 22:14:14.138 [DFU] gatt.readCharacteristic(00001534-1212-efde-1523-785feabcd123)
I 22:14:14.186 [DFU] Read Response received from 00001534-1212-efde-1523-785feabcd123, value (0x): 01-00
A 22:14:14.187 [DFU] Version number read: 0.1
W 22:14:14.189 [DFU] Application with buttonless update found
V 22:14:14.190 [DFU] Jumping to the DFU Bootloader...
V 22:14:14.190 [DFU] Enabling notifications for 00001531-1212-efde-1523-785feabcd123
D 22:14:14.190 [DFU] gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
D 22:14:14.191 [DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
I 22:14:14.283 [DFU] Data written to descr.00001531-1212-efde-1523-785feabcd123, value (0x): 01-00
V 22:14:14.283 [DFU] Notifications enabled for 00001531-1212-efde-1523-785feabcd123
A 22:14:14.283 [DFU] Notifications enabled
D 22:14:14.283 [DFU] wait(1000)
V 22:14:15.303 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 22:14:15.303 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
A 22:14:15.355 [DFU] Jump to bootloader sent (Op Code = 1, Upload Mode = 4)
D 22:14:15.651 [Callback] Connection state changed with status: 19 and new state: DISCONNECTED (0)
W 22:14:15.651 Connection terminated by peer (status 19)
I 22:14:15.651 Disconnected
I 22:14:15.680 [DFU] Disconnected by the remote device
D 22:14:15.680 [DFU] gatt.refresh() (hidden)
D 22:14:15.680 [DFU] gatt.disconnect()
D 22:14:15.680 [DFU] gatt.close()
D 22:14:15.686 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 22:14:15.705 [DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
V 22:14:15.719 [DFU] DFU service started
I 22:14:15.719 [DFU] Firmware file opened successfully
D 22:14:15.719 [DFU] wait(1000)
D 22:14:16.719 [DFU] wait(1000)
V 22:14:17.729 [DFU] Connecting to DFU target...
D 22:14:17.767 [DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
I 22:14:18.011 [DFU] Connected to FA:8C:CB:A4:3A:0B
V 22:14:18.012 [DFU] Discovering services...
D 22:14:18.012 [DFU] gatt.discoverServices()
D 22:14:18.018 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D 22:14:18.018 [DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
I 22:14:18.749 [DFU] Services discovered
W 22:14:18.749 [DFU] DFU Service not found
V 22:14:18.750 [DFU] Disconnecting...
D 22:14:18.775 [DFU] gatt.disconnect()
I 22:14:18.775 [DFU] Disconnected
D 22:14:18.775 [DFU] gatt.refresh() (hidden)
D 22:14:18.775 [DFU] gatt.disconnect()
D 22:14:18.777 [DFU] gatt.close()
D 22:14:18.778 [DFU] wait(600)
D 22:14:19.382 gatt.close()
D 22:14:19.384 wait(200)
V 22:14:19.586 Connecting to FA:8C:CB:A4:3A:0B...
D 22:14:19.586 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D 22:14:19.621 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 22:14:19.621 Connected to FA:8C:CB:A4:3A:0B
V 22:14:19.698 Discovering services...
D 22:14:19.698 gatt.discoverServices()
D 22:14:23.852 [Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
E 22:14:23.852 Error 8 (0x8): GATT CONN TIMEOUT
I 22:14:23.852 Disconnected
D 22:14:23.862 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED

Connect the customized board to the computer through jlink.And open the jlink rtt viewer on the computer.  Click file-Connect command of Jlink rtt viewer.Then dfu upgrade successfully.The message is as follows.

V 21:07:11.180 [DFU] DFU service started
V 21:07:11.180 [DFU] Opening file...
I 21:07:11.180 [DFU] Firmware file opened successfully
V 21:07:11.180 [DFU] Connecting to DFU target...
D 21:07:11.180 [DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
I 21:07:11.231 [DFU] Connected to FA:8C:CB:A6:30:C2
V 21:07:11.234 [DFU] Discovering services...
D 21:07:11.234 [DFU] gatt.discoverServices()
I 21:07:11.249 [DFU] Services discovered
D 21:07:11.271 [DFU] wait(1000)
V 21:07:12.262 [DFU] Reading DFU version number...
D 21:07:12.262 [DFU] gatt.readCharacteristic(00001534-1212-efde-1523-785feabcd123)
I 21:07:12.446 [DFU] Read Response received from 00001534-1212-efde-1523-785feabcd123, value (0x): 01-00
A 21:07:12.448 [DFU] Version number read: 0.1
W 21:07:12.453 [DFU] Application with buttonless update found
V 21:07:12.453 [DFU] Jumping to the DFU Bootloader...
V 21:07:12.453 [DFU] Enabling notifications for 00001531-1212-efde-1523-785feabcd123
D 21:07:12.453 [DFU] gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
D 21:07:12.455 [DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
I 21:07:12.641 [DFU] Data written to descr.00001531-1212-efde-1523-785feabcd123, value (0x): 01-00
V 21:07:12.641 [DFU] Notifications enabled for 00001531-1212-efde-1523-785feabcd123
A 21:07:12.642 [DFU] Notifications enabled
D 21:07:12.642 [DFU] wait(1000)
V 21:07:13.669 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 21:07:13.669 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
A 21:07:13.811 [DFU] Jump to bootloader sent (Op Code = 1, Upload Mode = 4)
D 21:07:14.401 [Callback] Connection state changed with status: 19 and new state: DISCONNECTED (0)
W 21:07:14.401 Connection terminated by peer (status 19)
I 21:07:14.401 Disconnected
I 21:07:14.411 [DFU] Disconnected by the remote device
D 21:07:14.455 [DFU] gatt.refresh() (hidden)
D 21:07:14.455 [DFU] gatt.disconnect()
D 21:07:14.455 [DFU] gatt.close()
D 21:07:14.456 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 21:07:14.456 [DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
V 21:07:14.489 [DFU] DFU service started
I 21:07:14.489 [DFU] Firmware file opened successfully
D 21:07:14.489 [DFU] wait(1000)
D 21:07:15.489 [DFU] wait(1000)
V 21:07:16.488 [DFU] Connecting to DFU target...
D 21:07:16.521 [DFU] gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferredPhy = LE_1M | LE_2M)
I 21:07:16.773 [DFU] Connected to FA:8C:CB:A6:30:C2
V 21:07:16.774 [DFU] Discovering services...
D 21:07:16.774 [DFU] gatt.discoverServices()
D 21:07:16.774 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
D 21:07:16.774 [DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
I 21:07:17.596 [DFU] Services discovered
D 21:07:17.616 [DFU] wait(1000)
V 21:07:18.610 [DFU] Reading DFU version number...
D 21:07:18.610 [DFU] gatt.readCharacteristic(00001534-1212-efde-1523-785feabcd123)
I 21:07:18.674 [DFU] Read Response received from 00001534-1212-efde-1523-785feabcd123, value (0x): 08-00
A 21:07:18.674 [DFU] Version number read: 0.8
D 21:07:18.676 [DFU] wait(1000)
V 21:07:19.676 [DFU] Enabling notifications for 00001531-1212-efde-1523-785feabcd123
D 21:07:19.676 [DFU] gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
D 21:07:19.678 [DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
I 21:07:19.722 [DFU] Data written to descr.00001531-1212-efde-1523-785feabcd123, value (0x): 01-00
V 21:07:19.722 [DFU] Notifications enabled for 00001531-1212-efde-1523-785feabcd123
A 21:07:19.722 [DFU] Notifications enabled
D 21:07:19.722 [DFU] wait(1000)
V 21:07:20.733 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 21:07:20.733 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 21:07:20.772 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 01-04
A 21:07:20.772 [DFU] DFU Start sent (Op Code = 1, Upload Mode = 4)
V 21:07:20.772 [DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D 21:07:20.772 [DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I 21:07:20.774 [DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): 00-00-00-00-00-00-00-00-BC-E1-00-00
A 21:07:20.774 [DFU] Firmware image size sent (0b, 0b, 57788b)
I 21:07:21.612 [DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-01-01
A 21:07:21.612 [DFU] Response received (Op Code = 1 Status = 1)
A 21:07:21.612 [DFU] Writing Initialize DFU Parameters...
V 21:07:21.612 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 21:07:21.612 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 21:07:21.671 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-00
V 21:07:21.672 [DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
D 21:07:21.672 [DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
I 21:07:21.674 [DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): FF-FF-FF-FF-FF-FF-FF-FF-01-00-81-00-FD-06
V 21:07:21.674 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 21:07:21.674 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 21:07:21.731 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-01
A 21:07:21.732 [DFU] Initialize DFU Parameters completed
I 21:07:21.732 [DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-02-01
A 21:07:21.732 [DFU] Response received (Op Code = 2, Status = 1)
V 21:07:21.732 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 21:07:21.732 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 21:07:21.806 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 08-0A-00
A 21:07:21.806 [DFU] Packet Receipt Notif Req (Op Code = 8) sent (Value = 10)
V 21:07:21.806 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 21:07:21.806 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 21:07:21.852 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 03
A 21:07:21.852 [DFU] Receive Firmware Image request sent
A 21:07:21.886 [DFU] Uploading firmware...
V 21:07:21.886 [DFU] Sending firmware to characteristic 00001532-1212-efde-1523-785feabcd123...
I 21:07:49.783 [DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-03-01
A 21:07:49.784 [DFU] Response received (Op Code = 3, Status = 1)
A 21:07:49.784 [DFU] Upload completed in 27932 ms
V 21:07:49.784 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 21:07:49.784 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 21:07:49.844 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 04
I 21:07:49.846 [DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-04-01
A 21:07:49.846 [DFU] Validate request sent
A 21:07:49.846 [DFU] Response received (Op Code = 4, Status = 1)
V 21:07:49.866 [DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
D 21:07:49.866 [DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
I 21:07:49.902 [DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 05
A 21:07:49.902 [DFU] Activate and Reset request sent
I 21:07:50.088 [DFU] Disconnected by the remote device
D 21:07:50.088 [DFU] gatt.refresh() (hidden)
D 21:07:50.090 [DFU] gatt.disconnect()
D 21:07:50.094 [DFU] gatt.close()
D 21:07:50.103 [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 21:07:50.104 [DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
D 21:07:50.123 [DFU] wait(1400)
D 21:07:51.537 gatt.close()
D 21:07:51.539 wait(200)
V 21:07:51.741 Connecting to FA:8C:CB:A6:30:C2...
D 21:07:51.741 gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
D 21:07:52.052 [Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
I 21:07:52.052 Connected to FA:8C:CB:A6:30:C2
D 21:07:52.105 [Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
V 21:07:52.105 Discovering services...
D 21:07:52.105 gatt.discoverServices()
I 21:07:52.388 Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
D 21:07:52.744 [Callback] Services discovered with status: 0
I 21:07:52.744 Services discovered
V 21:07:52.772 Generic Access (0x1800)
- Device Name [R W] (0x2A00)
- Appearance [R] (0x2A01)
- Peripheral Preferred Connection Parameters [R] (0x2A04)
Generic Attribute (0x1801)
- Service Changed [I] (0x2A05)
   Client Characteristic Configuration (0x2902)
Device Firmware Update Service (00001530-1212-efde-1523-785feabcd123)
- DFU Packet [WNR] (00001532-1212-efde-1523-785feabcd123)
- DFU Control Point [N W] (00001531-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
- DFU Version [R] (00001534-1212-efde-1523-785feabcd123)
Unknown Service (00000001-1212-efde-1523-785feabcd123)
- Unknown Characteristic [N] (00000003-1212-efde-1523-785feabcd123)
   Client Characteristic Configuration (0x2902)
- Unknown Characteristic [W WNR] (00000002-1212-efde-1523-785feabcd123)
Unknown Service (00007ed3-0000-1000-8000-00805f9b34fb)
- Manufacturer Name String [R] (0x2A29)
D 21:07:52.772 gatt.setCharacteristicNotification(00002a05-0000-1000-8000-00805f9b34fb, true)
D 21:07:52.775 gatt.setCharacteristicNotification(00000003-1212-efde-1523-785feabcd123, true)
I 21:07:52.822 Connection parameters updated (interval: 48.75ms, latency: 0, timeout: 5000ms)

Parents Reply Children
  • Hi Bui,

       Thanks a lot.

       I am sorrry that i have not a sniffer tace tool. 

       I have tested that case turned  off bluetooth and restart the phone many times.The result is that DFU failure. I added some log states(NRF_LOG_PRINTF()) for debug that bug. 

       Attached is the RTT log.45565666.log

     

       when the customized board connect RTT logger, the DFU upgrade successfuly each time.

       

  • Hi Sunwell, 
    If you have any nRF51 or nRF52 development kit you can use it as a BLE sniffer trace. 

    Do you have the 32kHz crystal on the custom board ? I suspect that it could be related to the LFCLK , when connecting with RTT it would keep the debuging interface running which keeps the LFCLK running. Could you post the schematic of the custom board ?

    If you run the same example on the nRF51 Development Kit do you see the same issue ? 

  • Hi Bui,

         I've been too busy these two days. And I reply you now.

        

         I have a set of nrf52840 DK. and set  up the environment of PC. Flash the sniffer hex file of nrf52840 to nrf52840 also.But I haven't caught the packet yet.

         The custom board without 32KHz crystal uses internal RC. I also suspect that it doesn't work properly. I run the same example on the nRF51 DK next days and give you feedback.

         If the RC don't work, then what should  i do?

         thanks.

  • Hi Sunwell, 

    Please try to make the sniffer works. 
    Have you made sure the softdevice is initialized with RC instead of crystal in the bootloader ? 
    If the board works with other BLE application/example then RC should be fine. 

    Please try to find a way to debug when not connecting to RTT, for example using UART log, or toggle GPIO pin.

Related