Skip to main content
SKILA
Associate III
April 13, 2021
Question

Best practice to modifying DMA accessed memory?

  • April 13, 2021
  • 1 reply
  • 924 views

Hello,

I have a general question about DMA which I am currently using to transfer a LUT in the memory to control PWM output.

The LUT changes periodically and at the moment the DMA is triggered with a timer. What I would like to know if it is safe to change the content of the memory (LUT in this case) while it is being accessing by the DMA. I feel I know the answer to this but I thought I would ask this question maybe I am wrong.

Regards

Samer

This topic has been closed for replies.

1 reply

waclawek.jan
Super User
April 13, 2021

Which STM32?

DMA is no magic. When it is triggered, it starts a process, where it picks data on the read side and then writes data on the write side. That's all.

For the details read AN2548 or AN4031, depending on the STM32 model you are using.

Answer to your question depends on your definition of "safe", and the exact timing of writes from processor and reads from DMA.

JW