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
Cant get a MicroSD card to work. (IDFGH-5170) #965
Comments
Well im quite new to all this so im not sure if im working correctly with GitHub, but I created to different folders: esp and esp2 commit 2861f3e than I run it in esp2, I get: commit 9fa2a9a
I understand the in esp2 is the one in which it was working fine, right? |
Please try updating to the latest master branch. The issue should be fixed now. |
Hi @alexgrauer , have you tried the latest IDF? Is this problem solved now? |
In Lua RTOS we receive this errors: E (5257) sdspi_host: data CRC failed, got=0x98d3 expected=0xcbe3 |
@jolivepetrus, can you give more information about your hardware setup (i.e. circuit diagram)? Does the error also happen if you add Based on the log, SDMMC peripheral has been initialized correctly, and the card probing was successful, but there was a CRC mismatch during data transfer between the peripheral and the card. |
If adding host.max_freq_khz = SDMMC_FREQ_PROBING, works well. It seems that fails with SDSC cards. Maybe the idf driver doesn't check for SD Card max speed? Connections: MISO=GPIO19 Attached you have the schematic. |
SD card max speed (reported by the card) is always 25MHz, until switch_func command is executed to enable high-speed mode. The behavior here is the same for SDSC and SDHC. If you set max_freq_khz parameter to SDMMC_FREQ_DEFAULT, then the driver will use 20MHz frequency and will not attempt to put the card into high-speed mode. The question is, did the IDF driver work with the same cards and the same hardware previously? If it did, then the issue is likely related to SDMMC peripheral clock changes which were implemented to support high-speed mode. Another question, why does your schematic mention SPI mode signals (CS/MOSI/MISO/CLK) when you are in fact using the card in SD mode? |
In my test hardware I'm using an SD to micro SD adapter. |
Ok, so then CS (DAT3) pin is not connected to the ESP32, is that correct? Also, please answer my other question above (whether same hardware worked with previous IDF version). |
For clarify. Somewhere in the time the same hardware worked, but I'm realised that my tests are done with an unbranded SD Card (2 Gb microSD). It's difficult for me to find the right combination of idf / Lua RTOS commits for demonstrate it. With a Kingston 16Gb HC, works. |
Okay, in that case i am going to close this issue. If you happen to find a case when same hardware used to work but doesn't work with the current version of IDF, please feel free to reopen. We plan to add a feature to SDMMC driver to do automatic tuning of read/write clock edges, which may improve robustness at high speeds. |
Somewhere in the time the same hardware worked using Lua RTOS SD driver. In that driver some SD cards where configured at 12.5 Mhz.
|
You aren't confusing 12.5 MHz and 12.5 MByte/s, are you? In default speed mode (25MHz / 12.5MByte/s), which should be supported by all SD cards, we use 20MHz clock frequency, because the clock divider can only produce 160MHz/n, i.e. either 20 or 26.7 MHz. Support for high speed mode (50MHz / 25MByte/s) is checked at runtime, and if the card supports it, SDMMC driver will switch it into high speed mode. For high speed mode, we use 40 MHz clock frequency (due to a limitation of clock divider, only 53.3MHz or 40MHz frequencies are possible). |
Yes, I'm confused. |
Hi @igrr, could you help please. With latest commit, simple connection (10k on SPI sd board)
and at the end this:
Card: microSD HC 4 GB |
I've got the same issue here, a lot of mostly 0 "cmd response"s and then suddenly a
My esp-idf is on commit fb7ba1b and I'm using a Catalex MicroSD Adapter with a Sandisk Ultra 32GB MicroSDXC. |
Solved this issue! I was hitting 0x107 as well and it turns out I just was not supplying enough 3.3v power to VDD. I had my SD card attached to a GPIO and using that as the 3.3v supply, but GPIOs can only do 40mA and SD cards can peak about 100mA so it wasn't enough. Giving it a dedicated 3.3v power rail worked. |
I'm also getting 0x107 error with 32GB MicroSD card (FAT32) while running the latest IDF SD card example on Titigo Lora32 LED board (with integrated SD card slot). Here's the log I'm getting:
The example works correctly on an old 2GB FAT16 card. Now I don't know if this is caused by hardware (32GB card using too much power) or software (library not supporting FAT32 or an error in the given example). |
Just a reminder that the problem may be caused by a hardware problem too sdmmc_common: sdmmc_init_ocr: send_op_cond (1) returned 0x107
[E][SD_MMC.cpp:85] begin(): Failed to initialize the card (263). Make sure SD card lines have pull-up resistors in place. Here Jason checked a lot of 20 ESP32CAMs and 6 had problems with the MicroSD Card. ESP-32-cam “Mounting SD card” Error
That is a 30% chance that a modules SD Card is not working! Thanks for your great software tools! |
Hi all,
Im trying to make a microSD card to work but im not being able.
I have the following boards:
ESP-WROOM-32: http://www.ebay.com.au/itm/262953936783
Micro SD shield #1: http://www.ebay.com.au/itm/191736124794
Micro SD shield #2: https://www.amazon.com/gp/product/B071WJ99N8/ref=oh_aui_detailpage_o05_s00?ie=UTF8&psc=1
If I use the Micro SD shield #1 I don't put the resistors defined in the SD Card Example because it seems as it already has them.
If I use the Micro SD shield #2 then I do everything as it says in the example.
But for sure im doing something wrong.
Im not being able to make it work in any of the modes 4-line, 1-line or SPI.
When I use Micro SD shield #1, I do the following connections for SPI:
IO13 -> CS
IO15 -> MOSI
IO2 -> MISO
IO14 -> CLK
GND -> GND
3.3V -> 3.3V (I also tried with the 5V)
but I always get:
I (0) cpu_start: App cpu up.
I (577) heap_init: Initializing. RAM available for dynamic allocation:
I (597) heap_init: At 3FFAE2A0 len 00001D60 (7 KiB): DRAM
I (616) heap_init: At 3FFB2748 len 0002D8B8 (182 KiB): DRAM
I (635) heap_init: At 3FFE0440 len 00003BC0 (14 KiB): D/IRAM
I (655) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (674) heap_init: At 400880F4 len 00017F0C (95 KiB): IRAM
I (693) cpu_start: Pro cpu start user code
I (752) cpu_start: Starting scheduler on PRO CPU.
I (191) cpu_start: Starting scheduler on APP CPU.
I (191) example: Initializing SD card
I (191) example: Using SPI peripheral
I (191) gpio: GPIO[13]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0
E (1241) sdmmc_cmd: sdmmc_card_init: send_op_cond (1) returned 0x107
E (1241) example: Failed to initialize the card (263). Make sure SD card lines have pull-up resistors in place.
When I use Micro SD shield #2, I do the connections defined in the example.
What can be wrong? Maybe I don't understand something about GPIO12? wat should I do with it, I mean, about all it says in the Note, I don't get it 100%.
I used two different micro sd cards, but nothing.
Anyone with any ideas?
Thanks in advance
Alex
The text was updated successfully, but these errors were encountered: