A friend of mine has told me that on x86 architecture DMA controller can't transfer between two different RAM locations. It can only transfer between RAM and peripheral (such as PCI bus).
Is this true?
Because AFAIK DMA controller should be able between arbitrary devices that sit on BUS and have an address. In particular I see no problem if both source and destionation addresses belong to the same physical device.
DMA can also be used for "memory to memory" copying or moving of data within memory. DMA can offload expensive memory operations, such as large copies or scatter-gather operations, from the CPU to a dedicated DMA engine.
A DMA channel enables a device to transfer data without exposing the CPU to a work overload. Without the DMA channels, the CPU copies every piece of data using a peripheral bus from the I/O device.
this can can be true yes. Setting up the DMA controller for a memory to memory transfer on a STM32F4 requires at the very least 4x peripheral register writes which will take a couple of CPU cycles. So for small data sizes this might actually perform worse than letting the CPU copying it.
ISA (remember? ;-) DMA chips certainly have a Fetch-and-Deposit transfer type.
However, from the MASM32 forums:
Hi,
Checking in "The Undocumented PC", he says memory to memory DMA is possible. He then goes on to say that there can be problems, limitations, and that the CPU can do the copy faster than the DMA hardware anyway (MOVSD on 386+).
So it seems to be a yes you can, but who cares, kind of thing.
Regards,
Steve N.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With