Hello,
I am trying to use a hardware interrupt with SYS/BIOS using a c6678 EVM. I would like this to work as follows:
1) ISR sets a semaphore using Semaphore_post(mySem); i.e. ISR is :
Uint32 irqCount;
interrupt void My_Isr()
{
Semaphore_post(mySem);
}
2) SYS/BIOS task waits (sleeps) pending the interrupt firing. So in the SYS/BIOS task use:
Semaphore_pend(mySem,BIOS_WAIT_FOREVER);
This works for a limited amount of time, and then exits with a SYS/BIOS stack error.
I notice in the example SRIO_LoopbackDioIsrexampleproject, supplied with with pdk_C6678_1_0_0_14, a polliing method is used instead of the semaphore suggested above, i.e. the ISR sets a global srioLsuIsrServiced and the thread polls to see if this has been set:
while((! srioLsuIsrServiced) && ((TSCL - startTime) < SRIO_DIO_LSU_ISR_TIMEOUT));
This is not useful for our application, because it means CPU cycles are used whilst waiting for the interrupt.
Is it possible to use a Semaphore_post() in an ISR without getting stack errors from SYS/BIOS? If so please provide an example.
Thnaks in advance
Simon