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

Buttonless DFU custom entry

Hi,

I am using nRF52832 with NUS and buttonless DFU running well next to each other (SDK13). Instead of the standard way to jump to the bootloader (writing a 0x01 to the DFU characteristic) I would like to use a custom command via NUS. I imagine that this would be more secure, because the bootloader can then only be entered if the command is known.

To do that, I need to remove the Bluetooth part of the buttonless DFU, but still keep the part which makes the application jump to the bootloader.

Whats the best way to implement that, does anyone have an idea?

Many thanks, Josef

Parents
  • Hi Josef,

    To enter bootloader, you simply need to write to bootloader setting a flag

    .enter_buttonless_dfu = true;
    

    This is done in enter_bootloader() function. After that you can wait for the flash completed event to disconnect the connection and then when the connection is disconnected (BLE_GAP_EVT_DISCONNECTED) you trigger a soft reset NVIC_SystemReset(); .

    UPDATE: This is only applied for SDK v12 and SDK v13 alpha.

  • Hi, What exactly the problem you are having now ? In our current implementation we still check for gpregret register to enter bootloader mode. So you can do the same as in your buttonless to enter bootloader (write to GPREGRET and the trigget a softreset) Please have a look at nrf_dfu_enter_check() in nrf_dfu.c

Reply Children
No Data
Related