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

dfu fails only if bonded

Hello,

Thanks for reading this! I have an odd behavior on my nrf52832 where I am capable of uploading a new firmware via BLE DFU to the peripheral device if it is not bonded to the central device. However, when I bond, the DFU always fails. I suspect it is for this reason, ie the NOINIT section in the ram is not retaining my bond information when passing to the bootloader. I am using Elcipse GCC, so in order to rectify this, I have to modify this linker script: dfu_gcc_nrf52.ld. I dont know how to do so, can anyone point me in the right direction? Is there any way to check that there is indeed bond information retention?

Thank you very much for your time.

edit for phone screenshot: image description

Parents
  • Here is a log of the original bootloader and application that works except when bonded.

    nRF Master Control Panel, 2016-03-09
    SeanHalo (C5:FA:0B:E9:06:FB)
    V	14:04:31.854	Connecting to C5:FA:0B:E9:06:FB...
    D	14:04:31.870	gatt = device.connectGatt(autoConnect = false)
    D	14:04:32.189	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    D	14:04:32.206	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	14:04:32.218	Connected to C5:FA:0B:E9:06:FB
    D	14:04:32.233	wait(600ms)
    V	14:04:32.859	Discovering services...
    D	14:04:32.874	gatt.discoverServices()
    D	14:04:32.899	[Callback] Services discovered with status: 0
    I	14:04:32.917	Services discovered
    V	14:04:33.047	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)
    Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e)
    - TX Characteristic [N] (6e400003-b5a3-f393-e0a9-e50e24dcca9e)
       Client Characteristic Configuration (0x2902)
    - RX Characteristic [W WNR] (6e400002-b5a3-f393-e0a9-e50e24dcca9e)
    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)
    V	14:04:44.421	Starting pairing...
    D	14:04:44.437	device.createBond()
    D	14:04:44.508	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDING (11)
    D	14:04:48.753	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDED (12)
    I	14:04:48.770	Device bonded
    V	14:04:59.451	Disconnecting...
    D	14:04:59.467	gatt.disconnect()
    D	14:04:59.485	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
    I	14:04:59.498	Disconnected
    D	14:04:59.512	gatt.refresh()
    D	14:04:59.525	gatt.close()
    V	14:04:59.696	[DFU] DFU service started
    V	14:04:59.715	[DFU] Opening file...
    D	14:04:59.803	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    I	14:04:59.971	[DFU] Image file opened (19424 bytes in total)
    D	14:04:59.983	[DFU] wait(1000)
    V	14:05:00.989	[DFU] Connecting to DFU target...
    D	14:05:01.009	[DFU] gatt = device.connectGatt(autoConnect = false)
    E	14:05:31.018	[DFU] Connection failed (0x85): GATT ERROR
    D	14:05:31.102	[DFU] gatt.close()
    V	14:05:31.115	Connecting to C5:FA:0B:E9:06:FB...
    D	14:05:31.126	gatt = device.connectGatt(autoConnect = false)
    D	14:06:01.146	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	14:06:01.161	Error 133 (0x85): GATT ERROR
    I	14:06:01.277	Disconnected
    D	14:06:01.292	gatt.close()
    
Reply
  • Here is a log of the original bootloader and application that works except when bonded.

    nRF Master Control Panel, 2016-03-09
    SeanHalo (C5:FA:0B:E9:06:FB)
    V	14:04:31.854	Connecting to C5:FA:0B:E9:06:FB...
    D	14:04:31.870	gatt = device.connectGatt(autoConnect = false)
    D	14:04:32.189	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    D	14:04:32.206	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	14:04:32.218	Connected to C5:FA:0B:E9:06:FB
    D	14:04:32.233	wait(600ms)
    V	14:04:32.859	Discovering services...
    D	14:04:32.874	gatt.discoverServices()
    D	14:04:32.899	[Callback] Services discovered with status: 0
    I	14:04:32.917	Services discovered
    V	14:04:33.047	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)
    Nordic UART Service (6e400001-b5a3-f393-e0a9-e50e24dcca9e)
    - TX Characteristic [N] (6e400003-b5a3-f393-e0a9-e50e24dcca9e)
       Client Characteristic Configuration (0x2902)
    - RX Characteristic [W WNR] (6e400002-b5a3-f393-e0a9-e50e24dcca9e)
    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)
    V	14:04:44.421	Starting pairing...
    D	14:04:44.437	device.createBond()
    D	14:04:44.508	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDING (11)
    D	14:04:48.753	[Broadcast] Action received: android.bluetooth.device.action.BOND_STATE_CHANGED, bond state changed to: BOND_BONDED (12)
    I	14:04:48.770	Device bonded
    V	14:04:59.451	Disconnecting...
    D	14:04:59.467	gatt.disconnect()
    D	14:04:59.485	[Callback] Connection state changed with status: 0 and new state: DISCONNECTED (0)
    I	14:04:59.498	Disconnected
    D	14:04:59.512	gatt.refresh()
    D	14:04:59.525	gatt.close()
    V	14:04:59.696	[DFU] DFU service started
    V	14:04:59.715	[DFU] Opening file...
    D	14:04:59.803	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    I	14:04:59.971	[DFU] Image file opened (19424 bytes in total)
    D	14:04:59.983	[DFU] wait(1000)
    V	14:05:00.989	[DFU] Connecting to DFU target...
    D	14:05:01.009	[DFU] gatt = device.connectGatt(autoConnect = false)
    E	14:05:31.018	[DFU] Connection failed (0x85): GATT ERROR
    D	14:05:31.102	[DFU] gatt.close()
    V	14:05:31.115	Connecting to C5:FA:0B:E9:06:FB...
    D	14:05:31.126	gatt = device.connectGatt(autoConnect = false)
    D	14:06:01.146	[Callback] Connection state changed with status: 133 and new state: DISCONNECTED (0)
    E	14:06:01.161	Error 133 (0x85): GATT ERROR
    I	14:06:01.277	Disconnected
    D	14:06:01.292	gatt.close()
    
Children
No Data
Related