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

Upgrade to the nrfx API (SDK V15)

Hello,

I am using the NRF52-DK softdevice 6.0.0 and NRF SDK 15.0.
The app is based on on the ble_app_template PCA10040e S112 (The final chip will be a NRF52810 that's why I use the PCA10040e.)

I am trying to conform to the new nrfX module (compare to the previous nrf module).
Based on a clean ble_app_template  my aim is to run a timer + PPI.

I want to add static const nrfx_timer_t m_timer1 = NRFX_TIMER_INSTANCE(1); in my main.c
(previously it was : static const nrf_drv_timer_t m_timer1 = NRF_DRV_TIMER_INSTANCE(1);)

in sdk_config.h I then setup :
#define NRFX_TIMER_ENABLED 1
#define NRFX_TIMER1_ENABLED 1

I then add the nrfx_timer.c to "nrF driver" folder
I Add #include "nrfx_timer.h" in the main.c

If I compile, I have the following issue :
'NRFX_TIMER1_INST_IDX' undeclared here (not in a function)

If I go to the nrfx_timer.h NRFX_CHECK(NRFX_TIMER1_ENABLED) is not recognized and then that's why NRFX_TIMER1_INST_IDX, is not enumerated.

I do not understand why as I previously defined NRFX_TIMER_ENABLED 1 in the sdk_config.hI tried to clean the all project and build it again without success.Could you please explain me what is my mistake?Thanks

Parents
  • I was having the same problem.

    you need to make sure that the following are set in the sdk_config.h file

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

    // <q> TIMER0_ENABLED - Enable TIMER0 instance

    #ifndef TIMER0_ENABLED
    #define TIMER0_ENABLED 1
    #endif

    // <q> TIMER1_ENABLED - Enable TIMER1 instance

    #ifndef TIMER1_ENABLED
    #define TIMER1_ENABLED 1
    #endif

Reply
  • I was having the same problem.

    you need to make sure that the following are set in the sdk_config.h file

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

    // <q> TIMER0_ENABLED - Enable TIMER0 instance

    #ifndef TIMER0_ENABLED
    #define TIMER0_ENABLED 1
    #endif

    // <q> TIMER1_ENABLED - Enable TIMER1 instance

    #ifndef TIMER1_ENABLED
    #define TIMER1_ENABLED 1
    #endif

Children
Related