- 0x108 — 5V
0x107 — 3.3V
SD card with SPI adapter
SD card with SPI adapter
I've recieved this adapter some time ago and try to get it working with esp32. Hovever, with or without external pullup I always get one of that codes:
Re: SD card with SPI adapter
New results: 0x107 on both 5v and 3v.
Re: SD card with SPI adapter
Problem is solved by using another SD card. That one seems faulty…
Re: SD card with SPI adapter
When I use a couple of 16GB SD sards with an ESP32-WROOM-32 that I have an SD Card adapter connected externally I get the same issue (5v:0x107, 3v:0x108).
Following is tried GPIO connection and slot_config values
However when using the same 16GB SD cards with ESP32-DOWDQ6-based Lilygo T5 V2.3 they work.
How could I debug if that's a problem with the ESP32 or the adapter?
Following is tried GPIO connection and slot_config values
Code: Select all
slot_config.gpio_miso = 2
slot_config.gpio_mosi = 15
slot_config.gpio_sck = 14
slot_config.gpio_cs = 13
slot_config.dma_channel = 1
Code: Select all
slot_config.gpio_miso = 19
slot_config.gpio_mosi = 23
slot_config.gpio_sck = 18
slot_config.gpio_cs = 5
slot_config.dma_channel = 2
How could I debug if that's a problem with the ESP32 or the adapter?
Re: SD card with SPI adapter
I have thiis adapter connected in breadboard and 5V of course, and from time to time im having err 107 or 108 dont remember now. Its enough to move adapter a bit for better connection.
Re: SD card with SPI adapter
Fix is as following:
- Lower the communication frequency as the breadboard does not seem to be compatible with the default 20MHz
for example, use the following:
- Also, as @chegewara mentioned. Use 5 volts input (as the 3.3 volts input won't work)
Note: I didn't have to add any external pull-ups
Edit
Setting the max_freq_khz to any value less than the SDMMC_FREQ_DEFAULT and more than the SDMMC_FREQ_PROBING will enforce the use of SDMMC_FREQ_PROBING* which is a pretty low frequency, for example, for the a2dp_source example.
To go around that, one needs to set the sdmmc_types.h(line~135):SDMMC_FREQ_DEFAULT to a new value (may be 5000).
* Reference snippet from sdmmc_common.c(line~200):
- Lower the communication frequency as the breadboard does not seem to be compatible with the default 20MHz
for example, use the following:
Code: Select all
sdmmc_host_t host = SDSPI_HOST_DEFAULT();
host.max_freq_khz = SDMMC_FREQ_DEFAULT/2; // <- added line, SDMMC_FREQ_PROBING could be used too
Note: I didn't have to add any external pull-ups
Edit
Setting the max_freq_khz to any value less than the SDMMC_FREQ_DEFAULT and more than the SDMMC_FREQ_PROBING will enforce the use of SDMMC_FREQ_PROBING* which is a pretty low frequency, for example, for the a2dp_source example.
To go around that, one needs to set the sdmmc_types.h(line~135):SDMMC_FREQ_DEFAULT to a new value (may be 5000).
* Reference snippet from sdmmc_common.c(line~200):
Code: Select all
uint32_t selected_freq = SDMMC_FREQ_PROBING;
for (int i = 0; i < n_freq_values; ++i) {
uint32_t freq = freq_values[i];
if (card->max_freq_khz >= freq) {
selected_freq = freq;
break;
}
}
Re: SD card with SPI adapter
20 Mhz seems a lot. 10 Mhz might be pushing it.
Unfortunately there are a lot of clone cards.
I developed a product with an SD card & during reasearch bought many cards from a variety of suppliers from Amazon, ebay etc.
Each supposed OEM card bought either at different times or from different supplier had different; cases, labels, label colours etc.
Even major labels which led me to the conclusion that most cards were cheap copies.
Gate delays will really limit you're clock speeds & so cheap clones will not help. I would say that 6-8 MHz is probably a safer number.
Unfortunately there are a lot of clone cards.
I developed a product with an SD card & during reasearch bought many cards from a variety of suppliers from Amazon, ebay etc.
Each supposed OEM card bought either at different times or from different supplier had different; cases, labels, label colours etc.
Even major labels which led me to the conclusion that most cards were cheap copies.
Gate delays will really limit you're clock speeds & so cheap clones will not help. I would say that 6-8 MHz is probably a safer number.
& I also believe that IDF CAN should be fixed.
Who is online
Users browsing this forum: Google Feedfetcher and 89 guests