Skip to main content
KMaen
Associate III
October 21, 2019
Solved

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?

  • October 21, 2019
  • 1 reply
  • 1273 views

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!

This topic has been closed for replies.
Best answer by Tesla DeLorean

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.

1 reply

Tesla DeLorean
Guru
October 21, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..
KMaen
KMaenAuthor
Associate III
October 21, 2019

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?

Tesla DeLorean
Tesla DeLoreanBest answer
Guru
October 21, 2019

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 VenmoUp vote any posts that you find helpful, it shows what's working..