Increase SD frequency clock with SPI mode to 40MHz

User avatar
gunar.kroeger
Posts: 127
Joined: Fri Jul 27, 2018 6:48 pm

Increase SD frequency clock with SPI mode to 40MHz

Postby gunar.kroeger » Tue Oct 08, 2019 3:33 pm

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!
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

ESP_igrr
Posts: 1600
Joined: Tue Dec 01, 2015 8:37 am

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

Postby ESP_igrr » Tue Oct 08, 2019 5:02 pm

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.

User avatar
gunar.kroeger
Posts: 127
Joined: Fri Jul 27, 2018 6:48 pm

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

Postby gunar.kroeger » Tue Oct 08, 2019 5:23 pm

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
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

User avatar
gunar.kroeger
Posts: 127
Joined: Fri Jul 27, 2018 6:48 pm

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

Postby gunar.kroeger » Tue Oct 08, 2019 5:28 pm

Ah, I think the issue is that we are using HSPI but the pins are connected to the VSPI
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

User avatar
gunar.kroeger
Posts: 127
Joined: Fri Jul 27, 2018 6:48 pm

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

Postby gunar.kroeger » Mon Oct 14, 2019 8:56 pm

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?
"Running was invented in 1612 by Thomas Running when he tried to walk twice at the same time."

Who is online

Users browsing this forum: Google [Bot] and 51 guests