Hi,
The IMXRT EDMA API in the SDK seems to handle "happy case" interrupts correctly. However, there doesn't seem to be any provision for handling error interrupts. Not only that, but it appears there is one global DMA_ERROR_IRQHandler for all DMA. So if you're using both DMA0 and DMA1, when things are "happy" the DMA0/DMA1 IRQHandler would be called and the SDK can distinguish which DMA got the happy interrupt. However, if there's a DMA error, since there's one global error interrupt handler, there's no easy way to know which DMA (0 or 1 or whatever) the error happened on.
As in my previous question about LPUART error IRQ handling. Why isn't this baked into the SDK to handle DMA errors and call appropriate callbacks? Now I have to figure out how to determine which DMA the error is on by hand and call special handling outside the SDK instead of just having it call a callback for me.
For an SDK that is supposed to be usable in production code, there seem to be a lot of missing robustness features, and I'm betting most people are just assuming these errors are handled under the hood by the SDK, and they don't think about the fact that they really aren't.
-m
Dear @nxp16 ,
Which i.MX RT device are you using? When you mention DMA0 and DMA1, are you referring to two DMA channels rather than two DMA controller peripherals?
Not all i.MX RT devices have two eDMA controllers. For example:
i.MX RT1180 contains two eDMA controllers. In the startup file (for example, startup_mimxrt1189_cm33.c), you can find two DMA error handlers: DMA_ERROR_IRQHandler and DMA4_ERROR_IRQHandler.
i.MX RT1050 contains only one eDMA controller. In the startup file (for example, startup_mimxrt1052.c), there is only one DMA error handler: DMA_ERROR_IRQHandler.
In general, DMA errors are relatively infrequent events. From the hardware architecture perspective, channel error status is aggregated into a module-level error request, which triggers the DMA error interrupt. Therefore, the software must examine each channel's error status register (for example, CHn_ES) to determine which specific channel caused the error.
Best Regards,
Shelly Zhang