SD-card interface and chip select location (IDF4.1, ESP32 WROVER)

commodore
Posts: 2
Joined: Sun Feb 02, 2020 11:39 am

SD-card interface and chip select location (IDF4.1, ESP32 WROVER)

Postby commodore » Thu Sep 14, 2023 10:17 am

Hello,

We are using ESP32 Wrover and IDF 4.1, and are out of IOs. There is an external IO-expander, but no more
ESP-pins which could be transferred behind it (ethernet is taking many IOs).

So one (maybe only) option would be to move sd-card CS signal, and basically just keep it enabled when SD card is used. Seems to work OK.

However IDF does not allow this, but a valid ESP-pin is required. Is there a proper way to get around this ?
Implementation is based on 1-line SD in sd_card_example_main.c

One hack tried is to use for example GPIO_20 and allow it's usage in gpio_config-function (gpio.c), and in GPIO_IS_VALID_GPIO macro (gpio_caps.h).
But is there a risk in this ? It is not routed outside, but I guess exist in the die ?

ESP_adokitkat
Posts: 50
Joined: Thu Jun 22, 2023 12:50 pm

Re: SD-card interface and chip select location (IDF4.1, ESP32 WROVER)

Postby ESP_adokitkat » Thu Oct 05, 2023 3:37 am

Hello.

Yes, CS line can be unused in newer version of ESP-IDF, starting from v5.0. If you cannot update your version, you can try to cherry-pick the commit in which the change was introduced or modify the code in this manner: https://github.com/espressif/esp-idf/co ... 27ed730d11

CS on the SD card has to be pulled down.

Who is online

Users browsing this forum: ESP_adokitkat, Google [Bot] and 129 guests