cancel
Showing results for 
Search instead for 
Did you mean: 

Use ADC with DMA, then DMA to SDIO/MMC?

elso
Associate III

Hi all,

I am using a STM32H723ZG Nucleo-144 board. Here I have attached a micro-SD card module. I am sampling from one of the ADCs with 8.33 Msps at 8-bit resolution. I am able to transfer the data to RAM using DMA without any loss. However, I wonder if it is possible to use another DMA to transfer the data directly to the SD card without any or minimal CPU intervention due to this high speed, and to avoid loss? I assume I would need to use a filesystem such as FatFS. 

Can DMA or MDMA etc. support filesystems with SPI or SDIO/MMC?

All replies are appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions

The implementation detail is hidden in the FATFS/DISKIO layer, you just need to be able to read/write multiple blocks efficiently and correctly.

For speed your work at the f_read() / f_write() layer should be done on sector/boundaries and multiples. Doing small unaligned operations will be significantly slowed. So manage your buffering efficiently.

If you can do operations at 32KB performance will be reasonably optimal. This is still likely to be smaller than the erase block size, but about the practical limit for using RAM, and card/cluster interaction.

Writing at 8 MBps is going to depend on cards/mmc device. Would look at efficient 8-bit eMMC chips

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

2 REPLIES 2
TDK
Guru

It is possible to use DMA to do reads/writes from the SD card. Note that FatFS requires some amount of CPU overhead to interpret FatFS, if that is what you want. DMA is just a straight data transfer, it doesn't know anything about file systems.

If you feel a post has answered your question, please click "Accept as Solution".

The implementation detail is hidden in the FATFS/DISKIO layer, you just need to be able to read/write multiple blocks efficiently and correctly.

For speed your work at the f_read() / f_write() layer should be done on sector/boundaries and multiples. Doing small unaligned operations will be significantly slowed. So manage your buffering efficiently.

If you can do operations at 32KB performance will be reasonably optimal. This is still likely to be smaller than the erase block size, but about the practical limit for using RAM, and card/cluster interaction.

Writing at 8 MBps is going to depend on cards/mmc device. Would look at efficient 8-bit eMMC chips

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