undefined reference to `nrfx_timer_enable'

I am using SDK 14.2.0 with Segger IDE.

I am trying to configure timers and while my code does compile w/o errors the linker fails with message in the subject above.

To avoid copy_old_config script re-writing my sdk_config.h I have modified my sdk_config.h:

//#ifndef TIMER_ENABLED
//#define TIMER_ENABLED 0
//#endif

According to support threads it is good practice to remove or comment-out the legacy driver defines in sdk_config.h.

The code compiles fine because of the following line in nrf_drv_timer.h:

#define nrf_drv_timer_enable                     nrfx_timer_enable

The issue is there is no function named nrfx_timer_enable anywhere in the sdk code base that I can find.

Seeger IDE list of nRF_Drivers has no file specified for timer support.

I added SDK_v14_2_0\components\drivers_nrf\timer\nrf_drv_timer.c but this did nothing.

Maybe sdk is missing the nrfx compatible driver? nrfx_timer.c?

Any ideas what is wrong here?

sdk_config.h is attached.

2620.sdk_config.h

Parents
  • Hi,

    Maybe sdk is missing the nrfx compatible driver? nrfx_timer.c?

    Yes. It looks like you are mixing SDK versions here, as nrfx was introduced in SDK 15.0.0. So there is no wonder nrfx_timer_enable etc. does not exist. You will find most of the same functionality in SDK 14.2 as well though, but using only nrf_drv_* and not nrfx_*.

  • Thanks for the info. Did not know nrfx was not supported in sdk 14.2.

    In the image above you can see we have nrfx_spim driver included and the spi interfaces work with this code.

    I updated sdk_config.h to enable legacy timers:

    // <e> TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer
    //==========================================================
    #ifndef TIMER_ENABLED
    #define TIMER_ENABLED 1
    #endif

    #ifndef TIMER0_ENABLED
    #define TIMER0_ENABLED 1
    #endif

    I enabled al four timers.

    My app #include "nrf_drv_timer.h" now.

    Link still fails with "undefined reference to `nrfx_timer_enable'", undefined reference to `nrfx_timer_init', 

    Even with sdk_config.h timer configuration updated to use legacy timer support the code is being built with references to nrfx support.

    nrf_drv_timer.h still does this:

    #define nrf_drv_timer_enable  nrfx_timer_enable

    That  does not look right to me. Why is it remapping nrf_drv_timer_enable to nrfx_timer_enable if nrfx is not supported?

    2451.sdk_config.h

Reply
  • Thanks for the info. Did not know nrfx was not supported in sdk 14.2.

    In the image above you can see we have nrfx_spim driver included and the spi interfaces work with this code.

    I updated sdk_config.h to enable legacy timers:

    // <e> TIMER_ENABLED - nrf_drv_timer - TIMER periperal driver - legacy layer
    //==========================================================
    #ifndef TIMER_ENABLED
    #define TIMER_ENABLED 1
    #endif

    #ifndef TIMER0_ENABLED
    #define TIMER0_ENABLED 1
    #endif

    I enabled al four timers.

    My app #include "nrf_drv_timer.h" now.

    Link still fails with "undefined reference to `nrfx_timer_enable'", undefined reference to `nrfx_timer_init', 

    Even with sdk_config.h timer configuration updated to use legacy timer support the code is being built with references to nrfx support.

    nrf_drv_timer.h still does this:

    #define nrf_drv_timer_enable  nrfx_timer_enable

    That  does not look right to me. Why is it remapping nrf_drv_timer_enable to nrfx_timer_enable if nrfx is not supported?

    2451.sdk_config.h

Children
No Data
Related