Hello,
We are developing an application using nrf52832 and the ncs 1.8.0.
Since our solution is battery operated we have configures application to sleep by default and wake-up on the interrupt.
In our case, this interrupt is PWM like pulses. So, once we receive the interrupt we wake-up the system and then start processing the interrupt. Since this is PWM like pulses, we have train of interrupts. And our ISR processes this interrupt (basically calculating the pulse width of pwm).
Now, when interrupt is being processed in ISR we need to make some operations based on the pulse width calculated in the ISR. To start this processing, we want to start a thread when first interrupt arrives. So far we tried:
1. Starting a thread from the ISR on first interrupt. However, this fails since thread invocation is not allowed in the ISR.
2. Submit a system work queue from ISR, which in turn starts the thread. This works, but it seems kernel takes time to schedule this work queue (since ISR is always running). It takes extended time to start the thread (in seconds), which is obviously not accepted.
3. Start a timer from ISR and once it expired, start a thread from timer handler. However, this also fails since it's same as case-1. Starting the thread from ISR context.
In work around to this? Is there any example that does something similar?
TIA!