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();
    }

  • I know this but my question is using a command to force enter dfu mode

    and i found a way to do this

    but this is a one way force in the dfu mode

    basically i just erase the setting.hex section to make the board caanot enter the app mode

    this is a way to force enter the dfu mode although it is a one way method

    use in urgent time

    @ECHO ON
     nrfjprog --family nrf52 --erasepage 0xFE000-0xFF001
    @ECHO ON
     nrfjprog --family nrf52 --memrd 0xFF000
    @ECHO ON
     nrfjprog --family nrf52 --memwr 0xFF000 --val 1
    @ECHO ON
    nrfjprog -f nrf52 --reset
    @ECHO ON
     nrfjprog --family nrf52 --memrd 0xFF000

  • Yes, erasing the settings page is one way to do it. I did not know you had a debugger connected. I assumed you wanted to enter DFU mode after receiving a specific command over UART.

Reply Children
No Data
Related