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

DFU controller in central nRF52 device

Hi Nordic team,

Is there any sample project which implements DFU controller in nRF52832 central device? I need to update peripheral device firmware from central device by using DFU. In my another project, I was able to implement DFU target in peri device and succeeded firmware update from android app using SDK. So, I can say DFU target is ready. I just need DFU controller in centeral device.

Please advise any sample project which can help my developement of DFU controller.

Thansk,

Robin

  • Hi,

    Robin said:
    (1) how to parse the indication value "0x200101" and what's next step?

    You can check the buttonless DFU service implementation for details. Searching for ble_dfu_buttonless_resp_send will show you everything that is indicated from the nRF to the DFU master at this stage.

    If you use DFU without bonding there is not that much that is communicated here. There is always DFU_OP_ENTER_BOOTLOADER (0x01), and the response is either DFU_RSP_BUSY (0x06) or DFU_RSP_SUCCESS (0x01). The last possibility is DFU_RSP_OPERATION_FAILED (0x04) and then the response code could be one of many, but that is typically only relevant for debugging. The key information is that it failed.

    Robin said:
    (2) where to find buttonless protocol document.

    You can refer to the Buttonless Secure DFU Service documentation in the SDK.

  • Hi,

    I could make the device move to DFU mode by using Buttonless service. Now, I could make a connection to DfuTarg device, and established dfu service. I am working on implementing the DFU protocol. Following is logs I got so far.

        tx: 0601 // SELECT CMD

        rx: 600601000200000000000000000000 // SELECT RSP

        tx: 01010000008d000000 // CREATE CMD

        rx: 600104 // CREATE RSP

    When I sent SELECT message, I am getting SELECT Response message with offset=0x200, crc=0, max_len=0. But I have no idea whether these parameters are valid or not. Can you please explain what the offset, crc and max_len means and how I should handle these parameters?

    When I sent CREATE message with obj_type=1 and obj_size=141 (which is app.dat file size), I got the result code 04 (insufficient resources). Can you please advise how to solve this error?

    Thanks,

  • I solved this problem. For SELECT RSP message, the parameter ordering was wrong. the right order is max_len, crc, and then offset. so, I can parse it as max_len=0x200, crc=0, offset=0. For CREATE RSP, the CREATE CMD message was wrong. obj_type should be 1 byte not 4 bytes. Thus, when I sent "01018d000000" I got write response "600101".

  • Robin: I have the exact same need: DFU update of nrf52 targets from and nrf52 controller over BLE (long range).  Did you ever make it work??

    Nordic: In reading about the complexity of doing this over BLE, I was wondering if a workaround would be to download the DFU zip file to target using a simple file transfer protocol, like XMODEM style, but with BLE packets.   Then after files is on target, start the DFU process locally.   What that make thing simpler? Is there an example of how to start DFU process on NRF52 target with local file?

  • There are ways to do this, though there is no example in the SDK. The closest is probably to look at the SDK for ZigBee and Thread as suggested in this post, as it does basically that (unlike for the BLE bootloader, in the ZigBee case the transport happens in the application, and the bootloader only activates the image that is already downloaded).

Related