SDSPI does not recognize UHS-I SD card as high speed

signameyeotee
Posts: 1
Joined: Fri May 06, 2022 4:55 pm

SDSPI does not recognize UHS-I SD card as high speed

Postby signameyeotee » Fri May 06, 2022 7:09 pm

I am having trouble getting a ultra high speed (UHS-I) SD card, a Sandisk Extreme Pro, to operate at 40 MHz using the SDSPI interface. When initializing the SD card using sdspi and then printing the card speed, it is always set to 20 MHz even when I initialize it to 40 MHz. The card works fine at 20 MHz. I dug into the sdspi card initialization code and found that it is reading the CRD register from the SD card, and the card is reporting that it's max frequency is 25 MHz. I found an old forum post where ESP_igrr said he was going to order some SD cards to figure out why this is, but I haven't been able to find any followup from that: viewtopic.php?t=2055

Code: Select all

    sdmmc_card_t *card;
    sdmmc_host_t host = SDSPI_HOST_DEFAULT();
    
    esp_vfs_fat_sdmmc_mount_config_t mount_config = {
        .format_if_mount_failed = false,
        .max_files = 5,
        .allocation_unit_size = 16 * 1024
    };

    // This initializes the slot without card detect (CD) and write protect (WP) signals.
    sdspi_device_config_t slot_config = {
        .gpio_cs = PIN_NUM_CS,
        .gpio_cd = SDSPI_SLOT_NO_CD,
        .gpio_wp = SDSPI_SLOT_NO_WP,
        .gpio_int = GPIO_NUM_NC,
        .host_id = host.slot,
    };

    host.max_freq_khz = SDMMC_FREQ_HIGHSPEED;  // 40 MHz
    ret = esp_vfs_fat_sdspi_mount(mount_point, &host, &slot_config, &mount_config, &card);

Who is online

Users browsing this forum: Bing [Bot] and 53 guests