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

  • Hi Sean,

    Which SDK version are you testing ? Have you modified anything ? NOINIT is already configured correctly in the dfu_gcc_nrf52.ld file in SDK v11 alpha.

    Have you made sure you enable IS_SRVC_CHANGED_CHARACT_PRESENT = 1 in your application to allow Service changed indication ? A sniffer trace and the log from the DFU tool can tell more on what could be wrong here.

  • I am using the version 9.2 of the SDK, I have not modified the linker file mentioned above, let me find the v11 of the sdk and I will get back to you. Also I have set the IS_SRVC_CHANGED_CHARACT_PRESENT to 1 in my main.c. i will get you a sniffer log shortly

  • I have programmed the bootloader from sdk11 onto my device using the s132 softdevice from sdk9.2 and my bootloader no longer launches the application even though I write : nrfjprog --family nRF52 --memwr 0x7F000 --val 1, so forcing the application to start by writing 0x01 to the bootloader settings address. Additionnally, dfu no longer work either. I have also tried the same thing using the s132 softdevice from sdk11 and I get the same results. What can I do to fix this issue and what additionnal informations would you need to be able to help me? Thanks a lot!

  • 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()
    
  • Hi Seanbites,

    S132 from SDK v0.9.2 is v1.0.0-3 alpha when the S132 from SDK v11 is v2.0.07 alpha. They are not interchange able. Could you let me know what happens when you :

    1. Flash the S132 softdevice from SDK 11 and bootloader (with no modification) from SDK v11. Would the bootloader advertise ?

    2. Use the bootloader to update the application firmware (let's start with an SDK example application) Would the DFU success ? If not, please track a sniffer trace

    3. If it manages to update the application, please try to do buttonless (switch from application to bootloader) and try update without bonding then with bonding.

Related