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

Real Button to trigger DFU for an Buttonless application (nRF52832 / SD V15.0.0)

Hello,

We have a Buttonless custom board based on a nRF5282 with SDK 15.0.0

The DFU OTA Buttonless works fine, but to prevent the device to brick we put a physical button to trigger the bootloader in case of crash.

This button is aimed to be pressed like for 10 seconds to trigger the Bootloader.

I guess I 've to modify the Bootloader putting in the main() a timer to catch the duration the button is being pressed right?

Or is there anything else to be done like managing the GPREGRET register.

Thanks,

JohnM

Parents
  • Hello John,

    There are probably several ways of achieving this, but I would suggest to try something like this:

    1. Start a one off app timer instance once the app detects a button press, and when receiving the timer timeout callback, check if the pin is still pressed. Then perform a soft reset if the pin was pressed for x seconds. Alternatively, poll the input state every second to ensure the button was pressed the entire time. 

    2.  In sdk_config.h header for bootloader, make sure NRF_BL_DFU_ENTER_METHOD_BUTTON is enabled and NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN is assigned to the same pin as the one used by the app. Note: bootloader button initialization need to be changed if your button is not active low.

    This way you don't have to use GPREGRET to signal the bootloader to enter DFU mode.

    Best regards,

    Vidar 

Reply
  • Hello John,

    There are probably several ways of achieving this, but I would suggest to try something like this:

    1. Start a one off app timer instance once the app detects a button press, and when receiving the timer timeout callback, check if the pin is still pressed. Then perform a soft reset if the pin was pressed for x seconds. Alternatively, poll the input state every second to ensure the button was pressed the entire time. 

    2.  In sdk_config.h header for bootloader, make sure NRF_BL_DFU_ENTER_METHOD_BUTTON is enabled and NRF_BL_DFU_ENTER_METHOD_BUTTON_PIN is assigned to the same pin as the one used by the app. Note: bootloader button initialization need to be changed if your button is not active low.

    This way you don't have to use GPREGRET to signal the bootloader to enter DFU mode.

    Best regards,

    Vidar 

Children
No Data
Related