Skip to content

Commit

Permalink
Merge pull request #5161 from TD-er/bugfix/Allow_gpio_10_embedded_flash
Browse files Browse the repository at this point in the history
[GPIO] Allow to select GPIO-10 on ESP32-U4WDH
  • Loading branch information
TD-er authored Nov 13, 2024
2 parents b9ed7cd + 889aa83 commit ff73d51
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/src/Helpers/Hardware_GPIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ bool getGpioInfo(int gpio, int& pinnr, bool& input, bool& output, bool& warning)
output = false;
}

if ((gpio >= 6) && (gpio <= 11)) {
if (isFlashInterfacePin_ESPEasy(gpio)) {
// Connected to the integrated SPI flash.
input = false;
output = false;
Expand Down
37 changes: 37 additions & 0 deletions src/src/Helpers/Hardware_device_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,43 @@ int32_t getPartitionInfo(ESP8266_partition_type ptype, uint32_t& address, int32_
bool isFlashInterfacePin_ESPEasy(int gpio) {
#if CONFIG_IDF_TARGET_ESP32

if (getChipFeatures().embeddedFlash ||
getChipFeatures().embeddedPSRAM) {

// See page 20: https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf
if (getChipFeatures().embeddedFlash) {
// ESP32-U4WDH In-Package Flash (4 MB)
// SD_DATA_1 IO0/DI (GPIO-8)
// GPIO17 IO1/DO (GPIO-17)
// SD_DATA_0 IO2/WP# (GPIO-7)
// SD_CMD IO3/HOLD# (GPIO-11)
// SD_CLK CLK (GPIO-6)
// GPIO16 CS# (GPIO-16)
// GND VSS
// VDD_SDIO1 VDD

if (gpio >= 6 && gpio <= 8) return true;
if (gpio == 17 || gpio == 11 || gpio == 16) return true;
}

if (getChipFeatures().embeddedPSRAM) {
// ESP32-D0WDR2-V3 In-Package PSRAM (2 MB)
// SD_DATA_1 SIO0/SI (GPIO-8)
// SD_DATA_0 SIO1/SO (GPIO-7)
// SD_DATA_3 SIO2 (GPIO-10)
// SD_DATA_2 SIO3 (GPIO-9)
// SD_CLK SCLK (GPIO-6)
// GPIO16 CE# (GPIO-16)
// GND VSS
// VDD_SDIO1 VDD
if (gpio >= 6 && gpio <= 10) return true;
if (gpio == 16) return true;

}
return false;
}


// GPIO-6 ... 11: SPI flash and PSRAM
// GPIO-16 & 17: CS for PSRAM, thus only unuable when PSRAM is present
return (gpio) >= 6 && (gpio) <= 11;
Expand Down

0 comments on commit ff73d51

Please sign in to comment.