another need for advice on high priority interrupt
Posted: Wed May 08, 2013 3:06 pm
Hello.
Still have some problem with high priority interrupt.
When my ISR has an priority < 2, program hangs after couple of minutes
with ISR >= 2, it run onvernight.
I thing i have not understood well how to deal with that.
i have high priority interrupt which fill a ring buffer
when condition is meet, i trig a pendSV interrupt,
and in the pendSV handler i do that :
The problem is : if an high speed interrupt occurs during the execution of PendSVVector, it hangs.
In fact, if i remove chMBPostI from the pendsv ISR, of course nothing works since i don't fectch any value in the regular thread,
but at least chibios continue to live.
So, my question is, is there any thing to to to cope with high priority interrupt interrupting PendSV ISR during execution of chMBPostI ?
Alexandre
Still have some problem with high priority interrupt.
When my ISR has an priority < 2, program hangs after couple of minutes
with ISR >= 2, it run onvernight.
I thing i have not understood well how to deal with that.
i have high priority interrupt which fill a ring buffer
when condition is meet, i trig a pendSV interrupt,
and in the pendSV handler i do that :
Code: Select all
CH_IRQ_HANDLER(PendSVVector) {
CH_IRQ_PROLOGUE();
chSysLockFromIsr();
chMBPostI (&xQueue, transEncodeIndexAsMsgt (&rtTransactionBuffer));
chSysUnlockFromIsr();
CH_IRQ_EPILOGUE();
}
static inline msg_t transEncodeIndexAsMsgt (volatile RtTransactionBuffer *rb)
{
const msg_t retVal = rb->transStart_forPendSV | (rb->transEnd_forPendSV << 16);
return retVal;
}
CH_FAST_IRQ_HANDLER(STM32_TIM1_UP_HANDLER) {
tim1_isrHandler(); // fill circular buffer, does not call any chibi api, trig pendSV ISR when buffer is full enough
}
CH_FAST_IRQ_HANDLER(STM32_TIM1_CC_HANDLER) {
tim1_isrHandler(); // fill circular buffer, does not call any chibi api, trig pendSV ISR when buffer is full enough
}
The problem is : if an high speed interrupt occurs during the execution of PendSVVector, it hangs.
In fact, if i remove chMBPostI from the pendsv ISR, of course nothing works since i don't fectch any value in the regular thread,
but at least chibios continue to live.
So, my question is, is there any thing to to to cope with high priority interrupt interrupting PendSV ISR during execution of chMBPostI ?
Alexandre