Adding DFU to the central device ( Scanner)

Hi,

We have nRF52833 based solution wherein we have scanner (central role) and multiple sensors (peripheral role) connect to exchange data.

We have added DFU functionality to peripherals and it works. And, am wondering how to add DFU to central role as it only scans and never advertises? Any example code for the same?

Thanks,

Raghu

Parents
  • Hi Raghu, 

    Could you give more information about the SDK you are using ? Are you using nRF5 SDK or NCS SDK ? 

    How do you do DFU update on the peripheral ? 

  • Hi Hung,

    I am using latest nrF5 SDK 17.x. Currently we are updating peripherals from nRF connect app.

    Thanks,

    Raghu

  • Hi Raghu, 

    The DFU update is handled by the softdevice. So it doesn't matter if it's running on a central device or a peripehral device, the bootloader will act as a peripheral (DFU_Targ) and the phone/PC will act as central to do DFU update. 

    We don't have an example on DFU a central device except for switching using a physical button. 

    If it's not possible , what you need to do is to implement away to put the central to DFU mode via BLE . You can do that by implementing the DFU buttonless service on the central and then use the phone to put the central to DFU mode (write 0x01 to the DFU control characteristic). 

    Could you describe how you imagine DFU on the central would be ? 

  • Hi Hung,

    I did implement buttonless DFU on peripheral. I just added DFU service too along with my custom services. Hence, whenever peripheral was advertising, the nRF connect app can sense the DFU capability and was able to upgrade the device from app.

    But, in case of central device (in my case) i only scan for my peripherals. There is no advertising. Hence, the question of how to add DFU?

    Thanks,

    Raghu

  • Hi Raghu, 


    The DFU buttonless service can also be implemented on a central device (GATT server can be on both peripheral and central)

    The challenge here is that the NRF Connect app on the phone doesn't support advertising and be peripheral to put your central to DFU mode. 
    So you have two option here: 

    1. Write you on app on the phone to advertise and then be connected by the central, after that you can write to the DFU buttonless service and put the central to DFU mode. 

    2. Let the central advertise at the same time doing central. This would requires your central to support being a peripheral and would draw some little more current consumption to advertise. But you don't need to make a new app as in #1. 

Reply
  • Hi Raghu, 


    The DFU buttonless service can also be implemented on a central device (GATT server can be on both peripheral and central)

    The challenge here is that the NRF Connect app on the phone doesn't support advertising and be peripheral to put your central to DFU mode. 
    So you have two option here: 

    1. Write you on app on the phone to advertise and then be connected by the central, after that you can write to the DFU buttonless service and put the central to DFU mode. 

    2. Let the central advertise at the same time doing central. This would requires your central to support being a peripheral and would draw some little more current consumption to advertise. But you don't need to make a new app as in #1. 

Children
No Data
Related