Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

USDHC: Fails after reset #32289

Closed
rtalbott opened this issue Feb 14, 2021 · 7 comments · Fixed by #39161
Closed

USDHC: Fails after reset #32289

rtalbott opened this issue Feb 14, 2021 · 7 comments · Fixed by #39161
Assignees
Labels
area: Disk Access bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug

Comments

@rtalbott
Copy link
Contributor

Describe the bug
The sd card sample fails after resetting board.

To Reproduce
Steps to reproduce the behavior:

  1. build samples/subsys/fs/fat_fs for imxrt1060_evk
  2. west flash
  3. works ok
  4. press reset
  5. fails with usdhc: CMD17 Polling ERROR

Expected behavior
work the same after flash pressing reset

Impact
showstopper for use of the usdhc

Environment (please complete the following information):

  • OS: Linux
  • Toolchain: Zephyr v2.5.0-rc4
  • Commit SHA or Version used: Zephyr OS build v2.5.0-rc4-2-g769d91b922b7

Logs and console output
west flash
*** Booting Zephyr OS build v2.5.0-rc4-2-g769d91b922b7 ***
Sector size 512
Memory Size(MB) 15271
Disk mounted.

Listing dir /SD: ...
[DIR ] SPOTLI1
[DIR ] FSEVEN
1
[DIR ] SYSTEM1
[FILE] TEXTTX
1.TXT (size = 26)
[00:00:00.105,000] usdhc: SD inserted!

[00:00:00.112,000] main: Block count 31275008

pressed reset
*** Booting Zephyr OS build v2.5.0-rc4-2-g769d91b922b7 ***
Error mounting disk.
[00:00:00.105,000] usdhc: SD inserted!

[00:00:00.364,000] usdhc: CMD17 Polling ERROR

[00:00:00.364,000] usdhc: USDHC bus device initalization failed!

[00:00:00.364,000] main: Storage init ERROR!
[00:00:00.365,000] fs: fs mount error (-5)

west flash
*** Booting Zephyr OS build v2.5.0-rc4-2-g769d91b922b7 ***
Sector size 512
Memory Size(MB) 15271
Disk mounted.

Listing dir /SD: ...
[DIR ] SPOTLI1
[DIR ] FSEVEN
1
[DIR ] SYSTEM1
[FILE] TEXTTX
1.TXT (size = 26)
[00:00:00.105,000] usdhc: SD inserted!

[00:00:00.112,000] main: Block count 31275008

pressed reset
*** Booting Zephyr OS build v2.5.0-rc4-2-g769d91b922b7 ***
Error mounting disk.
[00:00:00.105,000] usdhc: SD inserted!

[00:00:00.364,000] usdhc: CMD17 Polling ERROR

[00:00:00.364,000] usdhc: USDHC bus device initalization failed!

[00:00:00.364,000] main: Storage init ERROR!
[00:00:00.365,000] fs: fs mount error (-5)

@rtalbott rtalbott added the bug The issue is a bug, or the PR is fixing a bug label Feb 14, 2021
@nashif nashif added the priority: low Low impact/importance bug label Feb 15, 2021
@MaureenHelm MaureenHelm self-assigned this Feb 23, 2021
@MaureenHelm
Copy link
Member

I haven't been able to reproduce this issue. Have you tried a different SD card?

@lgl88911 have you seen this behavior?

@lgl88911
Copy link
Collaborator

lgl88911 commented Apr 3, 2021

@MaureenHelm It may be that the hardware design does not support the high speed mode switching for UHS Card. This problem can also be solved from the software,please refer to #29096 for modification to see if it is valid.
For my hardware, When don't use #29096, you will see the following log

[00:00:00.020,000] <inf> usdhc: SD inserted!

[00:00:00.101,000] <err> usdhc: CMD17 Polling ERROR

[00:00:00.101,000] <err> usdhc: USDHC bus device initalization failed!

[00:00:00.101,000] <err> fs: fs mount error (-5)

@lgl88911
Copy link
Collaborator

Since the usdhc code was moved to the driver, #29096 was abolished and create #34205

@MaureenHelm
Copy link
Member

Fixed by #34205. Please reopen if you still see the issue after pulling in this change.

@nxf58843
Copy link

I still get this issue with some micro SD cards.
Kingston 16GB HC I fails after reset or power on, but works immediately after the firmware is loaded.
SanDisk Ultra 16GB HC I works after reset or power on.
This is with latest: Zephyr OS build zephyr-v2.6.0-2021-ge78cb747bd85

@MaureenHelm MaureenHelm reopened this Aug 17, 2021
@lgl88911
Copy link
Collaborator

lgl88911 commented Sep 1, 2021

@nxf58843 Whether no-1-8-v has been added to the devicetree of usdhc. if not, can you try the following:

&usdhc1 {
	status = "okay";
	cd-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>;
	no-1-8-v;
};

@danieldegrasse
Copy link
Collaborator

Linked pull request adds no-1-8-v to the devicetree of all rt10xx evaluation boards that support SDMMC, since all of them encounter reliability issues when communicating with SD cards at 1.8V

dleach02 pushed a commit that referenced this issue Oct 7, 2021
The mimxrt10xx evaluation boards that support the NXP USDHC IP
communicate unreliably with SD cards at 1.8V using the USDHC driver.
This commit temporarily disables 1.8V communication for all rt10xx
boards that currently support the USDHC driver.

Fixes #32289

Signed-off-by: Daniel DeGrasse <[email protected]>
Rushybrook pushed a commit to Rushybrook/zephyr that referenced this issue Oct 21, 2021
The mimxrt10xx evaluation boards that support the NXP USDHC IP
communicate unreliably with SD cards at 1.8V using the USDHC driver.
This commit temporarily disables 1.8V communication for all rt10xx
boards that currently support the USDHC driver.

Fixes zephyrproject-rtos#32289

Signed-off-by: Daniel DeGrasse <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Disk Access bug The issue is a bug, or the PR is fixing a bug platform: NXP NXP priority: low Low impact/importance bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants