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

nRF52840 Dongle Zephyr: Jump to DFU/bootloader (buttonless)

Hi,

I'm using nRF52840 dongle and nRF connect SDK 1.6.0 (Zephyr) to create a BLE HID + USB CDC device.
Is it possible to jump to bootloader from application code (or ideally have it triggered over USB by nrfutil)?

I understand that with old nRF SDK you would be able to use DFU library but looking trough the nRF Connect SDK, I can't find any reference
or examples on how to jump to bootloader without using buttons.

Is there a Zephyr configuration and/or library/module example available that shows how to do this?
If not, would it be possible to do it in a "hacky" way by modifying registers and instructing the MCU to jump to bootloader address?

edit: Just to clarify, I would like to use DFU feature over USB (not OTA).

Thanks,
Sasa

Parents Reply
  • Hi, 

    Sorry that I also have the same problem and my dongle will not able to enable dfu mode after pull down P0.19

    Would you help to check if any wrong with my code?

    #define RESET_PIN    DT_GPIO_PIN(DT_ALIAS(resetpin), gpios)
    
    static inline void reset_to_bootloader()
    {
        gpio_pin_configure(dev, BIT(RESET_PIN), GPIO_INPUT | GPIO_PULL_DOWN);
    }

    dts:

    buttons {
    		compatible = "gpio-keys";
    		button0: button_0 {
    			gpios = <&gpio1 6 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    			label = "Push button switch 0";
    		};
            button1: button_1 {
    			gpios = <&gpio0 19 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
    			label = "Push button switch 1";
    		};
    		...
    	};
    	
    	aliases {
    		sw0 = &button0;
    		resetpin = &button1;
    		...
    		};

    Thanks so much!

Children
Related