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

Undefined reference to 'nrf_dfu_button_enter_check'

When creating a custom bootloader for buttonless DFU, it is surprising to see that nrf_dfu.c not compile without defining button related function.

The warning

nRF5_SDK_14.2.0_17b948a/components/libraries/bootloader/dfu/nrf_dfu.c:81: undefined reference to `nrf_dfu_button_enter_check'

was thrown, and the make fails.

This is with nRF5 SDK 14.2.0.

Parents
  • A workaround is to make a define of the function in the bootloader code even though the function is not needed.

    bool nrf_dfu_button_enter_check(void)
    {
        return false;
    }
    

    I would suggest fixing this in the next release with a weak function declaration within the SDK that doesn't do anything.

    @brief Empty button press handler to be overridden when not using buttonless DFU
    __weak bool nrf_dfu_button_enter_check(void)
    {
        return false;
    }
    
Reply
  • A workaround is to make a define of the function in the bootloader code even though the function is not needed.

    bool nrf_dfu_button_enter_check(void)
    {
        return false;
    }
    

    I would suggest fixing this in the next release with a weak function declaration within the SDK that doesn't do anything.

    @brief Empty button press handler to be overridden when not using buttonless DFU
    __weak bool nrf_dfu_button_enter_check(void)
    {
        return false;
    }
    
Children
Related