简体   繁体   中英

Is it feasible that Several UARTs use the same DMA buffer?

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?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM