Skip to content

Commit c97ab13

Browse files
committed
ci(esp_pm): add pd_top auto lightsleep test case for esp_pm
1 parent 5899701 commit c97ab13

File tree

4 files changed

+20
-3
lines changed

4 files changed

+20
-3
lines changed

components/esp_hw_support/lowpower/cpu_retention/port/esp32p4/sleep_cpu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ static IRAM_ATTR esp_err_t do_cpu_retention(sleep_cpu_entry_cb_t goto_sleep,
410410
esp_sleep_execute_event_callbacks(SLEEP_EVENT_SW_CPU_TO_MEM_END, (void *)0);
411411
#if CONFIG_PM_CHECK_SLEEP_RETENTION_FRAME
412412
/* Minus 2 * sizeof(long) is for bypass `pmufunc` and `frame_crc` field */
413-
update_retention_frame_crc((uint32_t*)frame, RV_SLEEP_CTX_FRMSZ - 2 * sizeof(long), (uint32_t *)(&frame->frame_crc));
413+
update_retention_frame_crc((uint32_t*)frame, RV_SLEEP_CTX_SZ1 - 2 * sizeof(long), (uint32_t *)(&frame->frame_crc));
414414
#endif
415415
REG_WRITE(RTC_SLEEP_WAKE_STUB_ADDR_REG, (uint32_t)rv_core_critical_regs_restore);
416416

@@ -425,7 +425,7 @@ static IRAM_ATTR esp_err_t do_cpu_retention(sleep_cpu_entry_cb_t goto_sleep,
425425
}
426426
#if CONFIG_PM_CHECK_SLEEP_RETENTION_FRAME
427427
else {
428-
validate_retention_frame_crc((uint32_t*)frame, RV_SLEEP_CTX_FRMSZ - 2 * sizeof(long), (uint32_t *)(&frame->frame_crc));
428+
validate_retention_frame_crc((uint32_t*)frame, RV_SLEEP_CTX_SZ1 - 2 * sizeof(long), (uint32_t *)(&frame->frame_crc));
429429
}
430430
#endif
431431

components/esp_pm/test_apps/.build-test-rules.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ components/esp_pm/test_apps:
44
enable:
55
- if: INCLUDE_DEFAULT == 1
66
disable:
7+
- if: CONFIG_NAME == "pm_pd_top_sleep" and IDF_TARGET not in ["esp32c6", "esp32h2", "esp32p4"]
78
- if: IDF_TARGET == "esp32c5"
89
temporary: true
910
reason: not support yet # TODO: [ESP32C5] IDF-8643

components/esp_pm/test_apps/esp_pm/pytest_esp_pm.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2022-2023 Espressif Systems (Shanghai) CO LTD
1+
# SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
22
# SPDX-License-Identifier: Apache-2.0
33
import pytest
44
from pytest_embedded import Dut
@@ -42,3 +42,18 @@ def test_esp_attr_xip_psram_esp32s2(dut: Dut) -> None:
4242
)
4343
def test_esp_attr_xip_psram_esp32s3(dut: Dut) -> None:
4444
dut.run_all_single_board_cases()
45+
46+
47+
# power down CPU and TOP domain in auto-lightsleep
48+
@pytest.mark.esp32c6
49+
@pytest.mark.esp32h2
50+
@pytest.mark.esp32p4
51+
@pytest.mark.generic
52+
@pytest.mark.parametrize(
53+
'config',
54+
[
55+
'pm_pd_top_sleep'
56+
],
57+
)
58+
def test_esp_pd_top_and_cpu_sleep(dut: Dut) -> None:
59+
dut.run_all_single_board_cases()
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP=y

0 commit comments

Comments
 (0)