From ad2629af5427811b5ad5d79d0a27670fd3681730 Mon Sep 17 00:00:00 2001 From: wuzhenghui Date: Mon, 30 Oct 2023 11:17:12 +0800 Subject: [PATCH] ci(ulp_test): fix fake sleep of the maincore in ulp pytest cases --- components/ulp/test_apps/ulp_riscv/main/test_ulp_riscv.c | 2 +- .../ulp/test_apps/ulp_riscv/main/ulp/test_main_cocpu_crash.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/components/ulp/test_apps/ulp_riscv/main/test_ulp_riscv.c b/components/ulp/test_apps/ulp_riscv/main/test_ulp_riscv.c index 88209775ee..857211f2cd 100644 --- a/components/ulp/test_apps/ulp_riscv/main/test_ulp_riscv.c +++ b/components/ulp/test_apps/ulp_riscv/main/test_ulp_riscv.c @@ -217,7 +217,7 @@ TEST_CASE("ULP-RISC-V can be reloaded with a good fimware after a crash", "[ulp] /* Verify that main CPU wakes up by a COCPU trap signal trigger */ esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause(); - TEST_ASSERT(cause != ESP_SLEEP_WAKEUP_COCPU); + TEST_ASSERT(cause == ESP_SLEEP_WAKEUP_COCPU_TRAP_TRIG); printf("Resetting the ULP\n"); ulp_riscv_reset(); diff --git a/components/ulp/test_apps/ulp_riscv/main/ulp/test_main_cocpu_crash.c b/components/ulp/test_apps/ulp_riscv/main/ulp/test_main_cocpu_crash.c index 80ca7b9400..054de4cd33 100644 --- a/components/ulp/test_apps/ulp_riscv/main/ulp/test_main_cocpu_crash.c +++ b/components/ulp/test_apps/ulp_riscv/main/ulp/test_main_cocpu_crash.c @@ -6,9 +6,12 @@ #include #include +#include "ulp_riscv_utils.h" int main (void) { + // Wait for the main core in the test case to enter lightsleep + ulp_riscv_delay_cycles(100 * ULP_RISCV_CYCLES_PER_MS); /* Make sure ULP core crashes by doing a NULL pointer access */ uint32_t *null_ptr = NULL; *null_ptr = 1;