mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 07:04:32 +02:00
unit test: add sleep test case for esp32s3
This commit is contained in:
@@ -20,8 +20,6 @@
|
|||||||
#include "esp_rom_sys.h"
|
#include "esp_rom_sys.h"
|
||||||
#include "esp_timer.h"
|
#include "esp_timer.h"
|
||||||
|
|
||||||
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S3)
|
|
||||||
|
|
||||||
#if CONFIG_IDF_TARGET_ESP32
|
#if CONFIG_IDF_TARGET_ESP32
|
||||||
#include "esp32/clk.h"
|
#include "esp32/clk.h"
|
||||||
#elif CONFIG_IDF_TARGET_ESP32S2
|
#elif CONFIG_IDF_TARGET_ESP32S2
|
||||||
@@ -284,8 +282,10 @@ static void check_wake_stub(void)
|
|||||||
{
|
{
|
||||||
TEST_ASSERT_EQUAL(ESP_RST_DEEPSLEEP, esp_reset_reason());
|
TEST_ASSERT_EQUAL(ESP_RST_DEEPSLEEP, esp_reset_reason());
|
||||||
TEST_ASSERT_EQUAL_HEX32((uint32_t) &wake_stub, s_wake_stub_var);
|
TEST_ASSERT_EQUAL_HEX32((uint32_t) &wake_stub, s_wake_stub_var);
|
||||||
|
#if !CONFIG_IDF_TARGET_ESP32S3
|
||||||
/* ROM code clears wake stub entry address */
|
/* ROM code clears wake stub entry address */
|
||||||
TEST_ASSERT_NULL(esp_get_deep_sleep_wake_stub());
|
TEST_ASSERT_NULL(esp_get_deep_sleep_wake_stub());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE_MULTIPLE_STAGES("can set sleep wake stub", "[deepsleep][reset=DEEPSLEEP_RESET]",
|
TEST_CASE_MULTIPLE_STAGES("can set sleep wake stub", "[deepsleep][reset=DEEPSLEEP_RESET]",
|
||||||
@@ -318,7 +318,12 @@ static void prepare_wake_stub_from_rtc(void)
|
|||||||
a memory capability (as it's an implementation detail). So to test this we need to allocate
|
a memory capability (as it's an implementation detail). So to test this we need to allocate
|
||||||
the stack statically.
|
the stack statically.
|
||||||
*/
|
*/
|
||||||
|
#if CONFIG_IDF_TARGET_ESP32S3
|
||||||
|
uint8_t *sleep_stack = (uint8_t *)heap_caps_malloc(1024, MALLOC_CAP_RTCRAM);
|
||||||
|
TEST_ASSERT((uint32_t)sleep_stack >= SOC_RTC_DRAM_LOW && (uint32_t)sleep_stack < SOC_RTC_DRAM_HIGH);
|
||||||
|
#else
|
||||||
static RTC_FAST_ATTR uint8_t sleep_stack[1024];
|
static RTC_FAST_ATTR uint8_t sleep_stack[1024];
|
||||||
|
#endif
|
||||||
static RTC_FAST_ATTR StaticTask_t sleep_task;
|
static RTC_FAST_ATTR StaticTask_t sleep_task;
|
||||||
|
|
||||||
/* normally BSS like sleep_stack will be cleared on reset, but RTC memory is not cleared on
|
/* normally BSS like sleep_stack will be cleared on reset, but RTC memory is not cleared on
|
||||||
@@ -423,7 +428,7 @@ __attribute__((unused)) static uint32_t get_cause(void)
|
|||||||
return wakeup_cause;
|
return wakeup_cause;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S2)
|
#if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S2, ESP32S3)
|
||||||
// Fails on S2 IDF-2903
|
// Fails on S2 IDF-2903
|
||||||
|
|
||||||
// This test case verifies deactivation of trigger for wake up sources
|
// This test case verifies deactivation of trigger for wake up sources
|
||||||
@@ -498,7 +503,7 @@ TEST_CASE("disable source trigger behavior", "[deepsleep]")
|
|||||||
// Disable ext0 wakeup source, as this might interfere with other tests
|
// Disable ext0 wakeup source, as this might interfere with other tests
|
||||||
ESP_ERROR_CHECK(esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_EXT0));
|
ESP_ERROR_CHECK(esp_sleep_disable_wakeup_source(ESP_SLEEP_WAKEUP_EXT0));
|
||||||
}
|
}
|
||||||
#endif // !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S2)
|
#endif // !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S2, ESP32S3)
|
||||||
|
|
||||||
#endif //SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
|
#endif //SOC_RTCIO_INPUT_OUTPUT_SUPPORTED
|
||||||
|
|
||||||
@@ -537,8 +542,6 @@ static void check_time_deepsleep(void)
|
|||||||
|
|
||||||
TEST_CASE_MULTIPLE_STAGES("check a time after wakeup from deep sleep", "[deepsleep][reset=DEEPSLEEP_RESET]", trigger_deepsleep, check_time_deepsleep);
|
TEST_CASE_MULTIPLE_STAGES("check a time after wakeup from deep sleep", "[deepsleep][reset=DEEPSLEEP_RESET]", trigger_deepsleep, check_time_deepsleep);
|
||||||
|
|
||||||
#endif // #if !TEMPORARY_DISABLED_FOR_TARGETS(ESP32S3)
|
|
||||||
|
|
||||||
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
#if SOC_GPIO_SUPPORT_DEEPSLEEP_WAKEUP
|
||||||
static void gpio_deepsleep_wakeup_config(void)
|
static void gpio_deepsleep_wakeup_config(void)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user