When I am learning about DMA, I came to know that it can be implemented in UART peripheral operations too. Till now, I have used UART peripheral for simple communication operations. Sometimes I use it for Modbus protocol based projects. Put aside, simple projects, in Modbus protocol projects, I constantly process every byte received via UART receive interrupt to do further process quickly or with very minimal delay.
But DMA explains that it can trigger CPU interrupt after all of its buffer/half of buffers get filled only. Also, there is a situation that I don't know how much data comes via UART reception. If I receive only 4 bytes, then I need to process it. If I am supposed to receive 120 bytes to process, I need to wait for it. So here the length is not constant, at least in my requirements. But using DMA with UART needs constant byte count as far as I know. So, I dropped the idea to use DMA in Modbus based communication projects. Is it correct?
But using DMA free CPU burden more than a regular interrupt method. But in which applications can I use it? In which applications is UART + DMA concept more suitable than normal UART interrupt method? If there is any application link or examples available it will be helpful.