cancel
Showing results for 
Search instead for 
Did you mean: 

DMA Interrupt handler not working

giu
Associate II
Posted on January 17, 2012 at 17:30

I'm using the standard periphery library for this board. The DMA is working correctly in combination with DAC (memory to peripheral transfer) but I can't get the cpu to execute the interrupt handler for DMA1_Stream5 (transfer complete interrupt):

void DMA1_Stream5_IRQHandler(void)

{

  DMA_ClearITPendingBit(DMA1_Stream5, DMA_FLAG_TCIF5);

  STM_EVAL_LEDToggle(LED3);

}

In main.c DMA interrupt is enabled using the stm32f4xx_dma.c function:

DMA_ITConfig(DMA1_Stream5, DMA_IT_TC, ENABLE);

Other interrupts work fine.

EDIT:

with DMA_GetITStatus(DMA1_Stream5, DMA_IT_TCIF5) I can see that the interrupt has occurred, but the interrupt handler is not executed.
1 REPLY 1
giu
Associate II
Posted on January 24, 2012 at 12:40

I just needed to enable the DMA1_Stream5 gloabal Interrupt:

NVIC_InitTypeDef      NVIC_InitStructure;

NVIC_InitStructure.NVIC_IRQChannel = DMA1_Stream5_IRQn;

NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;

NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1;

NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

NVIC_Init(&NVIC_InitStructure);