I am trying to move 6K data from L2 to L1 using MDMA (BF707).
I started from the example code provided by CCES "Mem DMA Copy using one-shot 1D mode", made some change:
- Change the source address from L1 to L2, that made no difference on the copying speed.
- Changed the DMA stream from ADI_DMA_MEMDMA_S0 to ADI_DMA_MEMDMA_S1, that doubled the speed;
- Changed the BYTES_TO_COPY from 1k to 6k, which also improved speed a little (more than 10%);
- Changed the word transfer size from 1 byte to 4 bytes. Speed improved, but not 4X.
- Tried to use wider word size (8 bytes, 16 bytes, 32 bytes), but made no difference.
- Tried to let *pREG_SCB0_MST30_SYNC = 0, but that made no difference.
- My src address is :0x08002050 and dst address is 0x119000b0. I tried to change the address to 0x08002060 & 0x119000c0 to avoid address alignment issue, but that made no difference.
In the end, I achieved a maximum copying speed about 192M/s. However, I think it is far below the MDMA capability.
The core clock is 400M and system clock is 200M.
I use clock() function to measure the time before & after the while (bMemCopyInProgress) loop.
So my question is:
- What is the max speed of L2 to L1 copying? And how can I calculate it theoretically? How can I achieve it in practice?
- Why the size of BYTES_TO_COPY can affect the copying speed?
Attached is my testing project.