Skip to content
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

Add default 10MHz SD card frequency for SD SPI #6225

Closed
1 task done
grantwilk opened this issue Feb 3, 2022 · 5 comments
Closed
1 task done

Add default 10MHz SD card frequency for SD SPI #6225

grantwilk opened this issue Feb 3, 2022 · 5 comments
Assignees
Labels
Area: ESP-IDF related ESP-IDF related issues Type: Feature request Feature request for Arduino ESP32
Milestone

Comments

@grantwilk
Copy link

Related area

SD SPI

Hardware specification

ESP32

Is your feature request related to a problem?

By default, ESP-IDF does not provide a default 10MHz SDMMC speed, even though there is a note about it in sdmmc_common.c. This means that using SD SPI with SD cards that do not support the 20MHz default speed requires additional steps and code modification to initialize.

/* Find highest frequency in the following list,
     * which is below card->max_freq_khz.
     */
    const uint32_t freq_values[] = {
            SDMMC_FREQ_52M,
            SDMMC_FREQ_HIGHSPEED,
            SDMMC_FREQ_26M,
            SDMMC_FREQ_DEFAULT,
            //NOTE: in sdspi mode, 20MHz may not work. in that case, add 10MHz here.
    };

Describe the solution you'd like

Please add a default SDMMC_FREQ_10M definition to sdmmc_types.h and add it to freq_values in sdmmc_common.c.

Describe alternatives you've considered

No response

Additional context

No response

I have checked existing list of Feature requests and the Contribution Guide

  • I confirm I have checked existing list of Feature requests and Contribution Guide.
@grantwilk grantwilk added the Type: Feature request Feature request for Arduino ESP32 label Feb 3, 2022
@VojtechBartoska
Copy link
Collaborator

Thanks for contributing @grantwilk. Can you please help with triage, @P-R-O-C-H-Y ?

@P-R-O-C-H-Y
Copy link
Member

Hi @grantwilk,
This change needs to be made in ESP-IDF. I am in touch with them so once its available, I will let you know :)

@P-R-O-C-H-Y P-R-O-C-H-Y self-assigned this Mar 23, 2022
@VojtechBartoska
Copy link
Collaborator

status update: This feature is now in Review in ESP-IDF.

espressif-bot pushed a commit to espressif/esp-idf that referenced this issue Sep 23, 2022
In order to allow flexible setup of SD card frequency, sdmmc_host_t.max_freq_khz is used as a limit

Closes espressif/arduino-esp32#6225
@igrr
Copy link
Member

igrr commented Oct 1, 2022

The feature has been merged and is available on IDF master branch. Note that we don't plan to backport it to release/v4.4, so Arduino project can use it after upgrading to IDF v5.1 in the future.

@P-R-O-C-H-Y
Copy link
Member

@grantwilk I have tested 10 Mhz SDMMC on esp-idf-v5.1-libs branch which uses IDF 5.1 and everything works :)
So I am closing this as it's already part of the esp-idf-v5.1-libs branch and will be in 3.0 version of Arduino-esp32.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: ESP-IDF related ESP-IDF related issues Type: Feature request Feature request for Arduino ESP32
Projects
Development

No branches or pull requests

4 participants