-
Notifications
You must be signed in to change notification settings - Fork 7.3k
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
Failed to initialize 64 GB microsd card (IDFGH-4892) #6686
Comments
I would also suggest to decrease frequency to 8-10MHz for testing. Can you post link to sd card module, or picture of it, please. |
I am using microSD Card modul SPI 3.3V, datasheet SD-MINI.pdf I have tried I have tried to create my own module https://www.mischianti.org/2019/12/15/how-to-use-sd-card-with-esp8266-and-arduino/ , got same issue with unssuported command 52 and 5 I have created bug here as then I tried my last option - try different sd cards (mentioned above) and they work flawlesly. I see this as an issue in a driver. |
@petercipov Could you please save and attach here the data captured by the logic analyzer? CMD5 and CMD52 are indeed unsupported by memory cards (these are SDIO commands) but this shouldn't influence subsequent initialization (per standard, at least...) I'd like to see what happens later in the initialization process, maybe there is some other issue. |
By the way, you can also check if indeed sending the IO commands causes this card to fail during initialization. To do this, delete two lines: esp-idf/components/sdmmc/sdmmc_init.c Lines 45 to 46 in 73db142
and esp-idf/components/sdmmc/sdmmc_init.c Lines 54 to 55 in 73db142
then try to run the example again. |
Hello @igrr , here is dslogic file with full communication (using dsview 1.1.2) I have recompiled firmware with commenting those two commands, got different error
I have set EXAMPLE_FORMAT_IF_MOUNT_FAILED to also to true, but got same error. |
Hi @petercipov, sorry for not replying sooner. So far I have managed to get the same model of the card and to reproduce the issue. Unfortunately, I haven't been able to figure out what makes this specific card model to time out replying to SEND_OP_COND command, yet. Will let you know when there is some progress. |
I can confirm regression in master branch. I am reporting here due to cmd 52
board: S2 saola EDIT in my case it was very small issue with USB cable (lose connection) |
Hello. I'm new in this discouus. I'am using the driver SDSPI by esp-tool and when I off my device and I up I have this issue: I (315) spi_flash: detected chip: generic can some one help me, please? and I have another question. in this driver, How can I to open a file? I'm using an task to open the file but I have this issue; E (1126) example: Failed to open file for writing Thank you |
ACMD41 argument is different between SD mode and SPI mode. In SPI mode, the only non-zero bit may be the HCS bit. Unlike the SD mode, the bits reflecting the host's OCR should be zero. Previously, we used to set these bits the same way as for the SD mode. This has caused certain cards to fail initializing, apparently their controllers have checked the ACMD41 argument more strictly and refused to finish initialization, resulting in an error such as sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107 (Note that this error may have other causes than the one fixed in this commit. For example, if the card doesn't have a sufficient and stable power supply, it may also fail to complete the internal initialization process, and will never clear the busy flag in R1 response.) Closes #6686 Closes #10542
ACMD41 argument is different between SD mode and SPI mode. In SPI mode, the only non-zero bit may be the HCS bit. Unlike the SD mode, the bits reflecting the host's OCR should be zero. Previously, we used to set these bits the same way as for the SD mode. This has caused certain cards to fail initializing, apparently their controllers have checked the ACMD41 argument more strictly and refused to finish initialization, resulting in an error such as sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107 (Note that this error may have other causes than the one fixed in this commit. For example, if the card doesn't have a sufficient and stable power supply, it may also fail to complete the internal initialization process, and will never clear the busy flag in R1 response.) Closes #6686 Closes #10542
ACMD41 argument is different between SD mode and SPI mode. In SPI mode, the only non-zero bit may be the HCS bit. Unlike the SD mode, the bits reflecting the host's OCR should be zero. Previously, we used to set these bits the same way as for the SD mode. This has caused certain cards to fail initializing, apparently their controllers have checked the ACMD41 argument more strictly and refused to finish initialization, resulting in an error such as sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107 (Note that this error may have other causes than the one fixed in this commit. For example, if the card doesn't have a sufficient and stable power supply, it may also fail to complete the internal initialization process, and will never clear the busy flag in R1 response.) Closes #6686 Closes #10542
ACMD41 argument is different between SD mode and SPI mode. In SPI mode, the only non-zero bit may be the HCS bit. Unlike the SD mode, the bits reflecting the host's OCR should be zero. Previously, we used to set these bits the same way as for the SD mode. This has caused certain cards to fail initializing, apparently their controllers have checked the ACMD41 argument more strictly and refused to finish initialization, resulting in an error such as sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107 (Note that this error may have other causes than the one fixed in this commit. For example, if the card doesn't have a sufficient and stable power supply, it may also fail to complete the internal initialization process, and will never clear the busy flag in R1 response.) Closes #6686 Closes #10542
ACMD41 argument is different between SD mode and SPI mode. In SPI mode, the only non-zero bit may be the HCS bit. Unlike the SD mode, the bits reflecting the host's OCR should be zero. Previously, we used to set these bits the same way as for the SD mode. This has caused certain cards to fail initializing, apparently their controllers have checked the ACMD41 argument more strictly and refused to finish initialization, resulting in an error such as sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107 (Note that this error may have other causes than the one fixed in this commit. For example, if the card doesn't have a sufficient and stable power supply, it may also fail to complete the internal initialization process, and will never clear the busy flag in R1 response.) Closes espressif#6686 Closes espressif#10542
Environment
git describe --tags
to find it):platformio/framework-espidf 3.40200.210118 @ ~3.40200.0
Problem Description
Using 64 GB micro sd card (Kingston MicroSDXC 64GB Canvas Go! Plus)does not work with example code https://github.com/espressif/esp-idf/tree/master/examples/storage/sd_card This sd card works well with arduino uno and is well formatted with fat32
I am using 3.3 V micro sd card module to connect to esp32 board.
I have tried 32 GB (Samsung MicroSDHC 32GB EVO Plus) and 16GB (SanDisk MicroSDHC 16GB Ultra Android) micro sd card. Both works as expected
I have spotted in logs that spi commands (52 and 5) are not supported by particular 64 GB card.
Expected Behavior
example code works with 64 Gb micro sd card or update documentation that such cards are not supported.
Actual Behavior
Failed to initialize the card
Steps to reproduce
PIN_NUM_MOSI 15
PIN_NUM_CLK 14
PIN_NUM_CS 13
Debug Logs
The text was updated successfully, but these errors were encountered: