Hello, I am implementing FreeRTOS RISC V port on a MiV RV32 processor core running on M2GL025 creative board. The port requires “return statement” at the end of any ISR to keep it enable for the next interrupt, however if we want to wake a high priority task from ISR we need a call to “portEND_SWITCHING_ISR()” macro which would immediately invoke a context switch. So at this point it becomes confusing, How can we invoke a context switch from ISR and still let the ISR return to its trap handler script where it could complete the ISR execution?
Moreover, after some debugging it appears that if I omit the “return” statement from ISR call the processor will never came out of ISR and keep executing the ISR routine over and over again until some exception occurs for access fault. My ISR function is follows:
uint8_t External_31_IRQHandler()
{
BaseType_t xHiPriTaskWoken= pdFALSE;
TMR_clear_int(&g_timer1);
xTaskNotifyFromISR( my_task_handle, signal, 0x01, &xHiPriTaskWoken);
portEND_SWITCHING_ISR( xHiPriTaskWoken );
return(EXT_IRQ_KEEP_ENABLED);
}
Can someone help me with this problem?
Regards