Hi,
I’m having a problem of a crash whenever a FromISR function is called in my TWI0_Handler(). I have followed the interrupt priority rule as mentioned here (and tried different numbers) http://www.freertos.org/RTOS-Cortex-M3-M4.html but the problem persists.
So configLIBRARY
MAXSYSCALL
INTERRUPTPRIORITY is set to 5 and configLIBRARY
LOWESTINTERRUPT_PRIORITY is set to 0x0f (as in Demo for SAM3X). And this is how the interrupt is initialized:
NVIC_SetPriorityGrouping( 0 );
NVIC_DisableIRQ(TWI0_IRQn);
NVIC_ClearPendingIRQ(TWI0_IRQn);
NVIC_SetPriority(TWI0_IRQn, 6);
NVIC_EnableIRQ(TWI0_IRQn);
and this is the TWI ISR:
void TWI0
Handler()
{
int status = twiget
interruptstatus(TWI0);
portBASE_TYPE xTaskWoken = pdFALSE;
printf(“entered testISRn”);
xSemaphoreGiveFromISR( testHandle, &xTaskWoken ); // hangs here
printf("passed fromISRn");
portEND_SWITCHING_ISR( xTaskWoken );
}
Do I miss anything here?
Thank you very much for your help!