We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Basically what I am trying to do is duplicated the timer project example for nRF51422. I keep getting back following errors and I don't know how to fix it. I suspect it has to do with including files?
Rebuild target 'nrf51422_xxac' compiling main.c... ..\..\..\main.c(32): error: #20: identifier "TIMER0_INSTANCE_INDEX" is undefined const nrf_drv_timer_t TIMER_LED = RF_DRV_TIMER_INSTANCE(0); ..\..\..\main.c: 0 warnings, 1 error assembling arm_startup_nrf51.s... compiling system_nrf51.c... compiling nrf_drv_common.c... compiling nrf_drv_timer.c... C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.0.0\timer\nrf_drv_timer.c(26): error: #94-D: the size of an array must be greater than zero static nrf_timer_event_handler_t m_timer_event_handlers[ IMER_COUNT]; C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.0.0\timer\nrf_drv_timer.c(27): error: #94-D: the size of an array must be greater than zero static nrf_drv_timer_cb_t m_cb[ IMER_COUNT]; C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.0.0\timer\nrf_drv_timer.c(28): error: #94-D: the size of an array must be greater than zero static void* mp_contexts[ IMER_COUNT]; C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.0.0\timer\nrf_drv_timer.c(40): error: #29: expected an expression }; C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.0.0\timer\nrf_drv_timer.c(30): error: #1514: an empty initializer is invalid for an array with unspecified bound static const nrf_drv_timer_config_t m_default_config[] = { C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.0.0\timer\nrf_drv_timer.c(312): warning: #177-D: function "nrf_drv_timer_interrupt_handle" was declared but never referenced static void nrf_drv_timer_interrupt_handle(NRF_TIMER_Type * p_reg, uint32_t timer_id) C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_Drivers\3.0.0\timer\nrf_drv_timer.c: 1 warning, 5 errors
The original timer project has TIMER0_INSTANCE_INDEX defined at nrf_drv_config.h - please compare your project accordingly.
Commenting on the other errors is not possible without having access to your project, but again - the original timer project also demonstrates i.e. the successful compilation of nrf_drv_timer.c
Please consider sending your project to support.intl@keil.com if you still run into errors.
Best regards, Ralf
R.Kopsch Senior Applications Engineer ARM Germany GmbH
Thank you! It was as simple as going into the config and enabling the timer. Silly me for missing that.