2020-05-04 06:04 PM
2020-05-04 06:53 PM
Most of us looking for speed/performance would use the SDIO/SDMMC peripheral.
Do multiple blocks, so you're writing 8KB or 32KB in aligned chunks
SPI with DMA should be viable
2020-05-09 05:31 AM
Hey!
I am having the same question. Did you find any tutorial for interfacing the 2 of them?
2020-05-09 06:18 AM
I'm not convinced you are approaching the problem correctly,
Ask yourself why you need this level of guidance to succeed in a task.
The DMA and POLLED uses case for SPI aren't hugely different, you aren't changing the chip select across the transfer, and you're using the machine to iterate a block of data over the channel rather than walking in manually.
Find other SPI DMA examples and APPLY them here.
Generally you'll want the Write/Read together as the writes generate the clocks, and the interface is symmetrical. When READing blocks from the media, break down the transfer into 512 byte units so your output buffer of dummy bytes doesn't get to be too large. Using two DMA channels uses more resources, and is more cumbersome, but again this is the path you have chosen.
See this example, or similar one for the unspecified STM32 being used in each case..
STM32Cube_FW_L4_V1.14.0\Projects\NUCLEO-L496ZG\Examples\SPI\SPI_FullDuplex_ComDMA
Polled SPI based SD card example
STM32Cube_FW_L4_V1.14.0\Drivers\BSP\Adafruit_Shield\stm32_adafruit_sd.c