2022-10-15 05:28 AM
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.
Here is the timer config by cube.
And the dma cube config:
I 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:
As you can see the dst is not updated after timer enable.
2022-10-15 10:37 AM
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