My ISR looks like below
t xHigherPriorityTaskWoken = pdFALSE;
if i comment portYIELD_FROM_ISR then system doesnt crash but when i probed signals on oscope i see that interrupt remains high for a long time hence losing many expected interrupts. ( in snapshot green signal is interrupt which remained high while my system performed write to flash task which is in yellow)
However, if i dont comment this function then system is crashing. Crash occurence is very randon some times it happen as soon as system is turned ON, but at times it runs for hours without any issue.
Since I am getting interrupt from FPGA at the variable frequency(fastest at .24msec) , i was wondering that may be at time during context switching due to multiple occurance of interrupt one after the other stack is getting corrupted causing it to crash.
To give you more information, i 4 interrupts ( FPGA, SYSTick, UART1, UART2). FPGA interrupt is the highest priority as compared to all other 4 interrupts.In Freertos configuration i have configured all these 4 interrupts as maskable my setting configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY to 5 (which is FPGA interrupt priority).