I am using nRF52832, SDK_15.3.0, S132 SoftDevice and Segger for flash the image. I am using ‘ble_app_blinky’.
I have gone through “Application Timer” tutorial.
I have few queries.
1) Using “Application Timer module” how many max timers / handlers can be executed at a time with APP_TIMER_MODE_REPEATED. At application level I need 5 timers. Since RTC1 has CC[0..3] whether I can use only 4 at a time.
2) I want to sleep & wakeup periodically for every 30 minutes. For this I need to change PRESCALER. To my understanding there will be only one prescaler for entire timer module. So if I change, will there be any impact on existing timers and SoftDevice (Not sure whether SoftDevice uses Application Timer).
3) I want to stop LED after 10 blink automatically. In this case with some conditions whether can I call app_timer_stop() within same handler (repeated_timer_handler()).
static void repeated_timer_handler(void * p_context)
err_code = app_timer_stop(m_repeated_timer_id);
4) Whether handler will execute in Interrupt context. I want to read data over TWI and write data into Flash. Whether all there can be called within timer handler.
static void repeated_timer_handler_1(void * p_context)
// Read sensor data.
// Write data into Flash
nrf_fstorage_write( ... );
Thanks & Regards
I am sorry for the delay, I will try to provide you with an answer tomorrow.
Please update on above queries.
I am not sure what the maximum amount of timers are, and what the limiting factor is, but I tried adding 6 timers to an application and that worked fine. I don't think APP_TIMER_CONFIG_OP_QUEUE_SIZE is the limiting factor, since I set it to 1 and all the 6 timers still fires. I can look into it further if you would like a more precise answer.
The APP_TIMER_CONFIG_RTC_FREQUENCY (RTC prescaler) is not used by the Softdevice
No problem, you can do this
This shouldn’t be a problem
Thank you for your inputs.
Can you please cross check 4). When I call Flash operations inside handle, code getting hanged.
Also please let me know whether handlers will execute in Interrupt context.
Sorry, any updates on this query.
I have to set a flag and then in while loop I have to write the data into Flash. Otherwise it hangs without any error.