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

Timer0 interrupt inside timeslot not called

Hi, trying to implement timeslot api and stuck with TIMER0.

I saw similar questions but answers is still unclear.

My timer init code:

NRF_TIMER0->MODE = TIMER_MODE_MODE_Timer;
NRF_TIMER0->TASKS_STOP = 1;
NRF_TIMER0->TASKS_CLEAR = 1;
NRF_TIMER0->PRESCALER = 6;
NRF_TIMER0->CC[0] = 1000;
NRF_TIMER0->INTENCLR = 0xffffffff;
NRF_TIMER0->INTENSET = TIMER_INTENSET_COMPARE0_Msk;
NVIC_ClearPendingIRQ(TIMER0_IRQn);
NVIC_EnableIRQ(TIMER0_IRQn);
NRF_TIMER0->TASKS_START = 1;

If works fine outside of timeslot (TIMER0_IRQHandler called). But in timeslot NRF_RADIO_CALLBACK_SIGNAL_TYPE_TIMER0 not called and entire app execution stops (not receiving any debug messages through UART Serial).

Full function: https://pastebin.com/YQvsfU6Y

Logs:

radio_callback: 0
NRF_RADIO_CALLBACK_SIGNAL_TYPE_START
radio_callback: return

And nothing more...

EDIT: My chip is nRF51822 QFAA H0 (Chinese board).

Softdevice: s130_nrf51_1.0.0_softdevice.hex

I followed this guide to set up Timeslot API: devzone.nordicsemi.com/.../

So inside timeslot I should be able (actually "have to") to use TIMER0.

Parents
  • Just fixed the issue myself :(

    In my code I used LOG_MSG calls to send debug messages through UART but this takes so much time so timeslot is already finished after first message... After removing UART prints TIMER0 and other callbacks started working.

  • Using RTT as logging backend costs less resource and is faster. Maybe this also works for your case if logging is a need.

Reply Children
No Data