Altera_Forum
Honored Contributor
19 years agoInterrupt problem
Hi
We are developing our own board. We use interrupts and DMA to transfer data between FPGA and linux kernel in Nios. We get an interrupt when data is available in the FPGA FIFO. Then we start transferring data from the FIFO into a kernel ring buffer using DMA. DMA controller sends an interrupt when data is transferred, and we check the DMA status register to see if everything is OK. Data interrupt and DMA interrupt uses different IRQ number. We use PIO and edge-trigged interrupts for data. The problem is: Sometimes we receive extra interrupts on both interrupt lines. We know this because DMA controller will only send interrupts when the DONE bit is set in the status register, and we receive interrupts also when the DMA status register is 0x00. The same goes for the data interrupt. Here we receive interrupts when we are in the middle of processing the last interrupt, e.g. in the middle of a DMA transfer. We know this because when we get our own generated "data ready"-interrupt, the fifo is cleared and a header word is placed on top of the fifo. Is there any software or hardware errors that may cause this behavior? We previously used IRQ 0 for timer, but we have now changed this and we are not using IRQ 0 anymore. That did not fix our problem. Here is a list of interrupts currently used in the kernel: 1: 7672339 L timer 2: 18311178 dmac-0 6: 51344 eth0 7: 18676714 dataready 9: 19914 NIOS serial 10: 0 NIOS serial We use kernel 2.6.17, Intel StrataFlash P30 and a SMC91111 ethernet controller. Regards, Hein Gustavsen