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

DFU with OTA

Hi,

anyone help me.

I am facing the issue during DFU with OTA. the steps are listed which had I done,

here trying to update softdevice.

1. Erase all.

2.flashed softdevice.

3.complied and programmed the bootloader which has included with SDK example(dfu_ble_dual_bank_s110).

4. the target device start to advertise as  "DfuTarg" with LED status.

5. Open nRF connect on my phone and scanner then found the target device and connected successfully.

6. click the DFU button on the nRF connect mobile app. it displays 4 options. 

7. I chose distributed back. and try to upload the zip file. app showing "starting DFU" and then disconnected

zip files preparation:

1. got the softdevice from the example folder.

2. using nrfutil.exe, the file has made as "xxx.zip". the zip file consists of xxx.bin file, xxx.dat, manifest file.

3. hut here I did n't use any private key like yyy.pem.

note:-

bootloader example: dfu_ble_dual_bank_s110, version 7.2.0.

SDK version 7.2.0

softdevice: s110, version 7.1.0

target device: custom board, nrf51822 QFAA, 16kb ram, 256kb flash memory.

Keil v5.

please correct where I have made a mistake and guide me on what I have to do exactly. 

 

Parents
  • Hi,

    using nrfutil.exe

    What version of nrfutil did you use ? 0.5.x ?

    See this and this link.

  • Satheeshkumar said:
    I used the above settings and tried to build but I got an error like,

     Was this the application or the bootloader project?

     

    Satheeshkumar said:
    then the app started to upload the file to the target device. but failed. 

     Did you get any error code in the app ? Anything in the log that might identify the issue?

  • That is a boot loader project. Please correct me if I made any mistake in the configuration settings

  • Is there any incompatible with the target device hardware specification?

  • please find the logs file. Here I have tried updating softdevice and got the error.

    nRF Connect, 2019-12-11
    DfuTarg (FC:11:CC:F5:BE:5B)
    V	11:44:59.750	Connecting to FC:11:CC:F5:BE:5B...
    D	11:44:59.751	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	11:44:59.977	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	11:44:59.977	Connected to FC:11:CC:F5:BE:5B
    V	11:45:00.002	Discovering services...
    D	11:45:00.002	gatt.discoverServices()
    D	11:45:00.004	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    I	11:45:00.378	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	11:45:00.592	[Callback] Services discovered with status: 0
    I	11:45:00.592	Services discovered
    V	11:45:00.619	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Generic Attribute (0x1801)
    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)
    I	11:45:00.652	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 4000ms)
    I	11:45:00.957	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 4000ms)
    V	11:45:14.092	[DFU] DFU service started
    V	11:45:14.092	[DFU] Opening file...
    I	11:45:14.098	[DFU] Firmware file opened successfully
    V	11:45:14.098	[DFU] Connecting to DFU target...
    D	11:45:14.099	[DFU] gatt = device.connectGatt(autoConnect = false)
    I	11:45:14.114	[DFU] Connected to FC:11:CC:F5:BE:5B
    V	11:45:14.114	[DFU] Discovering services...
    D	11:45:14.114	[DFU] gatt.discoverServices()
    I	11:45:14.123	[DFU] Services discovered
    D	11:45:14.147	[DFU] wait(1000)
    V	11:45:15.183	[DFU] Reading DFU version number...
    D	11:45:15.183	[DFU] gatt.readCharacteristic(00001534-1212-efde-1523-785feabcd123)
    I	11:45:15.183	[DFU] Read Response received from 00001534-1212-efde-1523-785feabcd123, value (0x): 05-00
    A	11:45:15.183	[DFU] Version number read: 0.5
    D	11:45:15.183	[DFU] wait(1000)
    V	11:45:16.169	[DFU] Enabling notifications for 00001531-1212-efde-1523-785feabcd123
    D	11:45:16.169	[DFU] gatt.setCharacteristicNotification(00001531-1212-efde-1523-785feabcd123, true)
    D	11:45:16.173	[DFU] gatt.writeDescriptor(00002902-0000-1000-8000-00805f9b34fb, value=0x01-00)
    I	11:45:16.235	[DFU] Data written to descr.00001531-1212-efde-1523-785feabcd123, value (0x): 01-00
    V	11:45:16.235	[DFU] Notifications enabled for 00001531-1212-efde-1523-785feabcd123
    A	11:45:16.235	[DFU] Notifications enabled
    D	11:45:16.235	[DFU] wait(1000)
    V	11:45:17.214	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	11:45:17.214	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	11:45:17.246	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 01-01
    A	11:45:17.247	[DFU] DFU Start sent (Op Code = 1, Upload Mode = 1)
    V	11:45:17.247	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
    D	11:45:17.247	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
    I	11:45:17.251	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): 0C-42-01-00-00-00-00-00-00-00-00-00
    A	11:45:17.253	[DFU] Firmware image size sent (82444b, 0b, 0b)
    I	11:45:18.553	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-01-01
    A	11:45:18.553	[DFU] Response received (Op Code = 1 Status = 1)
    A	11:45:18.553	[DFU] Writing Initialize DFU Parameters...
    V	11:45:18.554	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	11:45:18.554	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	11:45:18.581	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-00
    V	11:45:18.582	[DFU] Writing to characteristic 00001532-1212-efde-1523-785feabcd123
    D	11:45:18.582	[DFU] gatt.writeCharacteristic(00001532-1212-efde-1523-785feabcd123)
    I	11:45:18.586	[DFU] Data written to 00001532-1212-efde-1523-785feabcd123, value (0x): FF-FF-FF-FF-FF-FF-FF-FF-01-00-5A-00-7D-C6
    V	11:45:18.586	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	11:45:18.586	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	11:45:18.657	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 02-01
    I	11:45:18.659	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-02-01
    A	11:45:18.659	[DFU] Initialize DFU Parameters completed
    A	11:45:18.659	[DFU] Response received (Op Code = 2, Status = 1)
    V	11:45:18.659	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	11:45:18.660	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	11:45:18.701	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 08-0A-00
    A	11:45:18.702	[DFU] Packet Receipt Notif Req (Op Code = 8) sent (Value = 10)
    V	11:45:18.702	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	11:45:18.702	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    I	11:45:18.731	[DFU] Data written to 00001531-1212-efde-1523-785feabcd123, value (0x): 03
    A	11:45:18.732	[DFU] Receive Firmware Image request sent
    A	11:45:18.778	[DFU] Uploading firmware...
    V	11:45:18.778	[DFU] Sending firmware to characteristic 00001532-1212-efde-1523-785feabcd123...
    I	11:45:18.927	[DFU] Notification received from 00001531-1212-efde-1523-785feabcd123, value (0x): 10-03-06
    A	11:45:18.927	[DFU] Response received (Op Code = 3, Status = 6)
    E	11:45:18.929	[DFU] Remote DFU error: OPERATION FAILED
    V	11:45:18.929	[DFU] Writing to characteristic 00001531-1212-efde-1523-785feabcd123
    D	11:45:18.929	[DFU] gatt.writeCharacteristic(00001531-1212-efde-1523-785feabcd123)
    A	11:45:22.968	[DFU] Reset request sent
    V	11:45:22.969	[DFU] Disconnecting...
    D	11:45:22.970	[Callback] Connection state changed with status: 8 and new state: DISCONNECTED (0)
    E	11:45:22.970	Error 8 (0x8): GATT CONN TIMEOUT
    I	11:45:22.970	Disconnected
    D	11:45:23.014	[DFU] gatt.disconnect()
    I	11:45:23.014	[DFU] Disconnected
    D	11:45:23.014	[DFU] gatt.refresh() (hidden)
    D	11:45:23.014	[DFU] gatt.close()
    D	11:45:23.025	[Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	11:45:23.025	[DFU] wait(600)
    D	11:45:23.049	[DFU] [Broadcast] Action received: android.bluetooth.device.action.ACL_DISCONNECTED
    D	11:45:23.635	gatt.close()
    D	11:45:23.640	wait(200)
    V	11:45:23.844	Connecting to FC:11:CC:F5:BE:5B...
    D	11:45:23.845	gatt = device.connectGatt(autoConnect = false, TRANSPORT_LE, preferred PHY = LE 1M)
    D	11:45:24.117	[Callback] Connection state changed with status: 0 and new state: CONNECTED (2)
    I	11:45:24.117	Connected to FC:11:CC:F5:BE:5B
    D	11:45:24.159	[Broadcast] Action received: android.bluetooth.device.action.ACL_CONNECTED
    V	11:45:24.167	Discovering services...
    D	11:45:24.167	gatt.discoverServices()
    I	11:45:24.508	Connection parameters updated (interval: 7.5ms, latency: 0, timeout: 5000ms)
    D	11:45:24.726	[Callback] Services discovered with status: 0
    I	11:45:24.726	Services discovered
    V	11:45:24.754	Generic Access (0x1800)
    - Device Name [R W] (0x2A00)
    - Appearance [R] (0x2A01)
    - Peripheral Preferred Connection Parameters [R] (0x2A04)
    Generic Attribute (0x1801)
    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)
    I	11:45:24.793	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 4000ms)
    I	11:45:25.078	Connection parameters updated (interval: 15.0ms, latency: 0, timeout: 4000ms)
    

  • Satheeshkumar said:
    Here I have tried updating softdevice

    What SoftDevice version are you updating from and to ?

    Can you post the nrfutil command you used to generate the zipfile package ?  

    Is application DFU working ?

Reply Children
  • I have already posted the nrfutil command. Please check in the image of the previous post.

    The target device has flashed with s110_7.1.0_softdevice.hex and bootloader firmware.

    Updating firmware got from test_ble_dual_bank folder in dfu example folder. I think the updating firmware file version is 0xFFFE.

    Bootloader firmware atarted to advertise that named as ""DfuTarg".

  • here I have attached the full example source which I am using currently.

    1. bootloader source file.

    2. actual softdevice file(s110_nrf51822_7.1.0_softdevice.hex).

    3. test softdevice firmware(dfu_test_softdevice_b.hex) that need to update via ble.

    4. this is the nrfutil command (nrfutil dfu genpkg --softdevice softdevice.hex --dev-type 0xffff --dev-revision 0xffff --sd-req 0x5a softdevice.zip).

    I used a custom board with nrf51822 QFAA(16kb ram, 256 kb).

    here's my attachment.

    8244.dfu.zip

    please give me the solution. 

  • Hi,

    Satheeshkumar said:
    in that forum, they suggested reducing the stack size from 2048 to 255 in amr_startup_nrf51.s file.

     You should set this back to 2048.

    Since you are using S110, you can instead adjust the IRAM1 value. Instead of start 0x20002C00, try start 0x20002000 and Size 0x1f80:

    IRAM1 Start: 0x20002000
    IRAM1 Size: 0x1f80

    Also check that you have this buffer configuration (hci_mem_pool_internal.h):

    #ifndef MEM_POOL_INTERNAL_H__
    #define MEM_POOL_INTERNAL_H__
    
    #define TX_BUF_SIZE       4u    /**< TX buffer size in bytes. */
    #define RX_BUF_SIZE       32u   /**< RX buffer size in bytes. */
    
    #define RX_BUF_QUEUE_SIZE 8u    /**< RX buffer element size. */
    
    #endif // MEM_POOL_INTERNAL_H__
     
    /** @} */ 

  • hey man, thank you so much. it is working. 

    #ifndef MEM_POOL_INTERNAL_H__
    #define MEM_POOL_INTERNAL_H__

    #define TX_BUF_SIZE 4u //600u /**< TX buffer size in bytes. */
    #define RX_BUF_SIZE 32u //TX_BUF_SIZE /**< RX buffer size in bytes. */

    #define RX_BUF_QUEUE_SIZE 8u//4u /**< RX buffer element size. */

    #endif

    I changed as you mentioned in the latest post. so It had been a buffer size issue. now I can able update the application and softdevice.

Related