mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[esp32] Use IDF 5.3.2 as default for IDF builds (#8464)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com> Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
This commit is contained in:
		| @@ -296,11 +296,11 @@ ARDUINO_PLATFORM_VERSION = cv.Version(5, 4, 0) | |||||||
| # The default/recommended esp-idf framework version | # The default/recommended esp-idf framework version | ||||||
| #  - https://github.com/espressif/esp-idf/releases | #  - https://github.com/espressif/esp-idf/releases | ||||||
| #  - https://api.registry.platformio.org/v3/packages/platformio/tool/framework-espidf | #  - 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 | # The platformio/espressif32 version to use for esp-idf frameworks | ||||||
| #  - https://github.com/platformio/platform-espressif32/releases | #  - https://github.com/platformio/platform-espressif32/releases | ||||||
| #  - https://api.registry.platformio.org/v3/packages/platformio/platform/espressif32 | #  - 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 | # List based on https://registry.platformio.org/tools/platformio/framework-espidf/versions | ||||||
| SUPPORTED_PLATFORMIO_ESP_IDF_5X = [ | SUPPORTED_PLATFORMIO_ESP_IDF_5X = [ | ||||||
| @@ -369,8 +369,8 @@ def _arduino_check_versions(value): | |||||||
| def _esp_idf_check_versions(value): | def _esp_idf_check_versions(value): | ||||||
|     value = value.copy() |     value = value.copy() | ||||||
|     lookups = { |     lookups = { | ||||||
|         "dev": (cv.Version(5, 1, 6), "https://github.com/espressif/esp-idf.git"), |         "dev": (cv.Version(5, 3, 2), "https://github.com/espressif/esp-idf.git"), | ||||||
|         "latest": (cv.Version(5, 1, 6), None), |         "latest": (cv.Version(5, 3, 2), None), | ||||||
|         "recommended": (RECOMMENDED_ESP_IDF_FRAMEWORK_VERSION, None), |         "recommended": (RECOMMENDED_ESP_IDF_FRAMEWORK_VERSION, None), | ||||||
|     } |     } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -2,6 +2,7 @@ import logging | |||||||
|  |  | ||||||
| import esphome.codegen as cg | import esphome.codegen as cg | ||||||
| from esphome.components.esp32 import ( | from esphome.components.esp32 import ( | ||||||
|  |     CONF_CPU_FREQUENCY, | ||||||
|     CONF_ENABLE_IDF_EXPERIMENTAL_FEATURES, |     CONF_ENABLE_IDF_EXPERIMENTAL_FEATURES, | ||||||
|     VARIANT_ESP32, |     VARIANT_ESP32, | ||||||
|     add_idf_sdkconfig_option, |     add_idf_sdkconfig_option, | ||||||
| @@ -50,18 +51,23 @@ SPIRAM_SPEEDS = { | |||||||
|  |  | ||||||
|  |  | ||||||
| def validate_psram_mode(config): | def validate_psram_mode(config): | ||||||
|     if config[CONF_MODE] == TYPE_OCTAL and config[CONF_SPEED] == 120e6: |     esp32_config = fv.full_config.get()[PLATFORM_ESP32] | ||||||
|         esp32_config = fv.full_config.get()[PLATFORM_ESP32] |     if config[CONF_SPEED] == 120e6: | ||||||
|         if ( |         if esp32_config[CONF_CPU_FREQUENCY] != "240MHZ": | ||||||
|             esp32_config[CONF_FRAMEWORK] |             raise cv.Invalid( | ||||||
|             .get(CONF_ADVANCED, {}) |                 "PSRAM 120MHz requires 240MHz CPU frequency (set in esp32 component)" | ||||||
|             .get(CONF_ENABLE_IDF_EXPERIMENTAL_FEATURES) |  | ||||||
|         ): |  | ||||||
|             _LOGGER.warning( |  | ||||||
|                 "120MHz PSRAM in octal mode is an experimental feature - use at your own risk" |  | ||||||
|             ) |             ) | ||||||
|         else: |         if config[CONF_MODE] == TYPE_OCTAL: | ||||||
|             raise cv.Invalid("PSRAM 120MHz is not supported in octal mode") |             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]: |     if config[CONF_MODE] != TYPE_OCTAL and config[CONF_ENABLE_ECC]: | ||||||
|         raise cv.Invalid("ECC is only available in octal mode.") |         raise cv.Invalid("ECC is only available in octal mode.") | ||||||
|     if config[CONF_MODE] == TYPE_OCTAL: |     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_MODES[config[CONF_MODE]]}", True) | ||||||
|         add_idf_sdkconfig_option(f"{SPIRAM_SPEEDS[config[CONF_SPEED]]}", True) |         add_idf_sdkconfig_option(f"{SPIRAM_SPEEDS[config[CONF_SPEED]]}", True) | ||||||
|         if config[CONF_MODE] == TYPE_OCTAL and config[CONF_SPEED] == 120e6: |         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): |             if CORE.data[KEY_CORE][KEY_FRAMEWORK_VERSION] >= cv.Version(5, 4, 0): | ||||||
|                 add_idf_sdkconfig_option( |                 add_idf_sdkconfig_option( | ||||||
|                     "CONFIG_SPIRAM_TIMING_TUNING_POINT_VIA_TEMPERATURE_SENSOR", True |                     "CONFIG_SPIRAM_TIMING_TUNING_POINT_VIA_TEMPERATURE_SENSOR", True | ||||||
|   | |||||||
| @@ -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. | ; This are common settings for the ESP32 (all variants) using IDF. | ||||||
| [common:esp32-idf] | [common:esp32-idf] | ||||||
| extends = common: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 = | 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 | framework = espidf | ||||||
| lib_deps = | lib_deps = | ||||||
|   | |||||||
| @@ -1,4 +1,5 @@ | |||||||
| esp32: | esp32: | ||||||
|  |   cpu_frequency: 240MHz | ||||||
|   framework: |   framework: | ||||||
|     type: esp-idf |     type: esp-idf | ||||||
|     advanced: |     advanced: | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user