cancel
Showing results for 
Search instead for 
Did you mean: 

Do I need a DMB instruction before starting DMA?

subscriptions
Associate II
Posted on September 02, 2014 at 12:56

I've been looking through the ARM documentation and am confused by when I need a DMB instruction.

The CMSIS libraries for DMA(strm, enable) don't seem to include a DMB instruction, however the documentation indicates that it's possibly necessary.

Any definitive answer on why the libraries are correct, and I don't need this instruction?
1 REPLY 1
Posted on September 02, 2014 at 13:35

The architecture does guarantee in-order completion of writes (and fenced reads), so although you have write buffer(s) a write to memory prior to enabling DMA will occur before the write to the peripheral enabling DMA occurs. The enabling is a RMW function (DMA->CR |=) so any pending write(s) to memory will occur prior to the read starting.

If you enable DMA and then write to the memory buffer (front thereof) you will of course still induce a race condition.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..