2021-05-05 02:47 AM
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:
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
Solved! Go to Solution.
2021-05-18 12:16 AM
Hi,
few thoughts:
bias-pull-up;
2021-05-10 08:44 AM
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.
2021-05-17 11:28 PM
Hello Patrick,
sorry for the delay, here the schematics:and 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
2021-05-18 12:16 AM
Hi,
few thoughts:
bias-pull-up;
2021-05-18 04:16 AM
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