cancel
Showing results for 
Search instead for 
Did you mean: 

DMA memory to memory doesn't work

Arman Ilmak
Senior

Hi guys im doing a simple 5 byte memory to memory dma transfer with timer update request.

As stm32f407 reference manual said timer8 update is connected to dma2 stream 1.

0693W00000Uo7PIQAZ.pngHere is the timer config by cube.

0693W00000Uo7PSQAZ.pngAnd the dma cube config:

0693W00000Uo7PXQAZ.pngI started the dma and expecting that when i start timer , destination buffer updates with source memory changes , but there is only a first update at the enable time.

Whats the problem?

Here is the code and debug session:

0693W00000Uo7PrQAJ.pngAs you can see the dst is not updated after timer enable.

1 REPLY 1

First, if you want to do something out of ordinary, don't use Cube/CubeMX. Its utility is limited to what you can click in CubeMX. Timers and DMA is simple enough to be handled directly through registers, and you'll know exactly what you are doing, without others' software in between.

Second, mem2mem in DMA does not mean what you think it does. DMA does not really care whether source or destination is memory or peripheral.

(DMA1 does in a way, as its peripheral port is connected only to APB1, but it still does not care what's connected there, to DMA, it's only an address as any other. But this is not important for the explanation of what you see).

The real meaning of mem2mem is, that it does not expect external trigger and as soon as you enable given stream, it will perform automatically NDTR transfers as fast as possible.

Read the DMA chapter in RM and AN4031 .

JW