I designed a board with a STM32F051 mcu.
The SPI2 of the mcu is connected to a MicroSD socket.
When trying to connect to the SD card with mmcConnect(), it remains stuck in an infinite loop waiting the idle state.
(wait() in send_hdr()).
However, when trying the same code with the SPI1 (configuring the pins accordingly), everything works fine…
Any idea please?
Here's the SPI config I'm using:
Code: Select all
static SPIConfig hs_spicfg = {NULL, GPIOB, 12,
SPI_CR1_BR_1,
SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0 };
static SPIConfig ls_spicfg = {NULL, GPIOB, 12,
SPI_CR1_BR_2 | SPI_CR1_BR_1,
SPI_CR2_DS_2 | SPI_CR2_DS_1 | SPI_CR2_DS_0 };
/* MMC/SD over SPI driver configuration.*/
static MMCConfig mmccfg = {&SPID2, &ls_spicfg, &hs_spicfg};