five UARTs are used in my project,they all enable the DMA-RX channel and UART-IdleLine Interrupt to receive data of random lengths.
In UART-RX interrupt,the data will copy from DMA buffer to the ring buffer of the specific UARTs.
For every UART,I have to declare a DMA buffer and a ring buffer which may larger than DMA buffer.And Some UARTs like a PPP-UART have large data to receive,but the SRAM of my chip is limited and the interrupt is not allowed to nest.So I wonder is it possible that all UARTs use one DMA buffer.
After testing this,it seems to work well 5 UARTs using the same DMA buffer.Anything that I should pay attention to?
CodePudding user response:
Of course, you can't. DMA receive is happening without the core knowledge. If more than one UART will receive data the data will be corrupted. The interrupts only inform you if the DMA controller has reached the end (or middle) of the buffer or if UART receiver (if capable) is idle for a particular time.