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
  • This happens if you have both TIMER_ENABLED and NRFX_TIMER_ENABLED defined in your sdk_config.h.

    If you want to use the new defines, find the location in sdk_config where TIMER_ENABLED is defined an remove it or comment it out. Then you can use the "NRFX_TIMERxxxxx" configuration.

    If you want to use the old defines, set the "TIMERxxxxxx" and leave all "NRFX_TIMERxxxxx" as they are.

    In general, this is true for all driver configurations. If you have both "<DRIVER>_ENABLED" and "NRFX_<DRIVER>_ENABLED" defined, the old define takes precedence. If you want the new defines, you must remove (or comment out) "<DRIVER>_ENABLED" from sdk_config.

  • somehow there is no error compiling for pca10056 board and there are errors in new SDK with timer or SPI drivers compiling for for PCA10040 board. 

Reply Children
No Data
Related