This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LC4357: How to deal with multiple interrupts from the same source arriving at the same time?

Part Number: TMS570LC4357

We are running into a problem with the DMA BTC interrupts. We have two peripherals running on different MIBSPIs that each use DMA to transfer data to/from the peripheral. One of the two peripheral transfers is triggered asynchronously from an external source and the other one is triggered by our software, both use the DMA BTC interrupt to handle the data after a transfer. The problem is that due to the asynchronous nature, we have some rare occasions where both BTC interrupts trigger at the exact same time, and because it is the from the same interrupts source the interrupt is not qeued and we end up losing one of the two interrupts (it seems to always be the one with lower DMA priority).

Is there any way to deal with this problem and prevent losing an interrupt? We have tried reading the various DMA registers to see if we can check if multiple interrupts have occurred but haven't been successfull so far. We are adding additional peripherals with asynchronous DMA in the future so would prefer a general solution that also works for more than two conflicting interrupts.

  • Each channel's BTC status flag is indicated in the BTCFLAG register in the DMA module. The BTC ISR can (should) read this status flag register to service the correct transfer-complete condition. You do need to be careful about the read-clear mechanisms for these status flags, e.g. reading from interrupt offset register clears the highest-priority pending interrupt flag. If you only service one interrupt condition per ISR entry, there should be a second interrupt generated to indicate the second BTC condition. You can also try by not reading the offset register and just read the BTCFLAG register to determine the number of BTC conditions and the priority in which you want to service these conditions.