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

button detection in the DFU bootloader

I'm using the nRF52 + SDK11.0.0 + s132. I have a single physical button on my hardware that can be used to toggle power to the system (though a PMIC). This same button routes to a GPIO on the nRF52. How can I modify the DFU bootloader to check if the button is pressed, say, for 2 seconds after power up before loading the bootloader?

  • Hi Tosa,

    Yes, I don't see any problem implementing that.

    The way the bootloader works now is to check if the button is pressed when booting up and then enter the DFU mode immediately. What you can do is to implement a timer and check if after 2 seconds (you can set the timer to check every 100ms for example) and the button is pressed continuously without releasing then you enter DFU bootloader mode, otherwise if the button is released before 2 seconds then you break and enter the application.

Related