Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Callback function attached to timer not running

Hi, 

I am developing based on the mesh dimming example. 

I want to use a timer for some status LEDs and some other things. I am trying to do it using timer 0, but the callback isn't ever called.

I ran the timer example, and it worked fine, but I cannot get the timer to work inside the dimming example.  I used the nrfx_timer_is_enabled function to see whether or not the timer was ever enabled, and it is. 

Below I included the imaged showing the timers are enabled, and the relevant code that I have written. 

The timer initialization code is being called right before the program enters the main loop.

Setup

Windows 10

nRF SDK v17.02

nRF SDK for mesh

Visual Studio Code

Parents
  • Hi,

    This will not work in this case as TIMER0 is reserved by the SoftDevice. You should get an assert if using it while the SoftDevice is active, and if you use it in the timeslots when the BLE mesh is active you will also experience problems. As this is also used by the mesh stack I would expect warnings during build time as well? In any case, you need to pick an available timer, so something other than TIMER0.

Reply
  • Hi,

    This will not work in this case as TIMER0 is reserved by the SoftDevice. You should get an assert if using it while the SoftDevice is active, and if you use it in the timeslots when the BLE mesh is active you will also experience problems. As this is also used by the mesh stack I would expect warnings during build time as well? In any case, you need to pick an available timer, so something other than TIMER0.

Children
Related