From 174386f13378b2a6ae6e349ce282b5ab97f95544 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Mon, 26 Feb 2024 19:46:17 +0800 Subject: [PATCH] ci: enable lightsleep related tests --- components/esp_driver_gpio/test_apps/gpio/main/test_gpio.c | 5 ++--- components/esp_driver_ledc/src/ledc.c | 2 -- components/esp_hw_support/CMakeLists.txt | 1 - components/esp_hw_support/port/esp32p4/rtc_clk.c | 2 +- components/esp_hw_support/sleep_modes.c | 2 +- components/soc/esp32p4/include/soc/soc_caps.h | 2 +- examples/system/esp_timer/README.md | 4 ++-- examples/system/esp_timer/pytest_esp_timer.py | 1 - examples/system/light_sleep/pytest_light_sleep.py | 4 +--- 9 files changed, 8 insertions(+), 15 deletions(-) diff --git a/components/esp_driver_gpio/test_apps/gpio/main/test_gpio.c b/components/esp_driver_gpio/test_apps/gpio/main/test_gpio.c index d59b0e51ff..a4f693752b 100644 --- a/components/esp_driver_gpio/test_apps/gpio/main/test_gpio.c +++ b/components/esp_driver_gpio/test_apps/gpio/main/test_gpio.c @@ -860,8 +860,7 @@ TEST_CASE("GPIO_USB_DP_pin_pullup_disable_test", "[gpio]") } #endif //SOC_USB_SERIAL_JTAG_SUPPORTED -#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32P4, ESP32C5) -// TODO: IDF-7528 Remove when light sleep is supported on ESP32P4 +#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32C5) // TODO: IDF-8638 Remove when light sleep is supported on ESP32C5 // Ignored in CI because it needs manually connect TEST_GPIO_INPUT_LEVEL_LOW_PIN to 3.3v to wake up from light sleep TEST_CASE("GPIO_light_sleep_wake_up_test", "[gpio][ignore]") @@ -879,4 +878,4 @@ TEST_CASE("GPIO_light_sleep_wake_up_test", "[gpio][ignore]") printf("Waked up from light sleep\n"); TEST_ASSERT(esp_sleep_get_wakeup_cause() == ESP_SLEEP_WAKEUP_GPIO); } -#endif //!TEMPORARY_DISABLED_FOR_TARGETS(...) +#endif diff --git a/components/esp_driver_ledc/src/ledc.c b/components/esp_driver_ledc/src/ledc.c index 1c58eecb48..0ed8788625 100644 --- a/components/esp_driver_ledc/src/ledc.c +++ b/components/esp_driver_ledc/src/ledc.c @@ -570,11 +570,9 @@ static esp_err_t ledc_set_timer_div(ledc_mode_t speed_mode, ledc_timer_t timer_n ESP_LOGD(LEDC_TAG, "In slow speed mode, global clk set: %d", glb_clk); -#if !CONFIG_IDF_TARGET_ESP32P4 //depend on sleep support IDF-7528 /* keep ESP_PD_DOMAIN_RC_FAST on during light sleep */ extern void esp_sleep_periph_use_8m(bool use_or_not); esp_sleep_periph_use_8m(glb_clk == LEDC_SLOW_CLK_RC_FAST); -#endif } /* The divisor is correct, we can write in the hardware. */ diff --git a/components/esp_hw_support/CMakeLists.txt b/components/esp_hw_support/CMakeLists.txt index d4dd3332c7..ec264011fe 100644 --- a/components/esp_hw_support/CMakeLists.txt +++ b/components/esp_hw_support/CMakeLists.txt @@ -166,7 +166,6 @@ if(NOT BOOTLOADER_BUILD) list(REMOVE_ITEM srcs "sleep_cpu.c" # TODO: IDF-7528, IDF-7529 "sleep_wake_stub.c" # TODO: IDF-7529 - "sleep_gpio.c" # TODO: IDF-7528, IDF-7529 ) endif() if(CONFIG_IDF_TARGET_ESP32C5) diff --git a/components/esp_hw_support/port/esp32p4/rtc_clk.c b/components/esp_hw_support/port/esp32p4/rtc_clk.c index a65bbd5c14..24cf03972b 100644 --- a/components/esp_hw_support/port/esp32p4/rtc_clk.c +++ b/components/esp_hw_support/port/esp32p4/rtc_clk.c @@ -19,7 +19,7 @@ #include "hal/regi2c_ctrl_ll.h" #include "hal/gpio_ll.h" #include "soc/io_mux_reg.h" -#include "esp_private/sleep_event.h" // TODO: IDF-7528 +#include "esp_private/sleep_event.h" static const char *TAG = "rtc_clk"; diff --git a/components/esp_hw_support/sleep_modes.c b/components/esp_hw_support/sleep_modes.c index 3bed79b431..8be410d2f3 100644 --- a/components/esp_hw_support/sleep_modes.c +++ b/components/esp_hw_support/sleep_modes.c @@ -142,7 +142,7 @@ #define DEFAULT_SLEEP_OUT_OVERHEAD_US (118) #define DEFAULT_HARDWARE_OUT_OVERHEAD_US (9) #elif CONFIG_IDF_TARGET_ESP32P4 -#define DEFAULT_SLEEP_OUT_OVERHEAD_US (324)// TODO: IDF-7528 +#define DEFAULT_SLEEP_OUT_OVERHEAD_US (324) #define DEFAULT_HARDWARE_OUT_OVERHEAD_US (240) #define LDO_POWER_TAKEOVER_PREPARATION_TIME_US (185) #endif diff --git a/components/soc/esp32p4/include/soc/soc_caps.h b/components/soc/esp32p4/include/soc/soc_caps.h index 42e368f8fd..2adb7e1c05 100644 --- a/components/soc/esp32p4/include/soc/soc_caps.h +++ b/components/soc/esp32p4/include/soc/soc_caps.h @@ -87,7 +87,7 @@ // #define SOC_RNG_SUPPORTED 1 //TODO: IDF-6522 #define SOC_MULTI_USAGE_LDO_SUPPORTED 1 // #define SOC_PPA_SUPPORTED 1 //TODO: IDF-6878 -// #define SOC_LIGHT_SLEEP_SUPPORTED 1 //TODO: IDF-7528 +#define SOC_LIGHT_SLEEP_SUPPORTED 1 // #define SOC_DEEP_SLEEP_SUPPORTED 1 //TODO: IDF-7529 /*-------------------------- XTAL CAPS ---------------------------------------*/ diff --git a/examples/system/esp_timer/README.md b/examples/system/esp_timer/README.md index 129dea703f..ecca681f9b 100644 --- a/examples/system/esp_timer/README.md +++ b/examples/system/esp_timer/README.md @@ -1,5 +1,5 @@ -| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-S2 | ESP32-S3 | -| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | +| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-S2 | ESP32-S3 | +| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | # ESP Timer Example (High Resolution Timer) diff --git a/examples/system/esp_timer/pytest_esp_timer.py b/examples/system/esp_timer/pytest_esp_timer.py index 4a06e346cd..929df5ccf1 100644 --- a/examples/system/esp_timer/pytest_esp_timer.py +++ b/examples/system/esp_timer/pytest_esp_timer.py @@ -28,7 +28,6 @@ ONE_SHOT_TIMER_PERIOD = 5000000 @pytest.mark.supported_targets -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='Light Sleep support TBD') # TODO: IDF-7528 @pytest.mark.generic @pytest.mark.parametrize( 'config', diff --git a/examples/system/light_sleep/pytest_light_sleep.py b/examples/system/light_sleep/pytest_light_sleep.py index 5fa4b4514f..7cbdac69d5 100644 --- a/examples/system/light_sleep/pytest_light_sleep.py +++ b/examples/system/light_sleep/pytest_light_sleep.py @@ -1,6 +1,5 @@ # SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD # SPDX-License-Identifier: CC0-1.0 - import logging import time @@ -8,7 +7,6 @@ import pytest from pytest_embedded import Dut -@pytest.mark.temp_skip_ci(targets=['esp32p4'], reason='esp32p4 support TBD') @pytest.mark.supported_targets @pytest.mark.generic def test_light_sleep(dut: Dut) -> None: @@ -17,7 +15,7 @@ def test_light_sleep(dut: Dut) -> None: EXIT_SLEEP_REGEX = r'Returned from light sleep, reason: (\w+), t=(\d+) ms, slept for (\d+) ms' EXIT_SLEEP_PIN_REGEX = r'Returned from light sleep, reason: (pin), t=(\d+) ms, slept for (\d+) ms' EXIT_SLEEP_UART_REGEX = r'Returned from light sleep, reason: (uart), t=(\d+) ms, slept for (\d+) ms' - WAITING_FOR_GPIO_STR = r'Waiting for GPIO\d to go high...' + WAITING_FOR_GPIO_STR = r'Waiting for GPIO\d+ to go high...' WAKEUP_INTERVAL_MS = 2000