Concept Flow - Circular buffer DMA mode
Start DMA Transfer
Write data to buffer at write_index
Increment write_index
Check if write_index == buffer_size
Yes No
Reset write_index to 0
DMA continues writing in circular fashion
CPU reads data from buffer at read_index
Increment read_index
Check if read_index == buffer_size
Yes No
Reset read_index to 0
Repeat until stop
DMA writes data into a fixed-size buffer in a loop, wrapping around when reaching the end, while CPU reads data similarly, enabling continuous data flow without overflow.