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 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
Could you able to cross check with below issue, while writing into Flash within event handler.
I have been quite busy lately, my apologies for that. Have you been able to figure this out?
As mentioned above, if I call Flash write within event handler, code gets hanged. To avoid this I set a flag to true in event handler and in ideal loop I will write data into Flash and reset the flag. With this its working fine.
Please let me know is this expected behavior, if not let me know any other alternate approach.
Thanks & RegardsVishnu Beema
Could you upload your example, then I can test it myself and understand your problem better. I can make the case private if you would like so.
Sorry Simon, lot of changes I added and at this stage I can't share the code even in private forum.
Anyway I am able to write data into Flash.
Thank you for your support.