cancel
Showing results for 
Search instead for 
Did you mean: 

MicroSD initialization timeout. When inserting the sd card, dmseg shows "mmc0: error -110 whilst initialising SD card" With some logs, i see that mmc_send_app_op_cond is the function that timeouts.

Lmoio.1
Senior

My device tree is the following:

&sdmmc1 {
	pinctrl-names = "default", "opendrain", "sleep";
	pinctrl-0 = <&sdmmc1_b4_pins_a>;
	pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
	cd-gpios = <&gpiog 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
	disable-wp;
	cd-debounce-delay-ms = <500>;
	no-1-8-v;
	max-frequency = <1000000>;
	//st,sig-dir;
	//st,neg-edge;
	//st,use-ckin;
	bus-width = <4>;
	vmmc-supply = <&vdd_sd>;
	//vqmmc-supply = <&sd_switch>;
	sd-uhs-sdr12;
	sd-uhs-sdr25;
	sd-uhs-sdr50;
	sd-uhs-ddr50;
	status = "okay";
};

Sd schematics is the following:

0693W00000FDx2HQAT.png

4 REPLIES 4
PatrickF
ST Employee

Hi,

I copy below the STM32MP157F-DK2 Device tree portion which could help.

&sdmmc1 {
	pinctrl-names = "default", "opendrain", "sleep";
	pinctrl-0 = <&sdmmc1_b4_pins_a>;
	pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
	cd-gpios = <&gpiob 7 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
	disable-wp;
	st,neg-edge;
	bus-width = <4>;
	vmmc-supply = <&v3v3>;
	status = "okay";
};

please remove all the sd-uhs-***; which refer to 1.8V signalling not supported with your HW.

please add st,neg-edge;

not sure max-frequency = ; is needed. please refer also to this article in case of issue about SDMMC frequencies: https://community.st.com/s/article/FAQ-STM32MP1-how-to-setup-the-SDMMC-CK-clock-frequency-in-Linux

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.

Hi @PatrickF​

removing the st,* and all the sd-uhs* properties was not enough, I had to add 

/delete-property/ st,sig-dir;
	/delete-property/ st,use-ckin;	
        /delete-property/ sd-uhs-sdr12;
	/delete-property/ sd-uhs-sdr25;
	/delete-property/ sd-uhs-sdr50;
	/delete-property/ sd-uhs-ddr50;

now I can see the SD.

At times, i see still the error after removing the card:

[   64.185572] mmc0: new high speed SDHC card at address e624
[   64.199567] mmcblk0: mmc0:e624 SS16G 14.8 GiB
[   64.209597]  mmcblk0: p1
[   65.218871] mmc0: card e624 removed
[   65.338268] mmc0: error -110 whilst initialising SD card

thanks

Maybe this is resolved by adding   cd-debounce-delay-ms = <>;

Yes, sound a logical solution. We have not that 'debounce' on our boards because the SD-Card is the boot source and not expected to be removed.

Btw, I'm puzzle regarding your need to use the "/delete-property/" on your DT as those tags are not present by default in the DT.

Maybe double check that you are not including/using some other (then unwanted) Device Tree (from e.g. EV1 board which has a level shifter on SD-Card).

The wrong import of other boards DT might create issues on other peripherals.

Regards.

In order to give better visibility on the answered topics, please click on 'Accept as Solution' on the reply which solved your issue or answered your question.