diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 12d0f9fcd5..438225bdfa 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -296,11 +296,11 @@ ARDUINO_PLATFORM_VERSION = cv.Version(5, 4, 0) # The default/recommended esp-idf framework version # - https://github.com/espressif/esp-idf/releases # - https://api.registry.platformio.org/v3/packages/platformio/tool/framework-espidf -RECOMMENDED_ESP_IDF_FRAMEWORK_VERSION = cv.Version(5, 1, 6) +RECOMMENDED_ESP_IDF_FRAMEWORK_VERSION = cv.Version(5, 3, 2) # The platformio/espressif32 version to use for esp-idf frameworks # - https://github.com/platformio/platform-espressif32/releases # - https://api.registry.platformio.org/v3/packages/platformio/platform/espressif32 -ESP_IDF_PLATFORM_VERSION = cv.Version(51, 3, 7) +ESP_IDF_PLATFORM_VERSION = cv.Version(53, 3, 13) # List based on https://registry.platformio.org/tools/platformio/framework-espidf/versions SUPPORTED_PLATFORMIO_ESP_IDF_5X = [ @@ -369,8 +369,8 @@ def _arduino_check_versions(value): def _esp_idf_check_versions(value): value = value.copy() lookups = { - "dev": (cv.Version(5, 1, 6), "https://github.com/espressif/esp-idf.git"), - "latest": (cv.Version(5, 1, 6), None), + "dev": (cv.Version(5, 3, 2), "https://github.com/espressif/esp-idf.git"), + "latest": (cv.Version(5, 3, 2), None), "recommended": (RECOMMENDED_ESP_IDF_FRAMEWORK_VERSION, None), } diff --git a/esphome/components/psram/__init__.py b/esphome/components/psram/__init__.py index 53ba54dd28..c00cbb2ba2 100644 --- a/esphome/components/psram/__init__.py +++ b/esphome/components/psram/__init__.py @@ -2,6 +2,7 @@ import logging import esphome.codegen as cg from esphome.components.esp32 import ( + CONF_CPU_FREQUENCY, CONF_ENABLE_IDF_EXPERIMENTAL_FEATURES, VARIANT_ESP32, add_idf_sdkconfig_option, @@ -50,18 +51,23 @@ SPIRAM_SPEEDS = { def validate_psram_mode(config): - if config[CONF_MODE] == TYPE_OCTAL and config[CONF_SPEED] == 120e6: - esp32_config = fv.full_config.get()[PLATFORM_ESP32] - if ( - esp32_config[CONF_FRAMEWORK] - .get(CONF_ADVANCED, {}) - .get(CONF_ENABLE_IDF_EXPERIMENTAL_FEATURES) - ): - _LOGGER.warning( - "120MHz PSRAM in octal mode is an experimental feature - use at your own risk" + esp32_config = fv.full_config.get()[PLATFORM_ESP32] + if config[CONF_SPEED] == 120e6: + if esp32_config[CONF_CPU_FREQUENCY] != "240MHZ": + raise cv.Invalid( + "PSRAM 120MHz requires 240MHz CPU frequency (set in esp32 component)" ) - else: - raise cv.Invalid("PSRAM 120MHz is not supported in octal mode") + if config[CONF_MODE] == TYPE_OCTAL: + if ( + esp32_config[CONF_FRAMEWORK] + .get(CONF_ADVANCED, {}) + .get(CONF_ENABLE_IDF_EXPERIMENTAL_FEATURES) + ): + _LOGGER.warning( + "120MHz PSRAM in octal mode is an experimental feature - use at your own risk" + ) + else: + raise cv.Invalid("PSRAM 120MHz is not supported in octal mode") if config[CONF_MODE] != TYPE_OCTAL and config[CONF_ENABLE_ECC]: raise cv.Invalid("ECC is only available in octal mode.") if config[CONF_MODE] == TYPE_OCTAL: @@ -112,7 +118,7 @@ async def to_code(config): add_idf_sdkconfig_option(f"{SPIRAM_MODES[config[CONF_MODE]]}", True) add_idf_sdkconfig_option(f"{SPIRAM_SPEEDS[config[CONF_SPEED]]}", True) if config[CONF_MODE] == TYPE_OCTAL and config[CONF_SPEED] == 120e6: - add_idf_sdkconfig_option("CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ_240", True) + add_idf_sdkconfig_option("CONFIG_ESPTOOLPY_FLASHFREQ_120M", True) if CORE.data[KEY_CORE][KEY_FRAMEWORK_VERSION] >= cv.Version(5, 4, 0): add_idf_sdkconfig_option( "CONFIG_SPIRAM_TIMING_TUNING_POINT_VIA_TEMPERATURE_SENSOR", True diff --git a/platformio.ini b/platformio.ini index 292188c6fa..abea62a4ca 100644 --- a/platformio.ini +++ b/platformio.ini @@ -140,9 +140,9 @@ extra_scripts = post:esphome/components/esp32/post_build.py.script ; This are common settings for the ESP32 (all variants) using IDF. [common:esp32-idf] extends = common:idf -platform = https://github.com/pioarduino/platform-espressif32/releases/download/51.03.06/platform-espressif32.zip +platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.13/platform-espressif32.zip platform_packages = - pioarduino/framework-espidf@https://github.com/pioarduino/esp-idf/releases/download/v5.1.6/esp-idf-v5.1.6.zip + pioarduino/framework-espidf@https://github.com/pioarduino/esp-idf/releases/download/v5.3.2/esp-idf-v5.3.2.zip framework = espidf lib_deps = diff --git a/tests/components/psram/test.esp32-s3-idf.yaml b/tests/components/psram/test.esp32-s3-idf.yaml index e0e7fb52f6..75d4ee539c 100644 --- a/tests/components/psram/test.esp32-s3-idf.yaml +++ b/tests/components/psram/test.esp32-s3-idf.yaml @@ -1,4 +1,5 @@ esp32: + cpu_frequency: 240MHz framework: type: esp-idf advanced: