This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem in writing code for interfacing MicroSD with STM32

hello there,
can anyone please help me in writing the code for interfacing microSD with STM32 using SPI. I actually dont have proper library files and neither I know how to start the code i.e. which struct object should I make ?
Basically I need an example code so that I can write my own then.

  • Please stick to one thread rather than create dozens
    http://www.keil.com/forum/62158/

    STM32F10x_StdPeriph_Lib_V3.5.0\Utilities\STM32_EVAL\STM3210C_EVAL\stm3210c_eval.c
    STM32F10x_StdPeriph_Lib_V3.5.0\Utilities\STM32_EVAL\Common\stm32_eval_spi_sd.c

    You'll have to adapt the include/source files to describe YOUR hardware configuration. Review the README.TXT files, and information in expressed in the source files. The board level stuff is in the EVAL.C file mentioned above

    SD_Init(); // Calls your SD_LowLevel_Init() where you bring up YOUR hardware

    unsigned char Buffer[512];
    SD_ReadBlock(Buffer, 0, 512);

    This library supports cards up to 2GB, other code can be found on the web if this is not suitable, do a bit of digging