cancel
Showing results for 
Search instead for 
Did you mean: 

STM32MP1: timeout errors with uSD connected to SDMMC1

RBors.1
Associate II

Hello,

we are bringing-up our custom STM32MP157AAB3 board and we are facing some errors in linux with the uSD that it's connected to the SDMMC1 interface.

Here follows our setup:

  • HW
    • SDMMC1 cabled to a uSD connector, PE9 used as card detect
    • SDMMC2 cabled to a 4GB eMMC
    • SDMMC3 cabled to a custom connector (mainly for WiFi modules)
  • SW
    • OpenSTLinux-2.1.0
    • Custom devicetree created starting from STM32CubeMX tool with USER CODE derived from EVKs dts
    • tf-a and u-boot are read via SDMMC1
    • kernel is loaded via tftp
    • RFS is mounted via NFS

When we insert the uSD card the kernel periodically prints this error:

[ 134.448880] mmci-pl18x 58005000.sdmmc: error -110 requesting status

however the device is usable.

Using several uSD cards (of different manufacturers) we see that some are detected at the insertion and the volumes are automatically mounted, some are detected (the kernel creates the devices) but non other actions are performed (trying to manually mount the volumes stucks the tool), some other are not even detected. In the last 2 cases the bus seems to be stucked as no other uSD are detected (even the former ones) until the reboot.

So we performed some tests on the SDMMC3 bus, manually cabling a uSD connetor to the counterpart of the custom connector (with lenght mismatch and no impedance matching, this likely is a degrading configuration), dts bindigs are the same except for the missing card detect. Connecting any uSD card to this bus result in correct detect and volumes mount, no bus stuck or error prints.

For SDMMC1 bus, removing the card detect signal in the dts causes a detect loop when the uSD is inserted:

[ 39.036173] mmc0: new high speed SDHC card at address 59b4

[ 39.052012] mmcblk0: mmc0:59b4 USDU1 14.9 GiB

[ 39.078961] mmcblk0: p1

[ 40.009720] mmc0: card 59b4 removed

[ 40.131304] mmc0: new high speed SDHC card at address 59b4

[ 40.150951] mmcblk0: mmc0:59b4 USDU1 14.9 GiB

[ 40.161140] mmcblk0: p1

[ 40.532040] mmc0: card 59b4 removed

[ 40.631149] mmc0: new high speed SDHC card at address 59b4

[ 40.648180] mmcblk0: mmc0:59b4 USDU1 14.9 GiB

[ 40.657286] mmcblk0: p1

[ 40.659641] debugfs: Directory 'mmcblk0' with parent 'block' already present!

[ 41.129170] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

[ 42.483563] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.

[ 43.769061] mmc0: card 59b4 removed

[ 43.899232] mmc0: new high speed SDHC card at address 59b4

[ 43.915101] mmcblk0: mmc0:59b4 USDU1 14.9 GiB

[ 43.925600] mmcblk0: p1

[ 44.000230] FAT-fs (mmcblk0p1): FAT read failed (blocknr 584)

[ 44.270267] mmc0: card 59b4 removed

Is there any known issue about this behaviour?

Could this be an HW or a SW issue?

I'm available for any further detail or test.

Best regards,

Rosario

1 ACCEPTED SOLUTION

Accepted Solutions

Hi,

few thoughts:

  • as you did not have pull-ups on your board (as we have on our DK2), did you set pull-up on all SDMMC1 related pins inside DT sdmmc1_pins_mx and sdmmc1_opendrain_pins_mx nodes ?
bias-pull-up;
  • check card supply stability and maybe try to shortcut F3 ?
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.

View solution in original post

4 REPLIES 4
PatrickF
ST Employee

Hi,

maybe share your DT and HW schamtics around SD-Card detect switch ? Seems you might have a floating input.

For instance, on STM32MP157x-EV1, we have a switch to GND (with ESD) going to PG1 (pull-up is inside the chip).

This is declared in the &sdmmc1 node using :

	cd-gpios = <&gpiog 1 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;

if you want to disable HW detection, you should use instead:

  broken-cd:

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.
RBors.1
Associate II

Hello Patrick,

sorry for the delay, here the schematics:0693W00000AOiqYQAT.pngand the dts:

/dts-v1/;
#include <dt-bindings/pinctrl/stm32-pinfunc.h>
 
#include "stm32mp157.dtsi"
#include "stm32mp15xa.dtsi"
#include "stm32mp15xxab-pinctrl.dtsi"
#include "stm32mp157-m4-srm.dtsi"
 
/* USER CODE BEGIN includes */
#include <dt-bindings/mfd/st,stpmic1.h>
/* USER CODE END includes */
 
...
 
&sdmmc1{
	u-boot,dm-pre-reloc;
	pinctrl-names = "default", "opendrain", "sleep";
	pinctrl-0 = <&sdmmc1_pins_mx>;
	pinctrl-1 = <&sdmmc1_opendrain_pins_mx>;
	pinctrl-2 = <&sdmmc1_sleep_pins_mx>;
	status = "okay";
 
	/* USER CODE BEGIN sdmmc1 */
	cd-gpios = <&gpioe 9 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
	disable-wp;
	st,neg-edge;
	bus-width = <4>;
	vmmc-supply = <&v3v3>;
	/* USER CODE END sdmmc1 */
};

The 22R series resistors are also present in the SDMMC3 bus (that woks fine) and I tried to replace them with 0R and 39R without any benefit.

Tell me if you need more snippets.

The tests in my first post, relative to the bus without HW detections, were indeed performed with `broken-cd` property instead of `cd-gpios`.

Our main problem isn't the card detection but the timeout errors that indicate bad performances of the device.

Brest regards,

Rosario

Hi,

few thoughts:

  • as you did not have pull-ups on your board (as we have on our DK2), did you set pull-up on all SDMMC1 related pins inside DT sdmmc1_pins_mx and sdmmc1_opendrain_pins_mx nodes ?
bias-pull-up;
  • check card supply stability and maybe try to shortcut F3 ?
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.
RBors.1
Associate II

Hello Patrick,

you were right, I was missing the pull-up un the bus, enabling the internal pull-up will make the timeout prints much lesser but still present.

Adding external 10K pull-up has fixed the problem.

Thank you for your support.

Best regards,

Rosario