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

Best way to Enter DFU Mode from software.

Hi there, 

I would like to set my dongle into DFU mode from software, I am using the USB-CDC-ACM class, and the softdevice as a central device. 

Ideally I would send a command to the dongle and it will jump into reset and then go into DFU mode, the same way it does when the reset buttons is pressed.

What would be the best approach to do this ? 

Cheers, 

Parents Reply
  • Hi Felipe, 

    The USB DFU trigger library can be included in an application to allow the USB host to put the nRF52840 Dongle in DFU mode. This is for instance used in the Connectivity firmware that is used by the nRF Connect BLE app. See the nRF5_SDK_17.0.2_d674dde_old\examples\connectivity\ble_connectivity\pca10059\ser_s140_usb_hci example, where nrf_dfu_trigger_usb_init() is called in usbd_enable(). 

    Curiosus said:
    What would be the procedure to set the device to DFU mode from the application in the same way it does when the push button is pressed ?

    The similar sentences in that tutorial essentially mean that to enter DFU mode on the dongle you do a pin reset, which happens to be on the sideways button. It uses the PINRESET as one of the methods to enter the bootloader (NRF_BL_DFU_ENTER_METHOD_PINRESET). You can take a look at the nRF5_SDK\examples\dfu\open_bootloader\pca10059_usb_debug, where the Open Bootloader is configured to enter DFU mode after pinresets by default (can be disabled in sdk_config.h). It detects this by reading out the POWER->RESETREAS on boot. 

    -Amanda H.

Children
Related