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

Undefine reference to "app_timer_start"

Hi,

I faced a problem while building my project. Please see screenshot below

I think I have already include all the files and everything compiled. But this error shows up at the very end. Please advise. 

Thank you.

  • Hi.

    lsvw1217 said:
    I made a modification and that is adding "nrfx_power_clock.c" from previous SDK since it wasn't included in the newest SDK.

     Can you please remove nrfx_power_clock.c from the project? This file is in SDK 15.3 split up into two different files, nrfx_clock.c and nrfx_power.c.

    And add the file you need, nrfx_clock.c.

    Best regards,

    Andreas

  • Not having the header #included in the source where needed would give compiler errors (or warnings) - but these are Linker errors.

    The header gives the necessary declarations to the compiler - but the Linker needs to see the definitions.

    http://c-faq.com/decl/decldef.html

    This error usually means that the header has been #included in the source (giving the declarations to the Compiler) - but the .c (or pre-built binary) containing the definitions is missing - hence the Linker complains about things being "un-defined"

    The above is standard 'C' stuff - not specific to Nordic or microcontrollers.

    But with the Nordic SDK specifically there is an extra twist: many features have to be enabled by settings in the sdk_config.h;  so, even with the correct headers #included, and all the correct .c files in the Project, you can still get 'Undefined' Linker errors - because the content of the 'C' files is disabled by conditional compilation such as:

    #if NRF_MODULE_ENABLED(NRF_CLOCK)
    
    

  • adding [anything] from previous SDK

    is never a good idea!

    Open mouth

    The whole point of going to all the effort of making a separate SDK release is (as says) that things are not the same - so you can't just go taking stuff from one SDK and dropping it willy-nilly into a different SDK!

  • Hi Andreas and awneil,

    Oh I didn't know that. So I tried installing a whole new SDK 15.3 and deleting nrfx_power_clock.c and also make sure app_timer is enabled in the sdk.config. But the same error still shows up. 

    I've tried to search the error online and found this.

    https://devzone.nordicsemi.com/f/nordic-q-a/51106/linker-issue-in-sdk15-2

    According to Amanda, it might be due to different version of app_timer.c in the SDK.

    But right now I'm using a whole new SDK 15.3, and files are not modified. So I think they should be from the same version. 

    Is there anything else I can try? Maybe download a previous version of SDK? 

    Also, could you provide a link to download the newest version of SDK? Maybe I'm downloading the wrong one.

    Thank you so much!

  • Hi.

    Please make sure that you download SDK 15.3 here.

    If you have not worked much with your project, I suggest that you start a new project with a clean downloaded SDK so that you are sure that it contains the correct files.

    Best regards,

    Andreas

Related