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

NRFX_TIMER0_INST_IDX undeclared here

I use NRF52840 Evaluation Kit.

I want to use TIMER with nrf_drv_timer. However, I get an error and cannot use it. The error is the following part of "nrfx_timer.h".

#define NRFX_TIMER_INSTANCE(id) \
{ \
.p_reg = NRFX_CONCAT_2(NRF_TIMER, id), \
.instance_id = NRFX_CONCAT_3(NRFX_TIMER, id, _INST_IDX), \
.cc_channel_count = NRF_TIMER_CC_CHANNEL_COUNT(id), \
}

Parents Reply Children
  • Thank you,

    but, I want to use high frequency clock timer

  • Hi, 

    Do you enable your timer instance in your sdk_config.h:

    #define NRFX_TIMER0_ENABLED 1

    If you are using the Softdevice, it uses TIMER0, so you'll need to use another available timer instance.

    -Amanda H. 

  • When TIMER1 is set, the count value of the high frequency clock can be obtained.
    Thank you.

  • Please kindly verify the answer to this case to help other users identify the solution.  

    -Amanda H.