Double Buffer Question

Status
Not open for further replies.

electroRF

Member
Hi,

I write to a ring double buffer.

Each time I cross from one half Buffer to another (E.g. to Half-B), I transfer by a DMA the previous half-Buffer (E.g. Half-A) to a large memory.

Sometimes, it happens that the DMA works more slowly, and I therefore write faster to the Double Buffer (E.g. Half-B) than the DMA passes the previous Half-Buffer (E.g. Half-A) to the large memory.

At this case, when I cross again to Half-Buffer A, the DMA still transfers A to the large memory, and has ~25% left.

I'd like to "give it a chance" to finish transferring Half-Buffer A, and when it finishes, start transferring Half-B to the large Memory.

How would you manage it?

Thank you.
 
To be able to "give it a chance", you need to save whatever you wanted to save to the buffer someplace else, so you need more memory. Therefore, bigger buffer is the best solution.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…