lpcware

DMA interrupts, WFI and the debugger

Discussion created by lpcware Employee on Jun 15, 2016
Content originally posted in LPCWare by skysat on Sun Jan 17 02:38:11 MST 2016
When I run my program on my LPC1769 with the debugger attached, all is well.  When I merely power the 1769 on, it doesn't.  The DMA interrupt is not called (it lights an LED) unless the debugger is running.

while (!dma_finished || Chip_GPDMA_IntGetStatus(LPC_GPDMA, GPDMA_STAT_INTTC, dma_channel) != 0)
{
__WFI();
}

OK, I get it.  It's the WFI (if I remove it, it works) - but why?  Apparently, the debugger can (and does) wake up a WFI but the DMA controller can't.  What am I missing?

   Randy

p.s.  The DMA operation is from GPIO to ram (__DATA(RAM2)).

I've tried this:
NVIC_SetPriority(DMA_IRQn, 2);
__set_BASEPRI(1);

And this:
NVIC_SetPriority(DMA_IRQn, 1);
__set_BASEPRI(2);

Outcomes