-
Notifications
You must be signed in to change notification settings - Fork 6.8k
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
Teensy41 support SDHC - Storage init Error #42227
Comments
I tested the interface with Arduino and the same SD card. Which works and shows both information and files on the SD card. So this confirms it is setting/driver related |
When the function usdhc_board_access_init is ran in zephyr/driver/disk/usdhc.c
Additional information: So the cd-gpios in the dts should not be there. The statement Result is the card is never detected A dirty workaround is to add this to the dts or overlay and then it works:
Note that I also add no-1-8-v; |
@EmbedWise , would you like to open a PR to fix it in |
@EmbedWise I don't have a teensy board to test this fix on, but looking at the schematic for the board it looks like the chip detect line for the SD card is not routed. The USDHC driver supports detecting a card via the internal pull up resistor on the DAT3 line. I've opened a PR (#42379) to switch the |
teensy41 has no chip detect signal for SD slot. Use DAT3 pull card detection. Remove software defined chip detect IOMUXC selection that was used as a dummy pin. Fixes #42227 Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The PR is in |
@danieldegrasse I will test it and revert back to you. |
I verified it on the Teensy 4.1 board but it is not detecting the SD card. Code that I used can be found on Github https://github.com/EmbedWise/zephyr_teensy4_app And used a775606 of the Zephyr repository. If I change it to a dummy GPIO it works and detects the card. |
@EmbedWise, taking another look at this, there is no power control circuitry for the SD card, so that may be causing the SD card detection with DAT3 to fail. What specific error do you see when using DAT3 card detection, as opposed to the dummy GPIO? |
@danieldegrasse there is indeed no power control circuit. The error I see it the following:
|
I just tried the maybe this issue should get reopened. |
Probably so, I'll go ahead and do that. This board doesn't have any card detect circuitry, so I think the best solution may be to modify the driver to assume a card is present if no card detect method is configured. |
The imx USDHC driver previously queried the peripheral's internal card detect signal to check card presence if no card detect method was configured. However, some boards do not route the card detect signal and do not work correctly with the DAT3 detection method supported by this peripheral. As a fallback, assume the card is present in the slot but log a warning to the user. Fixes zephyrproject-rtos#42227 Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The imx USDHC driver previously queried the peripheral's internal card detect signal to check card presence if no card detect method was configured. However, some boards do not route the card detect signal and do not work correctly with the DAT3 detection method supported by this peripheral. As a fallback, assume the card is present in the slot but log a warning to the user. Fixes zephyrproject-rtos#42227 Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com>
The imx USDHC driver previously queried the peripheral's internal card detect signal to check card presence if no card detect method was configured. However, some boards do not route the card detect signal and do not work correctly with the DAT3 detection method supported by this peripheral. As a fallback, assume the card is present in the slot but log a warning to the user. Fixes zephyrproject-rtos#42227 Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com> (cherry picked from commit 17f71e1)
The imx USDHC driver previously queried the peripheral's internal card detect signal to check card presence if no card detect method was configured. However, some boards do not route the card detect signal and do not work correctly with the DAT3 detection method supported by this peripheral. As a fallback, assume the card is present in the slot but log a warning to the user. Fixes zephyrproject-rtos#42227 (cherry picked from commit 17f71e1) Original-Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com> GitOrigin-RevId: 17f71e1 Cr-Build-Id: 8738819815572775377 Cr-Build-Url: https://cr-buildbucket.appspot.com/build/8738819815572775377 Copybot-Job-Name: zephyr-main-copybot-downstream Change-Id: I2205284a9c94d4f9b6b0592ab17417686b4ead19 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5807813 Reviewed-by: Eric Yilun Lin <yllin@google.com> Tested-by: Eric Yilun Lin <yllin@google.com> Tested-by: ChromeOS Prod (Robot) <chromeos-ci-prod@chromeos-bot.iam.gserviceaccount.com> Commit-Queue: Eric Yilun Lin <yllin@google.com>
The imx USDHC driver previously queried the peripheral's internal card detect signal to check card presence if no card detect method was configured. However, some boards do not route the card detect signal and do not work correctly with the DAT3 detection method supported by this peripheral. As a fallback, assume the card is present in the slot but log a warning to the user. Fixes #42227 Signed-off-by: Daniel DeGrasse <daniel.degrasse@nxp.com> (cherry picked from commit 17f71e1)
Describe the bug
Working on the Teensy41 and trying to get the SD Card functionality to work. For this using the application developed by @bdkrae / @ufechner7. See https://github.com/bdkrae/zephyr_teensy4_test. Which is based on the
zephyr/samples/subsys/fs/fat_fs
.Please also mention any information which could help others to understand
the problem you're facing:
I have also tried to follow the instructions
I cannot find this Macro where that is defined. I already tried using the FLAG directly USDHC_HOST_CTRL_CAP_VS18_MASK. Still the same error.
To Reproduce
Using Zephyr 2.7.1
Expected behavior
SD Card should have been mounted
Logs and console output
Environment:
The text was updated successfully, but these errors were encountered: