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

force enter the dfu with command

is there any command to forcethe app to enter the dfu mode

i do know the dfu buttonless but this time i want it to use it on uart dfu

Parents
  • Hello,

    Yes, you can force it to enter DFU mode by writing the BOOTLOADER_DFU_START flag to GPREGRET0 followed by a system reset similiar to how it's done in the ble buttonless template example.

    Example

    void enter_dfu_mode (void)
    {
        uint32_t err_code = sd_power_gpregret_clr(0, 0xffffffff);
        APP_ERROR_CHECK(err_code);
    
        err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START);
        APP_ERROR_CHECK(err_code);
        
        NVIC_SystemReset();
    }

Reply
  • Hello,

    Yes, you can force it to enter DFU mode by writing the BOOTLOADER_DFU_START flag to GPREGRET0 followed by a system reset similiar to how it's done in the ble buttonless template example.

    Example

    void enter_dfu_mode (void)
    {
        uint32_t err_code = sd_power_gpregret_clr(0, 0xffffffff);
        APP_ERROR_CHECK(err_code);
    
        err_code = sd_power_gpregret_set(0, BOOTLOADER_DFU_START);
        APP_ERROR_CHECK(err_code);
        
        NVIC_SystemReset();
    }

Children
Related