AnsweredAssumed Answered

SDIO on STM32F3-Discovery

Question asked by huber.thomas on Jan 20, 2013
Latest reply on Mar 29, 2015 by troupe.curtis
 Just wondering if anyone has a working implementation on the STM32-F3Discovey of SPI access to a SD card? I'm using stm32303c_eval_spi_sd.c and stm32303c_eval_spi_sd.h from
STM32F30x_DSP_StdPeriph_Lib_V1.0.0/Utilities/STM32_EVAL/STM32303C_EVAL/,
the low-level routines SD_LowLevel_DeInit() and SD_LowLevel_Init() from 
STM32F30x_DSP_StdPeriph_Lib_V1.0.0/Utilities/STM32_EVAL/STM32303C_EVAL/stm32303c_eval.c
and the SD SPI Interface pin assignment below, 
but get a timeout when it activates the card initialization process.


Any pointers to code and/or help is much appreciated.



#define SD_SPI                           SPI2
#define SD_SPI_CLK                       RCC_APB1Periph_SPI2


#define SD_CS_PIN                        GPIO_Pin_12                 /* PB.12 */
#define SD_CS_GPIO_PORT                  GPIOB                       /* GPIOB */
#define SD_CS_GPIO_CLK                   RCC_AHBPeriph_GPIOB


#define SD_SPI_SCK_PIN                   GPIO_Pin_13                 /* PB.13 */
#define SD_SPI_SCK_GPIO_PORT             GPIOB                       /* GPIOB */
#define SD_SPI_SCK_GPIO_CLK              RCC_AHBPeriph_GPIOB
#define SD_SPI_SCK_SOURCE                GPIO_PinSource13
#define SD_SPI_SCK_AF                    GPIO_AF_5


#define SD_SPI_MISO_PIN                  GPIO_Pin_14                  /* PB.14 */
#define SD_SPI_MISO_GPIO_PORT            GPIOB                       /* GPIOB */
#define SD_SPI_MISO_GPIO_CLK             RCC_AHBPeriph_GPIOB
#define SD_SPI_MISO_SOURCE               GPIO_PinSource14
#define SD_SPI_MISO_AF                   GPIO_AF_5


#define SD_SPI_MOSI_PIN                  GPIO_Pin_15                  /* PB.15 */
#define SD_SPI_MOSI_GPIO_PORT            GPIOB                       /* GPIOB */
#define SD_SPI_MOSI_GPIO_CLK             RCC_AHBPeriph_GPIOB
#define SD_SPI_MOSI_SOURCE               GPIO_PinSource15
#define SD_SPI_MOSI_AF                   GPIO_AF_5




#define SD_DETECT_PIN                    GPIO_Pin_6                 /* PC.06 */
#define SD_DETECT_EXTI_LINE              EXTI_Line6
#define SD_DETECT_EXTI_PIN_SOURCE        EXTI_PinSource6
#define SD_DETECT_GPIO_PORT              GPIOC                       /* GPIOC */
#define SD_DETECT_GPIO_CLK               RCC_AHBPeriph_GPIOC
#define SD_DETECT_EXTI_PORT_SOURCE       EXTI_PortSourceGPIOC
#define SD_DETECT_EXTI_IRQn              EXTI9_5_IRQn




Outcomes