cancel
Showing results for 
Search instead for 
Did you mean: 

Can I use DMA to copy data in parallel with the MCU operation to/from (1) On-chip Flash, (2)Off-chip Flash (connected via Quad-SPI), or (3) Off-chip SDRAM (connected via FMC)? If possible, which one will be the fastest?

KMaen
Associate III

From the datasheet diagram (attached), it seems like the DMA has access to all of above. However, it is not clear whether it is really possible to DMA data to / from those and how I should do it and I've seen negative response to similar chips, so I am confused. Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Writing to Flash is VERY slow, and doesn't work well concurrently with reading.

You can use SDRAM as a source/destination, doing random reads/writes to it will be significantly slower than internal SRAM. The processor can cache the SDRAM for its use case, the DMA/Peripherals cannot. There are also coherency issues to consider.

You should benchmark things to understand their speed in the context of your implementation/use case.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

View solution in original post

4 REPLIES 4

I won't advise the writing to flash (internal/external) via DMA.

Should be usable as a data source for a pattern buffer, external I would expect would add extra contention

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi. I did not fully understood your answer. Are you suggesting not to write to flash with DMA due to contention in the memory bus? Is it because (while it is possible) DMAing to internal / external FLASH goes through a memory bus that is also shared when the CPU reads and writes the internal SRAM?

Will option (3), which is DMA to SDRAM via FMC not have the contention problem, i.e., the best among those?

Writing to Flash is VERY slow, and doesn't work well concurrently with reading.

You can use SDRAM as a source/destination, doing random reads/writes to it will be significantly slower than internal SRAM. The processor can cache the SDRAM for its use case, the DMA/Peripherals cannot. There are also coherency issues to consider.

You should benchmark things to understand their speed in the context of your implementation/use case.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
KMaen
Associate III

Thanks! It seems like STM32F746 series only has a single bank so I cannot run the code simultaneously while R/W to FLASH anyways. I'll try to use SDRAM.