cancel
Showing results for 
Search instead for 
Did you mean: 

SDcard with SDIO interface and FATFS

linas2
Associate II
Posted on June 07, 2012 at 18:46

Hello,

i connected sdcard to my stm32f4discovery board, used SDIO example for low level init, and fixed fatfs so i can write data and read that later with computer

But fatfs code is to complex for me to understand, does any one know hot to create txt, write a value (like from adc) and then close it so it could be seen by computer ?

thanks
16 REPLIES 16
linas2
Associate II
Posted on June 09, 2012 at 21:15

you can find it on stm32f4 examples ,

anyway:

http://

need to call low level sd init and sd init

linas2
Associate II
Posted on June 09, 2012 at 21:33

you can find it on stm32f4 examples ,

anyway:

http://www.2shared.com/file/Cb8eJdJ4/SDIO.html

need to call low level sd init and sd init

linas2
Associate II
Posted on June 10, 2012 at 22:51

does any one know what code should be writhed to connect sdio library with fatfs library, since i assume that is standard definitions for sdcard, and all manufactures use same function names for same jobs (or at least that is how it looks like ) so i need just get sdio working, and fatfs will do the rest

bjfree
Associate II
Posted on June 11, 2012 at 03:36

the maple_sdfat, for STM32F1 does not use the SDIO

it uses the SPI directly.

you need to update the pin numbers.

However if you want to use the SDIO then you need to go through the code and recode it so it use the SDIO class.

linas2
Associate II
Posted on June 11, 2012 at 07:37

Well, i use SDIO on STM32F4

in disco.h when i add sdio.h file i get zero errors, and if i remove it, i get tone, so it looks like sdio and fatfs are correctly implemented, unless i miss something

linas2
Associate II
Posted on June 22, 2012 at 15:47

any one did this ?

Posted on June 22, 2012 at 18:39

any one did this ?

Not exactly, but I do have a lot of mass storage and file system experience.

One area to consider is how you're interfacing the two code libraries. The FAT side is almost certainly dealing with sectors and clusters (ie blocks of 512 bytes, or 2KB..64KB, etc), where as the SDIO code is thinking about BYTE offsets in a 32-bit variable*. In order to interface you'll have to ensure you're using the same units, or translating them correctly. Like navigating a space probe around Mars and having different systems working in metric and imperial units.

* This is a pretty fatal flaw in the MSC/SDIO demo as cards >4GB will fail and the file system will trash itself. This is clearly a NAND memory model, and not coded by someone with a mass storage background.

Assume none of the code is thoroughly tested, or production ready.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..