Page 1 of 1

mmc_spi problem

Posted: Tue Sep 29, 2020 7:49 pm
by asdasd
Hi ,
I want to connect sd card with stm32f103c8(Blue Pill) using chibios191 with (RT-STM32F103-OLIMEX_STM32_P103-FATFS)demo.
But it doesn't work. when I test the SPI pin on oscilloscope there is no signal output on it.
I Have tried to disable JTAG (AFIO->MAPR |=AFIO_MAPR_SWJ_CFG_JTAGDISABLE) noting happend :| ,
also I tried to switch to SPI1 but I failed . :oops:

another question :
does I have to change
(mmc_lld_is card _inserted) and (mmc_lld_is _write_protected ) or it doesn't mater ? :?: :?: :?: :?: :?:

does spi signal send continues trying to connect or it have un event? :?: :!:

Re: mmc_spi problem

Posted: Tue Sep 29, 2020 9:38 pm
by Giovanni
Probably you need to set the alternate function for SPI. Yes, you need to implement those functions if you want card insertion detection.

Giovanni

Re: mmc_spi problem

Posted: Wed Sep 30, 2020 1:46 pm
by asdasd
Giovanni wrote:Probably you need to set the alternate function for SPI. Yes, you need to implement those functions if you want card insertion detection.

Giovanni

thanks for fast replay,
i have set spi pin as alternate and i modify the connecting to be from the shell and every thing is fine in one sd card(kingston 4GB)FAT32. :)
but when i connect anther sd card (ADATA 16GB)FAT32 i can't connecting to it . :!: :!: :!: :!: :!: :!: :!:
can i modifed any thing to connect all sd card? :?:

best regard>.

Re: mmc_spi problem

Posted: Wed Sep 30, 2020 5:45 pm
by Giovanni
Hi,

the MMC_SPI driver is like 10 years old, it is possible that recent (high capacity) cards expect a more complex initialization sequence during connection, probably it is not a problem on your side but the driver likely needs an update. Not sure how to proceed.

You may look at the initialization sequence in the SD driver, that one is more updated.

Giovanni