diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index 2f68715151..6a693eff89 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -938,10 +938,6 @@ def _format_framework_pio_espidf_version( ) -> str: # format the given espidf (https://github.com/pioarduino/esp-idf/releases) version to # a PIO platformio/framework-espidf value - # TEMP: pioarduino has no 6.1 package yet; pioarduino-style repack of - # espressif v6.1. Remove before merge. - if ver == cv.Version(6, 1, 0): - return "pioarduino/framework-espidf@https://github.com/bdraco/esp-idf/releases/download/v6.1.0/esp-idf-v6.1.0.tar.xz" if ver == cv.Version(5, 4, 3) or ver >= cv.Version(5, 5, 1): ext = "tar.xz" else: @@ -1034,19 +1030,12 @@ ARDUINO_IDF_VERSION_LOOKUP = { # The default/recommended esp-idf framework version # - https://github.com/espressif/esp-idf/releases ESP_IDF_FRAMEWORK_VERSION_LOOKUP = { - # TEMP: default to 6.1.0 for CI testing of Log V2; revert to 5.5.5 before merge - "recommended": cv.Version(6, 1, 0), - "latest": cv.Version(6, 1, 0), - "dev": cv.Version(6, 1, 0), + "recommended": cv.Version(5, 5, 5), + "latest": cv.Version(5, 5, 5), + "dev": cv.Version(5, 5, 5), } ESP_IDF_PLATFORM_VERSION_LOOKUP = { - # TEMP: prep_IDF6 plus the IDF 6.1 fixes (deps, bootloader ld, --wrap, - # tf-psa sublibs); only 6.1 has the Log V2 defines. Remove with the 6.1 - # default once pioarduino publishes 6.1 support. - cv.Version( - 6, 1, 0 - ): "https://github.com/bdraco/platform-espressif32.git#idf61-test", cv.Version( 6, 0, 1 ): "https://github.com/pioarduino/platform-espressif32.git#prep_IDF6", @@ -1142,14 +1131,6 @@ def _check_pio_versions(config: ConfigType) -> ConfigType: version = _resolve_framework_version(value) - # TEMP: named versions take the platform from PLATFORM_VERSION_LOOKUP - # above, bypassing the per-IDF-version lookup; force the IDF 6 platform - # without disturbing Arduino (still on 5.5.5). Remove with the 6.1 default. - if value[CONF_TYPE] != FRAMEWORK_ARDUINO and version == cv.Version(6, 1, 0): - value[CONF_PLATFORM_VERSION] = _parse_pio_platform_version( - ESP_IDF_PLATFORM_VERSION_LOOKUP[version] - ) - if value[CONF_TYPE] == FRAMEWORK_ARDUINO: platform_lookup = ARDUINO_PLATFORM_VERSION_LOOKUP.get(version) value[CONF_SOURCE] = value.get( diff --git a/esphome/components/logger/logger_esp32.cpp b/esphome/components/logger/logger_esp32.cpp index dc14fb503c..11c6f33bab 100644 --- a/esphome/components/logger/logger_esp32.cpp +++ b/esphome/components/logger/logger_esp32.cpp @@ -164,7 +164,9 @@ const LogString *Logger::get_uart_selection_() { } // namespace esphome::logger -#ifdef USE_ESP32_LOG_V2 +// The version guard keeps builds that define USE_ESP32_LOG_V2 unconditionally (static analysis) off +// IDF private headers that only 6.1 has +#if defined(USE_ESP32_LOG_V2) && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(6, 1, 0) #include #include #include @@ -222,5 +224,5 @@ void __wrap_esp_log_format(esp_log_msg_t *message) { // NOLINT esp_log_vprint_func(message->format, message->args); } } // extern "C" -#endif // USE_ESP32_LOG_V2 +#endif // USE_ESP32_LOG_V2 && IDF >= 6.1 #endif diff --git a/platformio.ini b/platformio.ini index d3c1b42f43..00fad1ff66 100644 --- a/platformio.ini +++ b/platformio.ini @@ -181,10 +181,9 @@ extra_scripts = ; This are common settings for the ESP32 (all variants) using IDF. [common:esp32-idf] extends = common:idf -; TEMP: IDF 6.1 for Log V2 CI testing; revert to 55.03.311 / v5.5.5 before merge -platform = https://github.com/bdraco/platform-espressif32.git#idf61-test +platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.312/platform-espressif32.zip platform_packages = - pioarduino/framework-espidf@https://github.com/bdraco/esp-idf/releases/download/v6.1.0/esp-idf-v6.1.0.tar.xz + pioarduino/framework-espidf@https://github.com/pioarduino/esp-idf/releases/download/v5.5.5/esp-idf-v5.5.5.tar.xz framework = espidf lib_deps = diff --git a/tests/components/logger/test-log_v2.esp32-idf.yaml b/tests/components/logger/test-log_v2.esp32-idf.yaml new file mode 100644 index 0000000000..19d35dfb15 --- /dev/null +++ b/tests/components/logger/test-log_v2.esp32-idf.yaml @@ -0,0 +1,8 @@ +packages: + logger: !include common-default_uart.yaml + +# IDF 6.1 is where Log V2 and the esp_log_format wrap are enabled; the default IDF has no V2 +esp32: + framework: + type: esp-idf + version: 6.1.0