Page 1 of 1
DMA interrupt

Posted:
Mon May 13, 2013 2:00 pm
by jose
Re: DMA interrupt

Posted:
Mon May 13, 2013 2:19 pm
by ysapir
Please make sure that the program does not exit (return from main) before the DMA process finished. In the tutorial I used the timer-based delay to make sure that this does not occur and the interrupt indeed fires.
Re: DMA interrupt

Posted:
Tue May 14, 2013 8:26 am
by jose
when I debug the program, I see that the data is transfered (the data is written is the correct place in memory). However dma_isr is not called for some reason. Furthermore, I make a second call of e_dma_copy in the program that succesfully transfers the data (I checked the memory). dma_isr is yet not called.
Re: DMA interrupt

Posted:
Tue May 14, 2013 10:15 am
by jose
Before the core executed e_dma_copy the first time, the value of E_DMA0CONFIG was 0x00000000. After the execution E_DMA0CONFIG was 0x00000043, which means IRQEN was cero.
Therefore I put in my init_interrupts function the next command: e_sysreg_write(E_DMA0CONFIG, (unsigned)0x10);. After the execution of e_dma_copy E_DMA0CONFIG was 0x00000043 again. IRQEN was overwritten to cero.
I tried also e_sysreg_write(E_DMA0CONFIG, (unsigned)0x53);. E_DMA0CONFIG was 0x00000043 after executing e_dma_copy.
Should I use assembly lenguage instead?
Re: DMA interrupt

Posted:
Tue May 14, 2013 12:04 pm
by jose
Re: DMA interrupt

Posted:
Tue May 14, 2013 3:28 pm
by ysapir
OK, thanks for the update.
Yes, you're right, that was the missing piece. As opposed to the timer mechanism, where an interrupt generation is always enabled, and occur whenever the timer reaches 0, the DMA engines behave slightly different. In order to enable DMA chaining, it was more efficient to implement an interrupt enable bit in the configuration register, then let the user reprogram the IMASK register per DMA task.