Page 1 of 1

Increase SD frequency clock with SPI mode to 40MHz

Posted: Tue Oct 08, 2019 3:33 pm
by gunar.kroeger
Hi,

I'm trying to increase the frequency clock of my SD card to 40MHz. I have a SD card class 10 and UHS-I, which is supposed to work with clock speeds up to 50MHz, according to this https://panasonic.net/cns/sdcard/indust ... mance.html

I am defining the host as presented below:

Code: Select all

sdmmc_host_t host = SDSPI_HOST_DEFAULT();
host.max_freq_khz = 40000; //or SDMMC_FREQ_HIGHSPEED
But when I try to run my application, it automatically sets the speed to the default 20MHz and the following error appears:
sdmmc_sd: sdmmc_enable_hs_mode_and_check: select_card (1) returned 0x106
Of which "0x106" indicates an operation or feature not supported.

Am I missing some kind of configuration necessary to enable the highspeed mode?

PS.: I have also tried using the " sdspi_host_set_card_clk()" function, but it gives the sames error.

Thanks in advance!

Re: Increase SD frequency clock with SPI mode to 40MHz

Posted: Tue Oct 08, 2019 5:02 pm
by ESP_igrr
Hi gunar.kroeger,

I'm afraid the SPI driver doesn't support 40MHz clock frequency in full duplex mode. The highest frequency is 26.6 MHz, see https://docs.espressif.com/projects/esp ... iderations.

Re: Increase SD frequency clock with SPI mode to 40MHz

Posted: Tue Oct 08, 2019 5:23 pm
by gunar.kroeger
Hi ESP_igrr,

We are using the correct pins so that we could use the SPI bus without the GPIO_MUX, so shouldn't we be able to get to 80MHz even in Full-duplex mode?

Code: Select all

//----------SPI
#define PIN_MISO_V4A 				GPIO_NUM_19
#define PIN_MOSI_V4A 				GPIO_NUM_23
#define PIN_CLK_V4A  				GPIO_NUM_18
#define PIN_CS_V4A   				GPIO_NUM_5

Re: Increase SD frequency clock with SPI mode to 40MHz

Posted: Tue Oct 08, 2019 5:28 pm
by gunar.kroeger
Ah, I think the issue is that we are using HSPI but the pins are connected to the VSPI

Re: Increase SD frequency clock with SPI mode to 40MHz

Posted: Mon Oct 14, 2019 8:56 pm
by gunar.kroeger
I have tried to change from HSPI to VSPI but I still can't enable 40MHz to the SD card. Maybe I'm missing some configuration step. Any hints?

Re: Increase SD frequency clock with SPI mode to 40MHz

Posted: Thu Nov 12, 2020 6:03 pm
by shirogeek
Did you solve your issue?
Sorry for digging this up a year after. But I have this exact same problem and funny enough with the exact timeline as yours. Changed hosts and still nothing only 20 MHz