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
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
Hello Jeff,
Thanks for your answer,
As the SDK V15 (the last one and the one I use) has been updated to be conformed to the nrfX API, there shouldn't be anymore TIMER_ENABLED define in the sdk_config.h file, but instead the define below that I had already enabled:
// NRFX_TIMER_ENABLED - nrfx_timer - TIMER periperal driver //========================================================== #ifndef NRFX_TIMER_ENABLED #define NRFX_TIMER_ENABLED 1 #endifAny other suggestion please ?
Perhaps but I am also using 15 and that is what I needed to do.
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.
Thanks for taking time to answer to me.