2021-04-13 02:41 AM
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
2021-04-13 02:41 PM
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