cancel
Showing results for 
Search instead for 
Did you mean: 

Using SDIO instead of SPI in STM32

tinymanta
Associate II
Posted on January 09, 2013 at 14:14

Hi all,

How can I use the SDIO to access to an uSD card with EFSL filesystem.

The example I have is using EFSL with SPI as communication interface.

I should have an interface.c file where I do a low level interface implementation, to initialize the hardware, read sectors from the disc, and write sectors to the disc.

The function that initializes the hardware using is stm32_eval_spi_sd:

esint8 if_initInterface(hwInterface* file, eint8* opts)
{
euint32 sc;
SD_Init();
SD_GetCSDRegister(&SD_csd);
/* SDCard Capacity*/
sc = SD_csd.DeviceSize + 1;
sc *= (1 << (SD_csd.DeviceSizeMul + 2));
sc *= (1 << (SD_csd.RdBlockLen));
file->sectorCount = sc / 512;
if ( (sc % 512) != 0)
{
file->sectorCount--;
}
return(0);
}

How can I perform this function using the stm32_eval_sdio_sd instead of stm32_eval_spi_sd ?
11 REPLIES 11
Posted on February 02, 2013 at 23:33

No, and my name actually is Clive

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
jlamb
Associate II
Posted on February 03, 2013 at 13:28

Well you both look alike lol

Congratulations on 4000 posts clive