[esp32] Only warn about S3 PSRAM pins (GPIO33-37) in octal mode (#17222)

Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
This commit is contained in:
Franck Nijhof
2026-06-27 11:26:47 -04:00
committed by GitHub
co-authored by Jonathan Swoboda
parent 436938b931
commit 24ec65e68e
7 changed files with 129 additions and 8 deletions
@@ -0,0 +1,16 @@
esphome:
name: test
esp32:
variant: esp32s3
framework:
type: esp-idf
psram:
mode: octal
disabled: true
binary_sensor:
- platform: gpio
pin: GPIO34
name: test
@@ -0,0 +1,15 @@
esphome:
name: test
esp32:
variant: esp32s3
framework:
type: esp-idf
psram:
mode: octal
binary_sensor:
- platform: gpio
pin: GPIO34
name: test
@@ -0,0 +1,15 @@
esphome:
name: test
esp32:
variant: esp32s3
framework:
type: esp-idf
psram:
mode: quad
binary_sensor:
- platform: gpio
pin: GPIO34
name: test
+26
View File
@@ -213,6 +213,32 @@ def test_execute_from_psram_p4_sdkconfig(
assert "CONFIG_SPIRAM_RODATA" not in sdkconfig
@pytest.mark.parametrize(
("fixture", "expect_warning"),
[
("psram_quad_gpio34.yaml", False),
("psram_octal_gpio34.yaml", True),
("psram_octal_disabled_gpio34.yaml", False),
],
)
def test_s3_psram_pin_warning_only_for_octal(
generate_main: Callable[[str | Path], str],
component_config_path: Callable[[str], Path],
caplog: pytest.LogCaptureFixture,
fixture: str,
expect_warning: bool,
) -> None:
"""GPIO33-37 are only used by the PSRAM interface in octal mode.
Using such a pin must only warn when octal PSRAM is configured; on quad
PSRAM the pins are free and warning would be a false positive (#16857).
"""
with caplog.at_level("WARNING"):
generate_main(component_config_path(fixture))
warned = "GPIO34 is used by the PSRAM interface in octal mode" in caplog.text
assert warned == expect_warning
def test_ignore_pin_validation_error_on_clean_pin_warns(
set_core_config: SetCoreConfigCallable,
caplog: pytest.LogCaptureFixture,