Question
stm32f4 interrupt pipeline hazard
Posted on October 21, 2013 at 10:26
Hello again,
I have learned that this:void DMA2_Stream3_IRQHandler()
{
// Test if DMA Stream Transfer Complete interrupt
if (DMA_GetITStatus(DMA2_Stream3, DMA_IT_TCIF3))
{
DMA_ClearITPendingBit(DMA2_Stream3, DMA_IT_TCIF3);
}
}
is danger on a Cortex-M3/4. The Interrupt can be reentered immediately due to some pipline issues. Is it enough to insert two nops to clear this situation?
void DMA2_Stream3_IRQHandler()
{
// Test if DMA Stream Transfer Complete interrupt
if (DMA_GetITStatus(DMA2_Stream3, DMA_IT_TCIF3))
{
DMA_ClearITPendingBit(DMA2_Stream3, DMA_IT_TCIF3);
}
__NOP();
__NOP();
}
Currently it works for me, but does it work under all situations?
Martin