From f33f49331f5468886f84803e00edcf3a4d864a45 Mon Sep 17 00:00:00 2001 From: Renz Bagaporo Date: Wed, 22 Jul 2020 15:23:39 +0800 Subject: [PATCH] ci: update configs to include/exclude esp_pm in unit test --- components/esp32/Kconfig | 2 ++ components/esp32s2/Kconfig | 2 ++ components/esp32s3/Kconfig | 2 ++ components/esp_pm/Kconfig | 5 ++--- components/esp_pm/test/test_pm.c | 5 +++-- components/esp_timer/Kconfig | 3 +++ tools/unit-test-app/configs/default_2 | 2 +- tools/unit-test-app/configs/default_2_s2 | 2 +- tools/unit-test-app/configs/pm | 4 ++++ tools/unit-test-app/configs/pm_s2 | 4 ++++ tools/unit-test-app/configs/psram | 2 +- tools/unit-test-app/configs/release_2 | 2 +- tools/unit-test-app/configs/release_2_s2 | 2 +- tools/unit-test-app/configs/single_core_2 | 2 +- tools/unit-test-app/configs/single_core_2_s2 | 2 +- 15 files changed, 29 insertions(+), 12 deletions(-) create mode 100644 tools/unit-test-app/configs/pm create mode 100644 tools/unit-test-app/configs/pm_s2 diff --git a/components/esp32/Kconfig b/components/esp32/Kconfig index 369707e31c..448d8c54fe 100644 --- a/components/esp32/Kconfig +++ b/components/esp32/Kconfig @@ -523,8 +523,10 @@ menu "ESP32-specific" config ESP32_TIME_SYSCALL_USE_RTC_FRC1 bool "RTC and high-resolution timer" + select ESP_TIMER_RTC_USE config ESP32_TIME_SYSCALL_USE_RTC bool "RTC" + select ESP_TIMER_RTC_USE config ESP32_TIME_SYSCALL_USE_FRC1 bool "High-resolution timer" config ESP32_TIME_SYSCALL_USE_NONE diff --git a/components/esp32s2/Kconfig b/components/esp32s2/Kconfig index c84a722c4a..0441c77f1b 100644 --- a/components/esp32s2/Kconfig +++ b/components/esp32s2/Kconfig @@ -392,8 +392,10 @@ menu "ESP32S2-specific" config ESP32S2_TIME_SYSCALL_USE_RTC_FRC1 bool "RTC and high-resolution timer" + select ESP_TIMER_RTC_USE config ESP32S2_TIME_SYSCALL_USE_RTC bool "RTC" + select ESP_TIMER_RTC_USE config ESP32S2_TIME_SYSCALL_USE_FRC1 bool "High-resolution timer" config ESP32S2_TIME_SYSCALL_USE_NONE diff --git a/components/esp32s3/Kconfig b/components/esp32s3/Kconfig index 2fcf3f2b68..c5c8fbe300 100644 --- a/components/esp32s3/Kconfig +++ b/components/esp32s3/Kconfig @@ -430,8 +430,10 @@ menu "ESP32S3-Specific" config ESP32S3_TIME_SYSCALL_USE_RTC_FRC1 bool "RTC and high-resolution timer" + select ESP_TIMER_RTC_USE config ESP32S3_TIME_SYSCALL_USE_RTC bool "RTC" + select ESP_TIMER_RTC_USE config ESP32S3_TIME_SYSCALL_USE_FRC1 bool "High-resolution timer" config ESP32S3_TIME_SYSCALL_USE_NONE diff --git a/components/esp_pm/Kconfig b/components/esp_pm/Kconfig index 40fc1acd02..6619db031f 100644 --- a/components/esp_pm/Kconfig +++ b/components/esp_pm/Kconfig @@ -20,11 +20,10 @@ menu "Power Management" If disabled, DFS will not be active until the application configures it using esp_pm_configure function. + config PM_USE_RTC_TIMER_REF bool "Use RTC timer to prevent time drift (EXPERIMENTAL)" - depends on PM_ENABLE && ESP_TIMER_IMPL_FRC2 && \ - (ESP32_TIME_SYSCALL_USE_RTC || ESP32_TIME_SYSCALL_USE_RTC_FRC1 || \ - ESP32S2_TIME_SYSCALL_USE_RTC || ESP32S2_TIME_SYSCALL_USE_RTC_FRC1) + depends on (PM_ENABLE && ESP_TIMER_IMPL_FRC2 && ESP_TIMER_RTC_USE) default n help When APB clock frequency changes, high-resolution timer (esp_timer) diff --git a/components/esp_pm/test/test_pm.c b/components/esp_pm/test/test_pm.c index a3f07e4f10..311e814782 100644 --- a/components/esp_pm/test/test_pm.c +++ b/components/esp_pm/test/test_pm.c @@ -5,6 +5,7 @@ #include #include "unity.h" #include "esp_pm.h" +#include "esp_sleep.h" #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/semphr.h" @@ -143,6 +144,7 @@ TEST_CASE("Automatic light occurs when tasks are suspended", "[pm]") light_sleep_disable(); } +#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S2, ESP32S3) TEST_CASE("Can wake up from automatic light sleep by GPIO", "[pm]") { #if CONFIG_IDF_TARGET_ESP32 @@ -213,8 +215,7 @@ TEST_CASE("Can wake up from automatic light sleep by GPIO", "[pm]") light_sleep_disable(); } - - +#endif typedef struct { int delay_us; int result; diff --git a/components/esp_timer/Kconfig b/components/esp_timer/Kconfig index f7dabf23fe..86b6923ddd 100644 --- a/components/esp_timer/Kconfig +++ b/components/esp_timer/Kconfig @@ -9,6 +9,9 @@ menu "High resolution timer (esp_timer)" This option has some effect on timer performance and the amount of memory used for timer storage, and should only be used for debugging/testing purposes. + config ESP_TIMER_RTC_USE # [refactor-todo] remove when timekeeping and persistence are separate + bool + config ESP_TIMER_TASK_STACK_SIZE int "High-resolution timer task stack size" default 3584 diff --git a/tools/unit-test-app/configs/default_2 b/tools/unit-test-app/configs/default_2 index 60c41dda13..cd25f10ee8 100644 --- a/tools/unit-test-app/configs/default_2 +++ b/tools/unit-test-app/configs/default_2 @@ -1,3 +1,3 @@ # This config is split between targets since different component needs to be excluded (esp32, esp32s2) CONFIG_IDF_TARGET="esp32" -TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_ipc esp_system esp_timer driver heap pthread soc spi_flash vfs test_utils experimental_cpp_component +TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_ipc esp_pm esp_system esp_timer driver heap pthread soc spi_flash vfs test_utils experimental_cpp_component diff --git a/tools/unit-test-app/configs/default_2_s2 b/tools/unit-test-app/configs/default_2_s2 index 97fb925f23..5ecc100d98 100644 --- a/tools/unit-test-app/configs/default_2_s2 +++ b/tools/unit-test-app/configs/default_2_s2 @@ -1,3 +1,3 @@ # This config is split between targets since different component needs to be excluded (esp32, esp32s2) CONFIG_IDF_TARGET="esp32s2" -TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_ipc esp_system esp_timer driver heap pthread soc spi_flash vfs experimental_cpp_component +TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_ipc esp_pm esp_system esp_timer driver heap pthread soc spi_flash vfs experimental_cpp_component diff --git a/tools/unit-test-app/configs/pm b/tools/unit-test-app/configs/pm new file mode 100644 index 0000000000..4a524936e2 --- /dev/null +++ b/tools/unit-test-app/configs/pm @@ -0,0 +1,4 @@ +CONFIG_IDF_TARGET="esp32" +TEST_COMPONENTS=esp_pm +CONFIG_PM_ENABLE=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y diff --git a/tools/unit-test-app/configs/pm_s2 b/tools/unit-test-app/configs/pm_s2 new file mode 100644 index 0000000000..cb95577df1 --- /dev/null +++ b/tools/unit-test-app/configs/pm_s2 @@ -0,0 +1,4 @@ +CONFIG_IDF_TARGET="esp32s2" +TEST_COMPONENTS=esp_pm +CONFIG_PM_ENABLE=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y diff --git a/tools/unit-test-app/configs/psram b/tools/unit-test-app/configs/psram index ce3bf964a7..dc72acfac7 100644 --- a/tools/unit-test-app/configs/psram +++ b/tools/unit-test-app/configs/psram @@ -1,5 +1,5 @@ CONFIG_IDF_TARGET="esp32" -TEST_EXCLUDE_COMPONENTS=libsodium bt app_update driver esp32 esp_ipc esp_system esp_timer mbedtls spi_flash test_utils heap pthread soc experimental_cpp_component +TEST_EXCLUDE_COMPONENTS=libsodium bt app_update driver esp32 esp_ipc esp_pm esp_system esp_timer mbedtls spi_flash test_utils heap pthread soc experimental_cpp_component CONFIG_ESP32_SPIRAM_SUPPORT=y CONFIG_ESP_INT_WDT_TIMEOUT_MS=800 CONFIG_SPIRAM_OCCUPY_NO_HOST=y diff --git a/tools/unit-test-app/configs/release_2 b/tools/unit-test-app/configs/release_2 index aa232643c7..01e053fd04 100644 --- a/tools/unit-test-app/configs/release_2 +++ b/tools/unit-test-app/configs/release_2 @@ -1,6 +1,6 @@ # This config is split between targets since different component needs to be included (esp32, esp32s2) CONFIG_IDF_TARGET="esp32" -TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_ipc esp_system esp_timer driver heap pthread soc spi_flash vfs test_utils experimental_cpp_component +TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_ipc esp_pm esp_system esp_timer driver heap pthread soc spi_flash vfs test_utils experimental_cpp_component CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y diff --git a/tools/unit-test-app/configs/release_2_s2 b/tools/unit-test-app/configs/release_2_s2 index 1fd6337f19..a513cb9548 100644 --- a/tools/unit-test-app/configs/release_2_s2 +++ b/tools/unit-test-app/configs/release_2_s2 @@ -1,6 +1,6 @@ # This config is split between targets since different component needs to be excluded (esp32, esp32s2) CONFIG_IDF_TARGET="esp32s2" -TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_ipc esp_system esp_timer driver heap pthread soc spi_flash vfs test_utils experimental_cpp_component +TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_ipc esp_pm esp_system esp_timer driver heap pthread soc spi_flash vfs test_utils experimental_cpp_component CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y diff --git a/tools/unit-test-app/configs/single_core_2 b/tools/unit-test-app/configs/single_core_2 index 2201584c71..5ada2e06a7 100644 --- a/tools/unit-test-app/configs/single_core_2 +++ b/tools/unit-test-app/configs/single_core_2 @@ -1,6 +1,6 @@ # This config is split between targets since different component needs to be excluded (esp32, esp32s2) CONFIG_IDF_TARGET="esp32" -TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_system esp_ipc esp_timer driver heap pthread soc spi_flash vfs test_utils experimental_cpp_component +TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32 esp_system esp_pm esp_ipc esp_timer driver heap pthread soc spi_flash vfs test_utils experimental_cpp_component CONFIG_MEMMAP_SMP=n CONFIG_FREERTOS_UNICORE=y CONFIG_ESP32_RTCDATA_IN_FAST_MEM=y diff --git a/tools/unit-test-app/configs/single_core_2_s2 b/tools/unit-test-app/configs/single_core_2_s2 index e953927e4c..c83a254dc4 100644 --- a/tools/unit-test-app/configs/single_core_2_s2 +++ b/tools/unit-test-app/configs/single_core_2_s2 @@ -1,6 +1,6 @@ # This config is split between targets since different component needs to be excluded (esp32, esp32s2) CONFIG_IDF_TARGET="esp32s2" -TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_ipc esp_system esp_timer driver heap pthread soc spi_flash vfs experimental_cpp_component +TEST_EXCLUDE_COMPONENTS=libsodium bt app_update freertos esp32s2 esp_ipc esp_system esp_pm esp_timer driver heap pthread soc spi_flash vfs experimental_cpp_component CONFIG_MEMMAP_SMP=n CONFIG_FREERTOS_UNICORE=y CONFIG_ESP32S2_RTCDATA_IN_FAST_MEM=y