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

GPREGRET vs BUTTONLESS for app-initiated DFU

Hello,

I'd like to enter bootloader DFU mode from my application code.
I don't want to rely on hardware, which rules out the reset pin (NRF_BL_DFU_ENTER_METHOD_PINRESET) and checking for a low GPIO level (NRF_BL_DFU_ENTER_METHOD_BUTTON) when the bootloader runs (presumably after a power reset).

So this leaves me with (as far as I can tell) two options: NRF_BL_DFU_ENTER_METHOD_GPREGRET and NRF_BL_DFU_ENTER_METHOD_BUTTONLESS.

The former seems straightforward: My app writes a magic value the non-volatile GPREGRET register and then issues a reset:

void enter_dfu(){
  uint32_t old;
  sd_power_gpregret_get(0, &old);
  sd_power_gpregret_set(0, old | BOOTLOADER_DFU_START);
  NVIC_SystemReset();
}



For NRF_BL_DFU_ENTER_METHOD_BUTTONLESS, the docs (infocenter.nordicsemi.com/.../lib_bootloader.html) suggest that my app needs to write to the "settings page".
However, I can't quite figure out where this happens in the ble_app_buttonless_dfu example.

Furthermore, I can't understand the high-level reason why one would choose one of these two methods over the other.
What are the tradeoffs between these two approaches?

Parents Reply
  • Hi, I experienced difficulties to get the dfu buttonless example working (I'm using working with gcc toolchain, SDK 17.0.2, and nRF52840) DK) until I found this topic.

    I couldn't find anywhere in the documentation/release notes ... that NRF_BL_DFU_ENTER_METHOD_BUTTONLESS was obsolete now as a result I couldn't get the buttonless DFU working until today...

    I could be great to indicate this in the dfu buttonless example documentation for instance Slight smile

    Regards,

    Hugo

Children
Related