AnsweredAssumed Answered

stm32f4 interrupt pipeline hazard

Question asked by Martin on Oct 21, 2013
Latest reply on Oct 21, 2013 by Clive One
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

Outcomes