diff --git a/components/esp_driver_gpio/test_apps/gpio/main/test_rtcio.c b/components/esp_driver_gpio/test_apps/gpio/main/test_rtcio.c index 4abca5361d7..3d39f2dfbe9 100644 --- a/components/esp_driver_gpio/test_apps/gpio/main/test_rtcio.c +++ b/components/esp_driver_gpio/test_apps/gpio/main/test_rtcio.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -247,7 +247,7 @@ TEST_CASE("RTCIO_interrupt_test", "[rtcio]") TEST_ESP_OK(rtc_gpio_init(test_io)); TEST_ESP_OK(rtc_gpio_set_direction(test_io, RTC_GPIO_MODE_INPUT_OUTPUT)); TEST_ESP_OK(rtc_gpio_set_level(test_io, 0)); - rtcio_ll_intr_enable(test_io, GPIO_INTR_HIGH_LEVEL); + rtcio_ll_intr_enable(rtc_io_idx, GPIO_INTR_HIGH_LEVEL); int cnt = 0; while (cnt < TEST_COUNT) { @@ -260,7 +260,7 @@ TEST_CASE("RTCIO_interrupt_test", "[rtcio]") } TEST_ESP_OK(rtc_gpio_set_level(test_io, 0)); - rtcio_ll_intr_enable(test_io, GPIO_INTR_POSEDGE); + rtcio_ll_intr_enable(rtc_io_idx, GPIO_INTR_POSEDGE); cnt = 0; while (cnt < TEST_COUNT) { TEST_ESP_OK(rtc_gpio_set_level(test_io, 1)); @@ -272,7 +272,7 @@ TEST_CASE("RTCIO_interrupt_test", "[rtcio]") vTaskDelay(100 / portTICK_PERIOD_MS); } - rtcio_ll_intr_enable(test_io, GPIO_INTR_DISABLE); + rtcio_ll_intr_enable(rtc_io_idx, GPIO_INTR_DISABLE); TEST_ESP_OK(rtc_gpio_deinit(test_io)); } #endif //SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP && (SOC_RTCIO_PIN_COUNT > 0) diff --git a/components/esp_driver_gpio/test_apps/gpio/main/test_rtcio.h b/components/esp_driver_gpio/test_apps/gpio/main/test_rtcio.h index 5b07231356a..90bdc06b8e4 100644 --- a/components/esp_driver_gpio/test_apps/gpio/main/test_rtcio.h +++ b/components/esp_driver_gpio/test_apps/gpio/main/test_rtcio.h @@ -37,6 +37,7 @@ const int s_test_map[TEST_GPIO_PIN_COUNT] = { GPIO_NUM_38, //GPIO38 GPIO_NUM_39, //GPIO39 }; +#define TEST_RTCIO_INTR_PIN_INDEX 5 // IO25 #define TEST_RTCIO_DEEP_SLEEP_PIN_INDEX 5 // IO25 #elif defined CONFIG_IDF_TARGET_ESP32S2 // Has no input-only rtcio pins, all pins support pull-up/down @@ -66,6 +67,7 @@ const int s_test_map[TEST_GPIO_PIN_COUNT] = { GPIO_NUM_20, //GPIO20 GPIO_NUM_21, //GPIO21 }; +#define TEST_RTCIO_INTR_PIN_INDEX 5 // IO6 #define TEST_RTCIO_DEEP_SLEEP_PIN_INDEX 5 // IO6 #elif defined CONFIG_IDF_TARGET_ESP32S3 // Has no input-only rtcio pins, all pins support pull-up/down @@ -95,6 +97,7 @@ const int s_test_map[TEST_GPIO_PIN_COUNT] = { GPIO_NUM_20, //GPIO20 GPIO_NUM_21, //GPIO21 }; +#define TEST_RTCIO_INTR_PIN_INDEX 5 // IO6 #define TEST_RTCIO_DEEP_SLEEP_PIN_INDEX 5 // IO6 #elif CONFIG_IDF_TARGET_ESP32C6 // Has no input-only rtcio pins, all pins support pull-up/down diff --git a/components/esp_hw_support/test_apps/.build-test-rules.yml b/components/esp_hw_support/test_apps/.build-test-rules.yml index eacac23ec64..07c2caf2a34 100644 --- a/components/esp_hw_support/test_apps/.build-test-rules.yml +++ b/components/esp_hw_support/test_apps/.build-test-rules.yml @@ -55,6 +55,6 @@ components/esp_hw_support/test_apps/wakeup_tests: enable: - if: SOC_DEEP_SLEEP_SUPPORTED == 1 and SOC_LIGHT_SLEEP_SUPPORTED == 1 disable_test: - - if: IDF_TARGET in ["esp32c61", "esp32h21", "esp32h4"] + - if: IDF_TARGET in ["esp32h21", "esp32h4"] temporary: true reason: lack of runners diff --git a/components/esp_hw_support/test_apps/wakeup_tests/pytest_wakeup_tests.py b/components/esp_hw_support/test_apps/wakeup_tests/pytest_wakeup_tests.py index c7469393f1c..c0898b3e61b 100644 --- a/components/esp_hw_support/test_apps/wakeup_tests/pytest_wakeup_tests.py +++ b/components/esp_hw_support/test_apps/wakeup_tests/pytest_wakeup_tests.py @@ -1,10 +1,11 @@ -# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD +# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 from time import sleep import pytest from pytest_embedded_idf.dut import IdfDut from pytest_embedded_idf.utils import idf_parametrize +from pytest_embedded_idf.utils import soc_filtered_targets TEST_CONFIGS = [ pytest.param('default'), @@ -26,7 +27,7 @@ available_gpio_nums = { } available_rtcio_nums = { - 'esp32': [36, 37, 38, 39, 34, 35, 4, 0, 2, 15, 13, 12, 14, 27], + 'esp32': [36, 37, 38, 39, 34, 35, 25, 26, 33, 32, 4, 0, 2, 15, 13, 12, 14, 27], 'esp32s2': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21], 'esp32s3': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21], 'esp32c2': [0, 1, 2, 3, 4, 5], @@ -42,11 +43,7 @@ available_rtcio_nums = { @pytest.mark.generic_multi_device @pytest.mark.parametrize('count', [2], indirect=True) @pytest.mark.parametrize('config', TEST_CONFIGS, indirect=True) -@idf_parametrize( - 'target', - ['esp32', 'esp32s2', 'esp32s3', 'esp32c6', 'esp32h2', 'esp32p4', 'esp32c5'], - indirect=['target'], -) +@idf_parametrize('target', soc_filtered_targets('SOC_PM_SUPPORT_EXT1_WAKEUP == 1'), indirect=['target']) def test_ext1_deepsleep(dut: tuple[IdfDut, IdfDut]) -> None: wakee = dut[0] waker = dut[1] @@ -97,7 +94,7 @@ def test_ext1_deepsleep(dut: tuple[IdfDut, IdfDut]) -> None: @pytest.mark.generic_multi_device @pytest.mark.parametrize('count', [2], indirect=True) @pytest.mark.parametrize('config', TEST_CONFIGS, indirect=True) -@idf_parametrize('target', ['esp32c2', 'esp32c3', 'esp32c6', 'esp32p4', 'esp32c5'], indirect=['target']) +@idf_parametrize('target', soc_filtered_targets('SOC_GPIO_SUPPORT_HP_PERIPH_PD_SLEEP_WAKEUP == 1'), indirect=['target']) def test_rtcio_deepsleep(dut: tuple[IdfDut, IdfDut]) -> None: wakee = dut[0] waker = dut[1] @@ -143,7 +140,6 @@ def test_rtcio_deepsleep(dut: tuple[IdfDut, IdfDut]) -> None: @pytest.mark.parametrize('count', [2], indirect=True) @pytest.mark.parametrize('config', TEST_CONFIGS, indirect=True) @idf_parametrize('target', ['supported_targets'], indirect=['target']) -@pytest.mark.temp_skip_ci(targets=['esp32c61'], reason='p4 rev3 migration') def test_gpio_wakeup_enable_lightsleep(dut: tuple[IdfDut, IdfDut]) -> None: wakee = dut[0] waker = dut[1] diff --git a/examples/system/deep_sleep/main/Kconfig.projbuild b/examples/system/deep_sleep/main/Kconfig.projbuild index d58be0fd327..0fd23a8a7e8 100644 --- a/examples/system/deep_sleep/main/Kconfig.projbuild +++ b/examples/system/deep_sleep/main/Kconfig.projbuild @@ -261,11 +261,18 @@ menu "Example Configuration" config EXAMPLE_GPIO_WAKEUP_PIN int "Enable wakeup from GPIO" + default 2 if IDF_TARGET_ESP32 || IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 default 0 + range 0 39 if IDF_TARGET_ESP32 + range 0 21 if IDF_TARGET_ESP32S2 || IDF_TARGET_ESP32S3 range 0 7 if IDF_TARGET_ESP32C6 range 0 6 if IDF_TARGET_ESP32C61 || IDF_TARGET_ESP32C5 range 0 15 if IDF_TARGET_ESP32P4 range 0 5 + help + Only GPIOs which have RTC functionality (pads that powered by VDD3P3_RTC) can be used, + You need to ensure that the set IO can be configured as a GPIO wake-up source, + refer SOC_GPIO_HP_PERIPH_PD_SLEEP_WAKEABLE_MASK in soc_caps.h. config EXAMPLE_GPIO_WAKEUP_HIGH_LEVEL bool "Enable GPIO high-level wakeup" diff --git a/examples/system/deep_sleep/main/gpio_wakeup.c b/examples/system/deep_sleep/main/gpio_wakeup.c index 5b0b4c5bba4..31ddeead431 100644 --- a/examples/system/deep_sleep/main/gpio_wakeup.c +++ b/examples/system/deep_sleep/main/gpio_wakeup.c @@ -22,6 +22,8 @@ void example_deep_sleep_register_gpio_wakeup(void) const gpio_config_t config = { .pin_bit_mask = BIT64(DEFAULT_WAKEUP_PIN), .mode = GPIO_MODE_INPUT, + .pull_up_en = !DEFAULT_WAKEUP_LEVEL, + .pull_down_en = DEFAULT_WAKEUP_LEVEL }; ESP_ERROR_CHECK(gpio_config(&config));