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
  • Hi,

    You will need to modify the SDK unfortunately. The current implementation does not include an option to differentiate between long and short button press. The new nrf_dfu_button_enter_check implementation covers more methods than before and I guess that's why we thought it was ok to remove the weak declaration :

    ...

  • 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
Reply
  • 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
Children
Related