cancel
Showing results for 
Search instead for 
Did you mean: 

SDIO vs SPI

sonurobots
Associate III
Posted on December 09, 2013 at 17:03

I am using STM32f4 ,fat fs & SPI mode to interface to SD card every thing works fine .but i want to use DMA to increase read performance.should i go for SDIO to achieve a little more speed or 

is there any way to tweak fat fs to use DMA in SPI mode.

#dma #spi #sdcard #sdio #sdcard-fatfs #tags-are-pointless #sdcard-stm32f4-sdio-fatfs #fat-fs
9 REPLIES 9
Posted on December 09, 2013 at 17:49

I guess my question would be why wouldn't you have started with SDIO?

The original SD/MMC class cards are inherently slower than ones supporting SDHC. The read/write speed of the cards is an important consideration. The faster ones are also more expensive.

SDIO is going to give you 4x the performance of anything you can do with SPI

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sonurobots
Associate III
Posted on December 10, 2013 at 06:42

Thank's clive1 for your quick response. i have one more question. In fat fs even if i use dma i have to wait for complete DMA transfer . i know this will not free my cpu for other applications.

if i go for sdio will i have to wait for   completion  in a multiblock read  ?

Posted on December 10, 2013 at 07:05

Yes, and that's why you'd seek to use multi-threaded programming if sitting in non-productive spin-loops is a concern. You'll spend less time waiting if the transfer occurs quicker, and the card is faster. If your task is IO limited, at some point your through-put is going to bottle-neck as you are serializing access to the media.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sonurobots
Associate III
Posted on December 10, 2013 at 07:30

Thank's clive1 .i think i should go for multi threaded programming and switch from spi to sdio

jono-tree
Associate II
Posted on April 12, 2014 at 21:36

Hi Clive,

Would like to know what you think about something. For a project I currently need to write data to a microSD card from a discovery board, and I realise I may use either SPI or SDIO for that interfacing. 

As you've said, SDIO is faster, and from the STM32F4 ref manual seems to be more like dedicated hardware for talking to SD cards when compared to SPI. On this basis I feel that I should definitely use it. 

However, I've been reading a guide for getting started with the SD card breakout board that I want to use (adafruit), and they say that SDIO is not practicle/easy/a good idea because it involves signing non disclosure forms:  https://learn.adafruit.com/adafruit-micro-sd-breakout-board-card-tutorial/look-out

I myself haven't been able to find out why they've said that. Would you happen to know? I've seen other projects that use SDIO that didn't seem bothered about that such as this one 

http://thehackerworkshop.com/?p=1103

thanks,

Jonathan

Posted on April 13, 2014 at 00:30

While SD and FAT stuff may be encumbered with licensing and patent issues, I'm pretty sure most materials required to implement it, or use existing code, can be done without NDA, or frankly half the drama portrayed in the aforementioned threads.

https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https%3a//my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/STM32%20sdio%20sdhc%204gb%20problem&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&currentviews=2872

Sockets on eBay for $5-6, or use the STM32F4-DIS-BB breakout board.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
sabhijithofficial
Associate II
Posted on October 30, 2015 at 06:48

Is that possible to Write an SDCard at raw level without using FAT File system? if yes, how?

AvaTar
Lead
Posted on October 30, 2015 at 10:48

Is that possible to Write an SDCard at raw level without using FAT File system?

 

Of course. That's what the FAT FS implementation itself does. And I have frequently prepared SD cards for embedded Linx boxes, which involved reformatting to ext3/ext4, and writing files.

if yes, how?

 

 

Check the

https://www.sdcard.org/downloads/pls/

, and available sources for FatFS implementation. Then, decide if it's worth the effort, and if you could do better.

It could become a little complex, and this is exactly what a filesystem is designed to hide from you ...

Posted on October 30, 2015 at 13:38

[DEAD LINK /public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/SDIO%20and%20SD%20fat%20access%20example&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B&TopicsView=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/AllItems.aspx&currentviews=18531]Cross-posted in this thread

Review the code below the diskio.c abstraction, and the examples for SDIO in the SPL for the F4

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