This repository may give you information about how to read data on UART by using DMA when number of bytes to receive is not known in advance.