query1920 wrote on Friday, June 14, 2019:
Hello All,
I am running into an issue where randomly periodic task in my application stops running.
I have 5 tasks defined in my system out of which two tasks are periodic i.e. T2 runs every 20msec and T5 runs every 1sec. Rest three tasks are pending on semaphore. Highest priority task T1 is pending on semaphore from ISR. I am getting interrupt every 0.5msec to capture data from two different source. Depending on source of interrupt other two tasks are enabled by giving respective semaphores.
Priority of tasks reduces sequentialy i.e.
T1 -> Highest Priority and T5 -> lowest Priority
FreeRtos is configured to run at tick of 10msec.
I have made sure below points are enabled -
configAssert is enabled,
Priority of interrupt is same as what is configured in configMAX_SYSCALL_INTERRUPT_PRIORITY
ISR uses xSemaphoreGiveFromISR and portYIELD_FROM_ISR
CPU load is 60%
No stack overflow observed.
I was able to reproduce this scenario once in debug mode and found that all other tasks keep running as normal except two periodic tasks which stops executing. I also observed that during this condition xTickCount become greater than xTimeToWake in vTaskDelayUntil() function as a result system might get into blocked state for long time. Even though periodic task have 2nd highest priority, what could cause scheduler to not wake up task after desired time interval ? Also is there a way to kick out of this situation ?
I have watchdog enabled in my application. I am feeding watchdog in T5( runs every 1 sec). Since T5 stops running, i was expecting watchdog to kick. But unfortunately, watchdog doesnt trigger which is unusal and other three tasks keep excuting as normal.
Any help is much appreciated.
Regards