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

DFU from central to peripheral

Hi All,

    We are using nrf52840 and SDK version 'SDK-15.3.0'. We have developed a network of nrf52840 (peripherals). We are using mobile Bluetooth to update the peripheral firmware update. I want to do the same DFU functionality from the central master(nrf52840), instead of mobile will connect the central master(nrf52840) with the PC and run 'nrfutil' to transfer the packets from central to the peripheral via BLE.

  1. Can we have any example code for DFU from central to peripheral over BLE?
  2. What steps we have to follow from package creation to DFU.

    Thank you,

    Kashif

   

Parents
  • # We have successfully updated the DFU to the target device (nrf52840) from a central Device(nrf52840) connected with a PC via USB(Power) and Jlink-Programmer.
    Target device should have the bootloader and softdevice and the main application. 
    # Flash the Image to the Central device connected with PC:
     - Install the nrfutil and nrfjprog
      
      Command to install nrfutil - Use python3.8:
        > python38 -m pip install nrfutil
        > for nrfjprog install the NRF command-line tool
       
      - run the following commands from python lib to flash the central device. Go the directory
            
        $ cd C:\Users\kashif\AppData\Local\Programs\Python\Python38\Lib\site-packages\pc_ble_driver_py\hex\sd_api_v5
      
       - Erase the central device:
        
         > nrfjprog --eraseall
            Erasing user available code and UICR flash areas.
            Applying system reset.
       -  Flash Softdevice:
        > nrfjprog --family nRF52 --program s132_nrf52_5.1.0_softdevice.hex
            Parsing hex file.
            Reading flash area to program to guarantee it is erased.
            Checking that the area to write is not protected.
            Programming device.
        - Flash the connectivity Firmware
        > nrfjprog  --family nRF52 --program connectivity_4.1.2_usb_with_s132_5.1.0.hex --verify --chiperase 
            Parsing hex file.
            Reading flash area to program to guarantee it is erased.
            Checking that the area to write is not protected.
            Programming device.               

    # Initialize the DFU for the target device:

     - Go to the directory where the package is availabe
     
    > nrfutil -v -v -v -v dfu ble -ic NRF52 -pkg WSCB_NordicFW_IAR.zip -p COM102 -n "DfuTarg"
    **WSCB_NordicFW_IAR.zip**: package to be flashed in the target device
    **COM102**: comport device for the central device connected on host PC
    **DfuTarg**:target device name.
        
    Thank You!
    K.Khan
  • Thank you for the update! It looks like you figured it out.

Reply Children
No Data
Related