diff --git a/docs/source/Reference/GPIO.rst b/docs/source/Reference/GPIO.rst index 101d622646..fd2fd282f4 100644 --- a/docs/source/Reference/GPIO.rst +++ b/docs/source/Reference/GPIO.rst @@ -366,9 +366,14 @@ ESP32-C3 SPI flash pins Pins connected to flash or PSRAM should not be used for anything else. +On boards with embedded flash, these pins cannot be used: + * GPIO-11: Flash voltage selector * GPIO-12 ... -17: Connected to flash +On boards with external flash, GPIO-11, GPIO-12 and GPIO-13 can be selected. +However special care should be taken as some boards can still have these pins wired to the flash chip. + .. note:: By default VDD_SPI is the power supply pin for embedded flash or external flash. It can only be used as GPIO-11 only when the chip is connected to an external flash, and this flash is powered by an external power supply. diff --git a/platformio_core_defs.ini b/platformio_core_defs.ini index 5f9865833b..52d1bd8ae3 100644 --- a/platformio_core_defs.ini +++ b/platformio_core_defs.ini @@ -167,7 +167,7 @@ extra_scripts = ${esp82xx_common.extra_scripts} ; IDF 4.4 = platform-espressif32 3.4.x = espressif/arduino-esp32 tag 2.0.4 ; Just for those who lost track of the extremely confusing numbering schema. ; For MUSTFIX_CLIENT_TIMEOUT_IN_SECONDS See: https://github.com/espressif/arduino-esp32/pull/6676 -[core_esp32_IDF5_1_4__3_0_5_SPIFFS] +[core_esp32_IDF5_1_4__3_1_0_SPIFFS] platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.09.10/platform-espressif32.zip platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3202/framework-arduinoespressif32-all-release_v5.1-41a885b.zip build_flags = -DESP32_STAGE @@ -196,9 +196,8 @@ lib_extra_dirs = ; ESP_IDF 5.3.1 -[core_esp32_IDF5_3_1__3_0_5_LittleFS] -platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53 -;platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.10.31/platform-espressif32.zip +[core_esp32_IDF5_3_2__3_1_0_LittleFS] +platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53 platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3203/framework-arduinoespressif32-all-release_v5.3-ddc10306.zip build_flags = -DESP32_STAGE -DESP_IDF_VERSION_MAJOR=5 @@ -219,7 +218,7 @@ build_flags = -DESP32_STAGE -include "ESPEasy_config.h" -include "esp32x_fixes.h" -Wnull-dereference -lib_ignore = +lib_ignore = lib_extra_dirs = lib/lib_ssl diff --git a/platformio_esp32_envs.ini b/platformio_esp32_envs.ini index 00f2ecd9cc..9c1cf76937 100644 --- a/platformio_esp32_envs.ini +++ b/platformio_esp32_envs.ini @@ -6,7 +6,7 @@ [esp32_base] -extends = common, core_esp32_IDF5_1_4__3_0_5_SPIFFS +extends = common, core_esp32_IDF5_1_4__3_1_0_SPIFFS upload_speed = 460800 upload_before_reset = default_reset upload_after_reset = hard_reset @@ -19,7 +19,7 @@ extra_scripts = post:tools/pio/post_esp32.py ; pre:tools/pio/apply_patches.py build_unflags = -Wall -fno-lto -build_flags = ${core_esp32_IDF5_1_4__3_0_5_SPIFFS.build_flags} +build_flags = ${core_esp32_IDF5_1_4__3_1_0_SPIFFS.build_flags} ; ${mqtt_flags.build_flags} -DMQTT_MAX_PACKET_SIZE=2048 -DCONFIG_FREERTOS_ASSERT_DISABLE @@ -30,11 +30,11 @@ build_flags = ${core_esp32_IDF5_1_4__3_0_5_SPIFFS.build_flags} -DCORE_DEBUG_LEVEL=ARDUHAL_LOG_LEVEL_NONE monitor_filters = esp32_exception_decoder lib_ignore = - ${core_esp32_IDF5_1_4__3_0_5_SPIFFS.lib_ignore} + ${core_esp32_IDF5_1_4__3_1_0_SPIFFS.lib_ignore} [esp32_base_idf5] -extends = common, core_esp32_IDF5_3_1__3_0_5_LittleFS +extends = common, core_esp32_IDF5_3_2__3_1_0_LittleFS upload_speed = 460800 upload_before_reset = default_reset upload_after_reset = hard_reset @@ -51,7 +51,7 @@ extra_scripts = post:tools/pio/post_esp32.py ; However LTO cannot optimize builds with text section literals and thus will result in quite a lot larger builds (80k - 140k larger) build_unflags = -Wall -fno-lto -build_flags = ${core_esp32_IDF5_3_1__3_0_5_LittleFS.build_flags} +build_flags = ${core_esp32_IDF5_3_2__3_1_0_LittleFS.build_flags} ; ${mqtt_flags.build_flags} -DMQTT_MAX_PACKET_SIZE=2048 -DCONFIG_FREERTOS_ASSERT_DISABLE @@ -65,7 +65,7 @@ build_flags = ${core_esp32_IDF5_3_1__3_0_5_LittleFS.build_flags} -DLWIP_IPV6=1 monitor_filters = esp32_exception_decoder lib_ignore = - ${core_esp32_IDF5_3_1__3_0_5_LittleFS.lib_ignore} + ${core_esp32_IDF5_3_2__3_1_0_LittleFS.lib_ignore} ; -flto cannot be used for ESP32 C3! @@ -116,7 +116,7 @@ board_build.filesystem = littlefs lib_ignore = ${esp32_always.lib_ignore} ESP32_ping ESP32 BLE Arduino - ${core_esp32_IDF5_3_1__3_0_5_LittleFS.lib_ignore} + ${core_esp32_IDF5_3_2__3_1_0_LittleFS.lib_ignore} [esp32_IRExt] diff --git a/platformio_esp32_solo1.ini b/platformio_esp32_solo1.ini index 1449f8bdd8..388bcb6eab 100644 --- a/platformio_esp32_solo1.ini +++ b/platformio_esp32_solo1.ini @@ -2,9 +2,8 @@ ; IDF 5.3.1 [esp32_solo1_common_LittleFS] extends = esp32_base_idf5 -platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53 -;platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.12.30/platform-espressif32.zip -platform_packages = framework-arduino-solo1 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3204/framework-arduinoespressif32-solo1-release_v5.3-ddc10306.zip +platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53 +platform_packages = framework-arduino-solo1 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3204/framework-arduinoespressif32-solo1-release_v5.3-ddc10306.zip build_flags = ${esp32_base_idf5.build_flags} -DFEATURE_ARDUINO_OTA=1 -DUSE_LITTLEFS diff --git a/src/src/Helpers/Hardware_GPIO.cpp b/src/src/Helpers/Hardware_GPIO.cpp index e170d212dc..e1a9412c72 100644 --- a/src/src/Helpers/Hardware_GPIO.cpp +++ b/src/src/Helpers/Hardware_GPIO.cpp @@ -168,17 +168,35 @@ bool getGpioInfo(int gpio, int& pinnr, bool& input, bool& output, bool& warning) } if (gpio == 11) { - // By default VDD_SPI is the power supply pin for embedded flash or external flash. It can only be used as GPIO11 - // only when the chip is connected to an external flash, and this flash is powered by an external power supply - input = false; - output = false; + if (getChipFeatures().embeddedFlash) { + // See: https://www.letscontrolit.com/forum/viewtopic.php?p=71880#p71874 + // + // By default VDD_SPI is the power supply pin for embedded flash or external flash. + // It can only be used as GPIO11 only when the chip is connected to an + // external flash, and this flash is powered by an external power supply + input = false; + output = false; + } warning = true; } if (isFlashInterfacePin_ESPEasy(gpio)) { - // Connected to the integrated SPI flash. - input = false; - output = false; + if (getChipFeatures().embeddedFlash) { + // Connected to the integrated SPI flash. + input = false; + output = false; + } else { + // See: https://www.letscontrolit.com/forum/viewtopic.php?p=71880#p71874 + if (gpio == 12 || gpio == 13) { + // SPIHD/GPIO12 + // SPIWP/GPIO13 + if (ESP.getFlashChipMode() != FM_DOUT && + ESP.getFlashChipMode() != FM_DIO) { + input = false; + output = false; + } + } + } warning = true; }