2021-04-09 12:51 PM
Hi, I am struggling to make QSPI+Ext Flash and DMA to work for several days, but having issues.
I was using BSP library for both external SDRAM (with FMC) and Flash with QSPI.
However, BSP library had DMA read/write for FMC SDRAM, but not for QSPI Flash (why?).
BSP_QSPI_Read worked nicely, but it was slow, so I wanted to make DMA work.
My board is stm32f7508-DK.
Below is what I tried:
I will try to write down different mode of errors that I have seen by tweaking the code.
I am not sure why my code is not working.
Any help would be highly appreciated. Thank you.
2021-04-09 02:06 PM
Ok, so I suspect there are different concepts here.
The SDRAM DMA is accessing Mapped Memory in the 0xC0000000 (or 0xD0000000) region.
The HAL_QSPI_Receive_DMA is doing DMA with the peripheral in direct mode, like you might with a USART.
The SDRAM equivalent would be for you to MEMORY MAP the QSPI space, and then DMA from that MEMORY in the 0x90000000 region to wherever you want that data transferred.
2021-04-09 02:41 PM
Thank you for the answer! Then, would it be as simple as putting the QSPI in memory-mapped mode and copy-pasting the code structure for SDRAM DMA? Are there any performance different between direct mode vs. memory-mapped indirect mode?
2021-04-09 02:50 PM
Also, if I were to use memory mapped mode + DMA, is my current setting (e.g., using initialization code from STM32CubeMX) correct? Are there any example using memory mappend mode +DMA for QSPI Flash? Thank you!