2013-01-20 12:59 AM
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.cand 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.&sharpdefine SD_SPI SPI2&sharpdefine SD_SPI_CLK RCC_APB1Periph_SPI2&sharpdefine SD_CS_PIN GPIO_Pin_12 /* PB.12 */&sharpdefine SD_CS_GPIO_PORT GPIOB /* GPIOB */&sharpdefine SD_CS_GPIO_CLK RCC_AHBPeriph_GPIOB&sharpdefine SD_SPI_SCK_PIN GPIO_Pin_13 /* PB.13 */&sharpdefine SD_SPI_SCK_GPIO_PORT GPIOB /* GPIOB */&sharpdefine SD_SPI_SCK_GPIO_CLK RCC_AHBPeriph_GPIOB&sharpdefine SD_SPI_SCK_SOURCE GPIO_PinSource13&sharpdefine SD_SPI_SCK_AF GPIO_AF_5&sharpdefine SD_SPI_MISO_PIN GPIO_Pin_14 /* PB.14 */&sharpdefine SD_SPI_MISO_GPIO_PORT GPIOB /* GPIOB */&sharpdefine SD_SPI_MISO_GPIO_CLK RCC_AHBPeriph_GPIOB&sharpdefine SD_SPI_MISO_SOURCE GPIO_PinSource14&sharpdefine SD_SPI_MISO_AF GPIO_AF_5&sharpdefine SD_SPI_MOSI_PIN GPIO_Pin_15 /* PB.15 */&sharpdefine SD_SPI_MOSI_GPIO_PORT GPIOB /* GPIOB */&sharpdefine SD_SPI_MOSI_GPIO_CLK RCC_AHBPeriph_GPIOB&sharpdefine SD_SPI_MOSI_SOURCE GPIO_PinSource15&sharpdefine SD_SPI_MOSI_AF GPIO_AF_5&sharpdefine SD_DETECT_PIN GPIO_Pin_6 /* PC.06 */&sharpdefine SD_DETECT_EXTI_LINE EXTI_Line6&sharpdefine SD_DETECT_EXTI_PIN_SOURCE EXTI_PinSource6&sharpdefine SD_DETECT_GPIO_PORT GPIOC /* GPIOC */&sharpdefine SD_DETECT_GPIO_CLK RCC_AHBPeriph_GPIOC&sharpdefine SD_DETECT_EXTI_PORT_SOURCE EXTI_PortSourceGPIOC&sharpdefine SD_DETECT_EXTI_IRQn EXTI9_5_IRQn #stm32f3discovery #spi-sd-card-stm32-discovery #stm322013-01-20 05:45 AM
The chip select needs a pull-up (10K).
Not clear if the software supports SD or SDHC cards, but doesn't look to support cards >=4GB properly, so I'd guess is SD only with cards of 2GB or less.2013-01-20 05:49 AM
The chip select needs a pull-up (10K).
Not clear if the software supports SD or SDHC cards, but doesn't look to support cards >=4GB properly, so I'd guess is SD only with cards of 2GB or less.2015-03-28 05:02 PM
Has anyone modified the SPI SD library to support a 4GB card?
2015-03-29 06:14 AM
Perhaps not the exact scenario, but Yes
2015-03-29 01:55 PM
Is the updated library to handle 4GB and larger SD cards available to download? I have downloaded the stm32303c_eval_sp_sd.c & .h and it assumes that you have a 2GB or smaller card.