cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO + DMA on stm32f103

shivangbaveja
Associate II
Posted on May 07, 2015 at 15:56

Hi everyone,

I am using SDIO interface to write to SD card without using DMA. I am writing about 300 bytes of data at 50Hz. The problem is that with current implementation it slows down the code.Thats why I am thinking of using DMA for the data transfer to eliminate this issue. 

Now, I have 2 questions:

1. Will using DMA with SDIO help enough to allow writing 300bytes at 50 Hz.

2. If it helps, Can someone provide me a sample code of this usage. Otherwise, guide me in the right direction for implementing the same.

Thanks

#stm32f103 #dma #sdio
2 REPLIES 2
qwer.asdf
Senior
Posted on May 07, 2015 at 18:12

> 1. Will using DMA with SDIO help enough to allow writing 300bytes at 50 Hz.

Well, maybe, but before that, you should really try to write data not by 300 bytes at a time but more. The block size on the SD cards is 512 bytes, so when you are writing 300 bytes, the driver reads a block of 512 bytes, changes the 300 bytes you wrote there, then writes back the 512 bytes. That's not good. So you should try to write by x512 bytes, for example, say 4096 bytes of data every time (that's 8 blocks).

Posted on May 07, 2015 at 20:24

[DEAD LINK /public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/STM32Java/STM32%20SDIO%20-%20SD4bits%20mode&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/AllItems.aspx&currentviews=322]Responded in other thread

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