Skip to main content
subscriptions
Associate III
September 2, 2014
Question

Do I need a DMB instruction before starting DMA?

  • September 2, 2014
  • 1 reply
  • 865 views
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?
    This topic has been closed for replies.

    1 reply

    Tesla DeLorean
    Guru
    September 2, 2014
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..