I might have found the answer myself. Following the SSP sample code, I used something like:
void DMA_IRQHandler(void){
if (Chip_GPDMA_Interrupt(LPC_GPDMA, dmaChSSPTx) == SUCCESS) {
isDmaTxfCompleted = 1;
}
if (Chip_GPDMA_Interrupt(LPC_GPDMA, dmaChSSPRx) == SUCCESS) {
isDmaRxfCompleted = 1;
}
// more code ...
}
Apparently, if both IRQ are triggered at almost the same time, then the handler is still called twice.
Because the handler checks and resets both flags during its first execution, when it is called for the second time, no IRQ source is active anymore. The following code eliminates the problem:
void DMA_IRQHandler(void){
bool cleared = false;
// more code ...
if (!cleared && (Chip_GPDMA_Interrupt(LPC_GPDMA, dmaChSSPTx) == SUCCESS)) {
isDmaTxfCompleted = 1;
cleared = true;
}
if (!cleared && (Chip_GPDMA_Interrupt(LPC_GPDMA, dmaChSSPRx) == SUCCESS)) {
isDmaRxfCompleted = 1;
cleared = true;
}
// more code ...
}
Please note that in the example shown, it does not matter, but for my actual, much more complicated handler (shared between multiple DMA IRQ sources), it does complicate debugging significantly, if IRQs occur that cannot be accounted for.
It would be nice if somebody could confirm this particular behavior (i.e. storing and queueing of multiple IRQs that go to the same NVIC interrupt), which I did neither expect nor find documented anywhere.