Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Where did nrf_dfu_button_enter_check go?

Hi,

I working on migrating my project from SDK 14.0 to 15.2 and are currently working on the secure_bootloader. In our current solution we use the __weak nrf_dfu_button_enter_check to poll the button for a while (long press -> DFU, short press -> just start the application). The button handling seems to be moved into nrf_bootloader though, without __weak declaration.

Am I missing something here, or do I have to modify the SDK for my use case to work?

BR Henrik

Parents Reply Children
  • Ok, since I did the modifications yesterday anyways, I guess thats sort of good news. ;)

    If you take feature requests regarding this it would be nice to have a some kind of fully customisable check for this:

    __weak bool custom_user_enter_method();      
    
    
    static bool dfu_enter_check(void)
    {
    ...
        if (NRF_BL_DFU_ENTER_METHOD_CUSTOM && custom_user_enter_method())
        {
            NRF_LOG_DEBUG("DFU mode requested via custom method.");
            return true;
        }

    Another thing regarding the dfu_enter_check function, my guess is that its a bug on line 305.

        if (NRF_BL_DFU_ENTER_METHOD_GPREGRET &&
           (nrf_power_gpregret_get() & BOOTLOADER_DFU_START)) // Should be == and not &?
        {
            NRF_LOG_DEBUG("DFU mode requested via GPREGRET.");
            return true;
        }
    
    BR Henrik
  • Thanks for the feedback. I have created an internal ticket to log the feature request. 

    Another thing regarding the dfu_enter_check function, my guess is that its a bug on line 305.

    I see your point. However, the reset value of GPREGRET is 0 so it will work as intended. It also allows you to use remaining bits for other purposes.

Related