mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
Merge branch 'bugfix/esp_idf_c5_eco3_cpu_lockup_v6.0' into 'release/v6.0'
change: support top pd during sleep for esp32c5 eco3 and remove sleep mmu related flow (v6.0) See merge request espressif/esp-idf!43585
This commit is contained in:
@@ -85,7 +85,7 @@ static void test_gptimer_sleep_retention(bool allow_pd)
|
||||
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_TIMER_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_TIMER_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(allow_pd ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
@@ -202,7 +202,7 @@ static void test_gptimer_etm_sleep_retention(bool back_up_before_sleep)
|
||||
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_TIMER_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_TIMER_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(back_up_before_sleep ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
from pytest_embedded_idf.utils import soc_filtered_targets
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@@ -14,11 +15,40 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
@idf_parametrize(
|
||||
'target', soc_filtered_targets('SOC_GPTIMER_SUPPORTED == 1 and IDF_TARGET not in ["esp32c5"]'), indirect=['target']
|
||||
)
|
||||
def test_gptimer(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'cache_safe',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_gptimer_esp32c5(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_gptimer_esp32c5_eco3(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.xtal_26mhz
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -43,7 +43,7 @@ static void s_test_i2s_enter_light_sleep(int sec, bool allow_power_down)
|
||||
printf("Woke up from light sleep\n");
|
||||
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_HAS(PAU) && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_HAS(PAU)
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(allow_power_down ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
@@ -16,13 +16,48 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
)
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
['esp32', 'esp32s2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32h2', 'esp32p4', 'esp32c61'],
|
||||
['esp32', 'esp32s2', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4', 'esp32c61'],
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_i2s(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'iram_safe',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
['esp32c5'],
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_i2s_esp32c5(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
['esp32c5'],
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_i2s_esp32c5_eco3(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.octal_psram
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
|
||||
@@ -59,7 +59,7 @@ static void test_ledc_sleep_retention(bool allow_pd)
|
||||
|
||||
printf("Check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_PMU_SUPPORTED && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_PMU_SUPPORTED
|
||||
// check if the TOP power domain on/off as desired
|
||||
TEST_ASSERT_EQUAL(allow_pd ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded_idf import IdfDut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
from pytest_embedded_idf.utils import soc_filtered_targets
|
||||
|
||||
|
||||
@pytest.mark.temp_skip_ci(targets=['esp32s3'], reason='skip due to duplication with test_ledc_psram')
|
||||
@@ -15,11 +16,40 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
@idf_parametrize(
|
||||
'target', soc_filtered_targets('SOC_LEDC_SUPPORTED == 1 and IDF_TARGET not in ["esp32c5"]'), indirect=['target']
|
||||
)
|
||||
def test_ledc(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(reset=True)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'iram_safe',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_ledc_esp32c5(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(reset=True)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_ledc_esp32c5_eco3(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(reset=True)
|
||||
|
||||
|
||||
@pytest.mark.octal_psram
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
|
||||
@@ -84,7 +84,7 @@ static void test_mcpwm_timer_sleep_retention(bool allow_pd)
|
||||
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_MCPWM_SUPPORT_SLEEP_RETENTION && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_MCPWM_SUPPORT_SLEEP_RETENTION
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(allow_pd ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
@@ -189,7 +189,7 @@ static void test_mcpwm_capture_timer_sleep_retention(bool allow_pd)
|
||||
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_MCPWM_SUPPORT_SLEEP_RETENTION && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_MCPWM_SUPPORT_SLEEP_RETENTION
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(allow_pd ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
@@ -14,6 +14,33 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32', 'esp32s3', 'esp32c5', 'esp32c6', 'esp32h2', 'esp32p4'], indirect=['target'])
|
||||
@idf_parametrize('target', ['esp32', 'esp32s3', 'esp32c6', 'esp32h2', 'esp32p4'], indirect=['target'])
|
||||
def test_mcpwm(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'cache_safe',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_mcpwm_esp32c5(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_mcpwm_esp32c5_eco3(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
@@ -133,7 +133,7 @@ static void test_parlio_sleep_retention(bool allow_pd)
|
||||
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_PARLIO_SUPPORT_SLEEP_RETENTION && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_PARLIO_SUPPORT_SLEEP_RETENTION
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(allow_pd ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
@@ -14,6 +14,33 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5', 'esp32c6', 'esp32h2', 'esp32p4'], indirect=['target'])
|
||||
@idf_parametrize('target', ['esp32c6', 'esp32h2', 'esp32p4'], indirect=['target'])
|
||||
def test_parlio(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'cache_safe',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_parlio_esp32c5(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_parlio_esp32c5_eco3(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
@@ -99,7 +99,7 @@ static void test_pcnt_sleep_retention(void)
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
|
||||
#if SOC_PMU_SUPPORTED && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_PMU_SUPPORTED
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -107,7 +107,7 @@ static void test_rmt_tx_rx_sleep_retention(bool allow_pd)
|
||||
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_RMT_SUPPORT_SLEEP_RETENTION && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_RMT_SUPPORT_SLEEP_RETENTION
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(allow_pd ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
@@ -14,13 +14,38 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize(
|
||||
'target', ['esp32', 'esp32s2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32h2', 'esp32p4'], indirect=['target']
|
||||
)
|
||||
@idf_parametrize('target', ['esp32', 'esp32s2', 'esp32c3', 'esp32c6', 'esp32h2', 'esp32p4'], indirect=['target'])
|
||||
def test_rmt(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'cache_safe',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_rmt_esp32c5(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_rmt_esp32c5_eco3(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.octal_psram
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
|
||||
@@ -64,7 +64,7 @@ static void test_sdm_sleep_retention(bool allow_pd)
|
||||
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_SDM_SUPPORT_SLEEP_RETENTION && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_SDM_SUPPORT_SLEEP_RETENTION
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(allow_pd ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded_idf import IdfDut
|
||||
@@ -15,8 +15,23 @@ CONFIGS = [
|
||||
@pytest.mark.parametrize('config', CONFIGS, indirect=True)
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
soc_filtered_targets('SOC_SDM_SUPPORTED == 1'),
|
||||
soc_filtered_targets('SOC_SDM_SUPPORTED == 1 and IDF_TARGET not in ["esp32c5"]'),
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_sdm(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(group='sdm')
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['iram_safe'], indirect=True)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_sdm_esp32c5(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(group='sdm')
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize('config', ['release'], indirect=True)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_sdm_esp32c5_eco3(dut: IdfDut) -> None:
|
||||
dut.run_all_single_board_cases(group='sdm')
|
||||
|
||||
@@ -1885,7 +1885,7 @@ TEST_CASE("test_spi_master_sleep_retention", "[spi]")
|
||||
|
||||
// check if the sleep happened as expected
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL((buscfg.flags & SPICOMMON_BUSFLAG_SLP_ALLOW_PD) ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
@@ -1952,7 +1952,7 @@ TEST_CASE("test_spi_master_auto_sleep_retention", "[spi]")
|
||||
|
||||
// check if the sleep happened as expected
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL((buscfg.flags & SPICOMMON_BUSFLAG_SLP_ALLOW_PD) ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import pytest
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
from pytest_embedded_idf.utils import soc_filtered_targets
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@@ -13,7 +14,9 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
@idf_parametrize(
|
||||
'target', soc_filtered_targets('SOC_GPSPI_SUPPORTED == 1 and IDF_TARGET not in ["esp32c5"]'), indirect=['target']
|
||||
)
|
||||
def test_master_single_dev(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if 'test_env' in case.attributes:
|
||||
@@ -21,6 +24,39 @@ def test_master_single_dev(case_tester) -> None: # type: ignore
|
||||
case_tester.run_normal_case(case=case, reset=True)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'freertos_flash',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_master_single_dev_esp32c5(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if 'test_env' in case.attributes:
|
||||
continue # If `test_env` is defined, should not run on generic runner
|
||||
case_tester.run_normal_case(case=case, reset=True)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_master_single_dev_esp32c5_eco3(case_tester) -> None: # type: ignore
|
||||
for case in case_tester.test_menu:
|
||||
if 'test_env' in case.attributes:
|
||||
continue # If `test_env` is defined, should not run on generic runner
|
||||
case_tester.run_normal_case(case=case, reset=True)
|
||||
|
||||
|
||||
# Job for test_env `external_flash` just for esp32 only
|
||||
@pytest.mark.flash_multi
|
||||
@pytest.mark.parametrize(
|
||||
|
||||
@@ -689,7 +689,7 @@ TEST_CASE("test_spi_slave_sleep_retention", "[spi]")
|
||||
|
||||
// check if the sleep happened as expected
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL((buscfg.flags & SPICOMMON_BUSFLAG_SLP_ALLOW_PD) ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,16 +1,34 @@
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
import pytest
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
from pytest_embedded_idf.utils import soc_filtered_targets
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['release', 'iram_safe'], indirect=True)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
@idf_parametrize(
|
||||
'target', soc_filtered_targets('SOC_GPSPI_SUPPORTED == 1 and IDF_TARGET not in ["esp32c5"]'), indirect=['target']
|
||||
)
|
||||
def test_slave_single_dev(case_tester) -> None: # type: ignore
|
||||
case_tester.run_all_normal_cases(reset=True)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['iram_safe'], indirect=True)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_slave_single_dev_esp32c5(case_tester) -> None: # type: ignore
|
||||
case_tester.run_all_normal_cases(reset=True)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize('config', ['release'], indirect=True)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_slave_single_dev_esp32c5_eco3(case_tester) -> None: # type: ignore
|
||||
case_tester.run_all_normal_cases(reset=True)
|
||||
|
||||
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize('count, config', [(2, 'release'), (2, 'iram_safe')], indirect=True)
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
|
||||
@@ -966,7 +966,7 @@ TEST_CASE("test_spi_slave_hd_sleep_retention", "[spi]")
|
||||
printf("Waked up!\n");
|
||||
// check if the sleep happened as expected
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL((bus_cfg.flags & SPICOMMON_BUSFLAG_SLP_ALLOW_PD) ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
@@ -1044,7 +1044,7 @@ TEST_CASE("test_spi_slave_hd_append_sleep_retention", "[spi]")
|
||||
printf("Waked up!\n");
|
||||
// check if the sleep happened as expected
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_SPI_SUPPORT_SLEEP_RETENTION && CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL((bus_cfg.flags & SPICOMMON_BUSFLAG_SLP_ALLOW_PD) ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import pytest
|
||||
@@ -8,11 +8,23 @@ from pytest_embedded_idf.utils import soc_filtered_targets
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize('config', ['release'], indirect=True)
|
||||
@idf_parametrize('target', soc_filtered_targets('SOC_SPI_SUPPORT_SLAVE_HD_VER2 == 1'), indirect=['target'])
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
soc_filtered_targets('SOC_SPI_SUPPORT_SLAVE_HD_VER2 == 1 and IDF_TARGET not in ["esp32c5"]'),
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_slave_hd_single_dev(case_tester) -> None: # type: ignore
|
||||
case_tester.run_all_normal_cases(reset=True, timeout=180)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize('config', ['release'], indirect=True)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_slave_hd_single_dev_esp32c5_eco3(case_tester) -> None: # type: ignore
|
||||
case_tester.run_all_normal_cases(reset=True, timeout=180)
|
||||
|
||||
|
||||
@pytest.mark.generic_multi_device
|
||||
@pytest.mark.parametrize('count, config', [(2, 'release')], indirect=True)
|
||||
@idf_parametrize('target', soc_filtered_targets('SOC_SPI_SUPPORT_SLAVE_HD_VER2 == 1'), indirect=['target'])
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@ static void test_temperature_sensor_sleep_retention(bool allow_pd)
|
||||
#endif
|
||||
printf("check if the sleep happened as expected\r\n");
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
#if SOC_TEMPERATURE_SENSOR_UNDER_PD_TOP_DOMAIN && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if SOC_TEMPERATURE_SENSOR_UNDER_PD_TOP_DOMAIN
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(allow_pd ? PMU_SLEEP_PD_TOP : 0, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#elif CONFIG_IDF_TARGET_ESP32P4
|
||||
|
||||
+20
-2
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2021-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2021-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
@@ -16,13 +16,31 @@ from pytest_embedded_idf.utils import idf_parametrize
|
||||
)
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
['esp32s2', 'esp32c3', 'esp32s3', 'esp32c2', 'esp32c6', 'esp32h2', 'esp32p4', 'esp32c5', 'esp32c61'],
|
||||
['esp32s2', 'esp32c3', 'esp32s3', 'esp32c2', 'esp32c6', 'esp32h2', 'esp32p4', 'esp32c61'],
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_temperature_sensor_driver(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
[
|
||||
'release',
|
||||
],
|
||||
indirect=True,
|
||||
)
|
||||
@idf_parametrize(
|
||||
'target',
|
||||
['esp32c5'],
|
||||
indirect=['target'],
|
||||
)
|
||||
def test_temperature_sensor_driver_esp32c5_eco3(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases()
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.parametrize(
|
||||
'config',
|
||||
|
||||
@@ -83,11 +83,9 @@ static void eth_test_start_sleep(esp_eth_handle_t eth_handle, bool pd_top_down)
|
||||
esp_eth_ioctl(eth_handle, ETH_MAC_ESP_CMD_DUMP_REGS, NULL);
|
||||
#endif
|
||||
|
||||
#if !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
printf("sleep_ctx.sleep_flags: 0x%" PRIx32 "\n", sleep_ctx.sleep_flags);
|
||||
// Check if the power domain was powered down
|
||||
TEST_ASSERT_EQUAL(pd_top_down ? PMU_SLEEP_PD_TOP : 0, sleep_ctx.sleep_flags & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
esp_sleep_set_sleep_context(NULL);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
@@ -172,22 +172,6 @@ esp_err_t esp_deep_sleep_register_phy_hook(esp_deep_sleep_cb_t new_dslp_cb);
|
||||
void esp_deep_sleep_deregister_phy_hook(esp_deep_sleep_cb_t old_dslp_cb);
|
||||
#endif
|
||||
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD
|
||||
/**
|
||||
* @brief Backup or restore the MMU when the top domain is powered down.
|
||||
* @param backup_or_restore decide to backup mmu or restore mmu
|
||||
*/
|
||||
void esp_sleep_mmu_retention(bool backup_or_restore);
|
||||
|
||||
/**
|
||||
* @brief Whether to allow the top domain to be powered off due to mmu domain requiring retention.
|
||||
*
|
||||
* In light sleep mode, only when the system can provide enough memory
|
||||
* for mmu retention, the top power domain can be powered off.
|
||||
*/
|
||||
bool mmu_domain_pd_allowed(void);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief Notify the sleep process that `sleep_time_overhead_out` needs to be remeasured, which must be called
|
||||
* in the following scenarios:
|
||||
|
||||
@@ -29,10 +29,6 @@ if(CONFIG_P4_REV3_MSPI_CRASH_AFTER_POWER_UP_WORKAROUND)
|
||||
APPEND PROPERTY INTERFACE_LINK_LIBRARIES "-u p4_rev3_mspi_workaround")
|
||||
endif()
|
||||
|
||||
if(CONFIG_SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD AND CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP)
|
||||
list(APPEND srcs "port/${target}/sleep_mmu.c")
|
||||
endif()
|
||||
|
||||
if((CONFIG_SOC_PM_SUPPORT_MODEM_PD OR CONFIG_SOC_PM_SUPPORT_TOP_PD) AND CONFIG_SOC_PAU_SUPPORTED)
|
||||
list(APPEND srcs "port/${target}/sleep_clock.c")
|
||||
endif()
|
||||
|
||||
@@ -1,152 +0,0 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2023-2024 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "esp_attr.h"
|
||||
#include "esp_check.h"
|
||||
#include "esp_sleep.h"
|
||||
#include "esp_log.h"
|
||||
#include "esp_heap_caps.h"
|
||||
#include "soc/soc_caps.h"
|
||||
#include "sdkconfig.h"
|
||||
#include "soc/spi_mem_reg.h"
|
||||
#include "esp_private/startup_internal.h"
|
||||
|
||||
ESP_LOG_ATTR_TAG(TAG, "sleep_mmu");
|
||||
|
||||
typedef struct {
|
||||
uint32_t start;
|
||||
uint32_t end;
|
||||
} mmu_domain_dev_regs_region_t;
|
||||
|
||||
typedef struct {
|
||||
mmu_domain_dev_regs_region_t *region;
|
||||
int region_num;
|
||||
uint32_t *regs_frame;
|
||||
} mmu_domain_dev_sleep_frame_t;
|
||||
|
||||
/**
|
||||
* Internal structure which holds all requested light sleep mmu retention parameters
|
||||
*/
|
||||
typedef struct {
|
||||
struct {
|
||||
mmu_domain_dev_sleep_frame_t *mmu_table_frame;
|
||||
} retent;
|
||||
} sleep_mmu_retention_t;
|
||||
|
||||
static DRAM_ATTR __attribute__((unused)) sleep_mmu_retention_t s_mmu_retention;
|
||||
|
||||
static void * mmu_domain_dev_sleep_frame_alloc_and_init(const mmu_domain_dev_regs_region_t *regions, const int region_num)
|
||||
{
|
||||
const int region_sz = sizeof(mmu_domain_dev_regs_region_t) * region_num;
|
||||
int regs_frame_sz = 0;
|
||||
for (int num = 0; num < region_num; num++) {
|
||||
regs_frame_sz += regions[num].end - regions[num].start;
|
||||
}
|
||||
void *frame = heap_caps_malloc(sizeof(mmu_domain_dev_sleep_frame_t) + region_sz + regs_frame_sz, MALLOC_CAP_32BIT|MALLOC_CAP_INTERNAL);
|
||||
if (frame) {
|
||||
mmu_domain_dev_regs_region_t *region = (mmu_domain_dev_regs_region_t *)(frame + sizeof(mmu_domain_dev_sleep_frame_t));
|
||||
memcpy(region, regions, region_num * sizeof(mmu_domain_dev_regs_region_t));
|
||||
void *regs_frame = frame + sizeof(mmu_domain_dev_sleep_frame_t) + region_sz;
|
||||
memset(regs_frame, 0, regs_frame_sz);
|
||||
*(mmu_domain_dev_sleep_frame_t *)frame = (mmu_domain_dev_sleep_frame_t) {
|
||||
.region = region,
|
||||
.region_num = region_num,
|
||||
.regs_frame = (uint32_t *)regs_frame
|
||||
};
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
static inline void * mmu_domain_mmu_table_sleep_frame_alloc_and_init(void)
|
||||
{
|
||||
#define MMU_TABLE_SIZE (512 * 4)
|
||||
const static mmu_domain_dev_regs_region_t regions[] = {
|
||||
{ .start = SPI_MEM_MMU_ITEM_CONTENT_REG(0), .end = SPI_MEM_MMU_ITEM_CONTENT_REG(0) + MMU_TABLE_SIZE}
|
||||
};
|
||||
return mmu_domain_dev_sleep_frame_alloc_and_init(regions, sizeof(regions) / sizeof(regions[0]));
|
||||
}
|
||||
|
||||
static IRAM_ATTR void mmu_domain_dev_regs_save(mmu_domain_dev_sleep_frame_t *frame)
|
||||
{
|
||||
assert(frame);
|
||||
mmu_domain_dev_regs_region_t *region = frame->region;
|
||||
uint32_t *regs_frame = frame->regs_frame;
|
||||
|
||||
int offset = 0;
|
||||
for (int i = 0; i < frame->region_num; i++) {
|
||||
for (uint32_t addr = region[i].start; addr < region[i].end; addr+=4) {
|
||||
REG_WRITE(SPI_MEM_MMU_ITEM_INDEX_REG(0), offset);
|
||||
regs_frame[offset++] = REG_READ(SPI_MEM_MMU_ITEM_CONTENT_REG(0));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static IRAM_ATTR void mmu_domain_dev_regs_restore(mmu_domain_dev_sleep_frame_t *frame)
|
||||
{
|
||||
assert(frame);
|
||||
mmu_domain_dev_regs_region_t *region = frame->region;
|
||||
uint32_t *regs_frame = frame->regs_frame;
|
||||
|
||||
int offset = 0;
|
||||
for (int i = 0; i < frame->region_num; i++) {
|
||||
for (uint32_t addr = region[i].start; addr < region[i].end; addr+=4) {
|
||||
REG_WRITE(SPI_MEM_MMU_ITEM_INDEX_REG(0), offset);
|
||||
REG_WRITE(SPI_MEM_MMU_ITEM_CONTENT_REG(0),regs_frame[offset++]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IRAM_ATTR void esp_sleep_mmu_retention(bool backup_or_restore)
|
||||
{
|
||||
if (backup_or_restore) {
|
||||
mmu_domain_dev_regs_save(s_mmu_retention.retent.mmu_table_frame);
|
||||
} else {
|
||||
mmu_domain_dev_regs_restore(s_mmu_retention.retent.mmu_table_frame);
|
||||
}
|
||||
}
|
||||
|
||||
static esp_err_t esp_sleep_mmu_retention_deinit(void)
|
||||
{
|
||||
if (s_mmu_retention.retent.mmu_table_frame) {
|
||||
heap_caps_free((void *)s_mmu_retention.retent.mmu_table_frame);
|
||||
s_mmu_retention.retent.mmu_table_frame = NULL;
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
|
||||
static esp_err_t esp_sleep_mmu_retention_init(void)
|
||||
{
|
||||
if (s_mmu_retention.retent.mmu_table_frame == NULL) {
|
||||
void *frame = mmu_domain_mmu_table_sleep_frame_alloc_and_init();
|
||||
if (frame == NULL) {
|
||||
goto err;
|
||||
}
|
||||
s_mmu_retention.retent.mmu_table_frame = (mmu_domain_dev_sleep_frame_t *)frame;
|
||||
}
|
||||
return ESP_OK;
|
||||
err:
|
||||
esp_sleep_mmu_retention_deinit();
|
||||
return ESP_ERR_NO_MEM;
|
||||
}
|
||||
|
||||
bool mmu_domain_pd_allowed(void)
|
||||
{
|
||||
return (s_mmu_retention.retent.mmu_table_frame != NULL);
|
||||
}
|
||||
|
||||
ESP_SYSTEM_INIT_FN(sleep_mmu_startup_init, SECONDARY, BIT(0), 108)
|
||||
{
|
||||
esp_err_t ret;
|
||||
ret = esp_sleep_mmu_retention_init();
|
||||
if (ret != ESP_OK) {
|
||||
ESP_EARLY_LOGW(TAG, "Failed to enable TOP power down during light sleep.");
|
||||
}
|
||||
return ESP_OK;
|
||||
}
|
||||
@@ -232,10 +232,6 @@
|
||||
#define DEEP_SLEEP_TIME_OVERHEAD_US (250 + 100 * 240 / CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ)
|
||||
#endif
|
||||
|
||||
#if SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD
|
||||
#define SLEEP_MMU_TABLE_RETENTION_OVERHEAD_US (1220)
|
||||
#endif
|
||||
|
||||
#define RTC_MODULE_SLEEP_PREPARE_CYCLES (6)
|
||||
|
||||
#define CHECK_SOURCE(source, value, mask) ((s_config.wakeup_triggers & mask) && \
|
||||
@@ -885,9 +881,6 @@ static esp_err_t FORCE_IRAM_ATTR esp_sleep_start_safe(uint32_t sleep_flags, uint
|
||||
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
if (sleep_flags & PMU_SLEEP_PD_TOP) {
|
||||
#if SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD
|
||||
esp_sleep_mmu_retention(true);
|
||||
#endif
|
||||
#if CONFIG_IDF_TARGET_ESP32P4 && (CONFIG_ESP_REV_MIN_FULL == 300)
|
||||
sleep_retention_do_extra_retention(true);
|
||||
#endif
|
||||
@@ -915,9 +908,6 @@ static esp_err_t FORCE_IRAM_ATTR esp_sleep_start_safe(uint32_t sleep_flags, uint
|
||||
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
if (sleep_flags & PMU_SLEEP_PD_TOP) {
|
||||
#if SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD
|
||||
esp_sleep_mmu_retention(false);
|
||||
#endif
|
||||
#if SOC_PM_RETENTION_SW_TRIGGER_REGDMA
|
||||
sleep_retention_do_system_retention(false);
|
||||
#endif
|
||||
@@ -1449,10 +1439,6 @@ esp_err_t esp_light_sleep_start(void)
|
||||
int sleep_time_sw_adjustment = LIGHT_SLEEP_TIME_OVERHEAD_US + sleep_time_overhead_in + s_config.sleep_time_overhead_out;
|
||||
int sleep_time_hw_adjustment = pmu_sleep_calculate_hw_wait_time(sleep_flags, rtc_clk_slow_src_get(), s_config.rtc_clk_cal_period, s_config.fast_clk_cal_period);
|
||||
s_config.sleep_time_adjustment = sleep_time_sw_adjustment + sleep_time_hw_adjustment;
|
||||
#if SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD
|
||||
int sleep_time_sw_mmu_table_restore = (sleep_flags & PMU_SLEEP_PD_TOP) ? SLEEP_MMU_TABLE_RETENTION_OVERHEAD_US : 0;
|
||||
s_config.sleep_time_adjustment += sleep_time_sw_mmu_table_restore;
|
||||
#endif
|
||||
#else
|
||||
uint32_t rtc_cntl_xtl_buf_wait_slp_cycles = rtc_time_us_to_slowclk(RTC_CNTL_XTL_BUF_WAIT_SLP_US, s_config.rtc_clk_cal_period);
|
||||
s_config.sleep_time_adjustment = LIGHT_SLEEP_TIME_OVERHEAD_US + sleep_time_overhead_in + s_config.sleep_time_overhead_out
|
||||
@@ -2563,9 +2549,6 @@ FORCE_INLINE_ATTR bool top_domain_pd_allowed(void) {
|
||||
top_pd_allowed &= cpu_domain_pd_allowed();
|
||||
#else
|
||||
top_pd_allowed = false;
|
||||
#endif
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD
|
||||
top_pd_allowed &= mmu_domain_pd_allowed();
|
||||
#endif
|
||||
top_pd_allowed &= clock_domain_pd_allowed();
|
||||
top_pd_allowed &= peripheral_domain_pd_allowed();
|
||||
@@ -2575,10 +2558,11 @@ FORCE_INLINE_ATTR bool top_domain_pd_allowed(void) {
|
||||
#if SOC_XTAL_CLOCK_PATH_DEPENDS_ON_TOP_DOMAIN
|
||||
top_pd_allowed &= (s_config.domain[ESP_PD_DOMAIN_XTAL].pd_option != ESP_PD_OPTION_ON);
|
||||
#endif
|
||||
#if SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
// TODO: PM-436, Need to use efuse_hal_chip_revision() to determine whether
|
||||
// the TOP domain power-down is allowed
|
||||
top_pd_allowed = false;
|
||||
#if CONFIG_IDF_TARGET_ESP32C5
|
||||
if (!ESP_CHIP_REV_ABOVE(efuse_hal_chip_revision(), 102)) {
|
||||
// ESP32C5 chips lower than v1.2 are not supported to power down the TOP domain
|
||||
top_pd_allowed = false;
|
||||
}
|
||||
#endif
|
||||
|
||||
return top_pd_allowed;
|
||||
|
||||
@@ -92,7 +92,7 @@ TEST_CASE("verify esp_random() bit balance 0/1 ratio", "[random]")
|
||||
#endif
|
||||
TEST_ESP_OK(esp_sleep_enable_timer_wakeup(1 * 1000 * 1000));
|
||||
TEST_ESP_OK(esp_light_sleep_start());
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
// check if the power domain also is powered down
|
||||
TEST_ASSERT_EQUAL(PMU_SLEEP_PD_TOP, (sleep_ctx.sleep_flags) & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
|
||||
+28
-2
@@ -1,15 +1,41 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import pytest
|
||||
from pytest_embedded import Dut
|
||||
from pytest_embedded_idf.utils import idf_parametrize
|
||||
from pytest_embedded_idf.utils import soc_filtered_targets
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize(
|
||||
'config,target',
|
||||
[('single_core_esp32', 'esp32'), ('default', 'supported_targets'), ('release', 'supported_targets')],
|
||||
[
|
||||
('single_core_esp32', 'esp32'),
|
||||
*(('default', target) for target in soc_filtered_targets('IDF_TARGET not in ["esp32c5"]')),
|
||||
*(('release', target) for target in soc_filtered_targets('IDF_TARGET not in ["esp32c5"]')),
|
||||
],
|
||||
indirect=['config', 'target'],
|
||||
)
|
||||
def test_esp_hw_support(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=180)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize(
|
||||
'config,target',
|
||||
[('default', 'esp32c5')],
|
||||
indirect=['config', 'target'],
|
||||
)
|
||||
def test_esp_hw_support_esp32c5(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=180)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@idf_parametrize(
|
||||
'config,target',
|
||||
[('release', 'esp32c5')],
|
||||
indirect=['config', 'target'],
|
||||
)
|
||||
def test_esp_hw_support_esp32c5_eco3(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=180)
|
||||
|
||||
@@ -33,8 +33,6 @@ entries:
|
||||
sleep_cpu:sleep_enable_cpu_retention (noflash)
|
||||
if PM_POWER_DOWN_CPU_IN_LIGHT_SLEEP = y || (ESP32P4_SELECTS_REV_LESS_V3 = y && PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP = y):
|
||||
sleep_cpu:cpu_domain_pd_allowed (noflash)
|
||||
if SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD = y && PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP = y:
|
||||
sleep_mmu:mmu_domain_pd_allowed (noflash)
|
||||
esp_clk:esp_clk_slowclk_cal_set (noflash)
|
||||
esp_clk:esp_clk_slowclk_cal_get (noflash)
|
||||
esp_clk:esp_rtc_get_time_us (noflash)
|
||||
|
||||
@@ -92,7 +92,6 @@ SECONDARY: 106: sleep_clock_startup_init in components/esp_hw_support/lowpower/p
|
||||
SECONDARY: 106: sleep_clock_startup_init in components/esp_hw_support/lowpower/port/esp32h4/sleep_clock.c on BIT(0)
|
||||
SECONDARY: 106: sleep_clock_startup_init in components/esp_hw_support/lowpower/port/esp32p4/sleep_clock.c on BIT(0)
|
||||
SECONDARY: 107: sleep_sys_periph_startup_init in components/esp_hw_support/sleep_system_peripheral.c on BIT(0)
|
||||
SECONDARY: 108: sleep_mmu_startup_init in components/esp_hw_support/lowpower/port/esp32c5/sleep_mmu.c on BIT(0)
|
||||
|
||||
# app_trace doesn't have init dependencies
|
||||
SECONDARY: 115: apptrace_early_init in components/app_trace/app_trace.c on ESP_SYSTEM_INIT_ALL_CORES
|
||||
|
||||
@@ -322,7 +322,7 @@ static void test_psram_accessible_after_lightsleep(void)
|
||||
esp_light_sleep_start();
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP && !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
#if CONFIG_PM_POWER_DOWN_PERIPHERAL_IN_LIGHT_SLEEP
|
||||
TEST_ASSERT_EQUAL(PMU_SLEEP_PD_TOP, sleep_ctx.sleep_flags & PMU_SLEEP_PD_TOP);
|
||||
TEST_ESP_OK(sleep_cpu_configure(false));
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
|
||||
* SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
*
|
||||
* SPDX-License-Identifier: Unlicense OR CC0-1.0
|
||||
*/
|
||||
@@ -64,19 +64,11 @@ TEST_CASE("Task WDT task timeout after peripheral powerdown lightsleep", "[task_
|
||||
TEST_ESP_OK(sleep_cpu_configure(true));
|
||||
esp_sleep_context_t sleep_ctx;
|
||||
esp_sleep_set_sleep_context(&sleep_ctx);
|
||||
#if SOC_PM_MMU_TABLE_RETENTION_WHEN_TOP_PD
|
||||
/* There is a bug that PD TOP will reset mmu table, so we add mmu table retention during sleep,
|
||||
and it will increase time overhead before entering sleep */
|
||||
esp_sleep_enable_timer_wakeup(100 * 1000);
|
||||
#else
|
||||
esp_sleep_enable_timer_wakeup(10 * 1000);
|
||||
#endif
|
||||
|
||||
esp_light_sleep_start();
|
||||
|
||||
#if !SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
TEST_ASSERT_EQUAL(PMU_SLEEP_PD_TOP, sleep_ctx.sleep_flags & PMU_SLEEP_PD_TOP);
|
||||
#endif
|
||||
TEST_ASSERT_EQUAL(0, sleep_ctx.sleep_request_result);
|
||||
esp_sleep_set_sleep_context(NULL);
|
||||
|
||||
|
||||
+39
-5
@@ -1,4 +1,4 @@
|
||||
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-FileCopyrightText: 2022-2026 Espressif Systems (Shanghai) CO LTD
|
||||
# SPDX-License-Identifier: CC0-1.0
|
||||
import time
|
||||
|
||||
@@ -12,12 +12,17 @@ from pytest_embedded_idf.utils import soc_filtered_targets
|
||||
@idf_parametrize(
|
||||
'config,target',
|
||||
[
|
||||
('default', 'supported_targets'),
|
||||
('pd_vddsdio', 'supported_targets'),
|
||||
*(('psram', target) for target in soc_filtered_targets('SOC_SPIRAM_SUPPORTED == 1')),
|
||||
*(('default', target) for target in soc_filtered_targets('IDF_TARGET not in ["esp32c5"]')),
|
||||
*(('pd_vddsdio', target) for target in soc_filtered_targets('IDF_TARGET not in ["esp32c5"]')),
|
||||
*(
|
||||
('psram', target)
|
||||
for target in soc_filtered_targets('SOC_SPIRAM_SUPPORTED == 1 and IDF_TARGET not in ["esp32c5"]')
|
||||
),
|
||||
*(
|
||||
('psram_with_pd_top', target)
|
||||
for target in soc_filtered_targets('SOC_SPIRAM_SUPPORTED == 1 and SOC_PM_SUPPORT_TOP_PD == 1')
|
||||
for target in soc_filtered_targets(
|
||||
'SOC_SPIRAM_SUPPORTED == 1 and SOC_PM_SUPPORT_TOP_PD == 1 and IDF_TARGET not in ["esp32c5"]'
|
||||
)
|
||||
),
|
||||
('single_core_esp32', 'esp32'),
|
||||
],
|
||||
@@ -77,6 +82,35 @@ def test_sleep_uart_handling(dut: Dut) -> None:
|
||||
)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize(
|
||||
'config',
|
||||
[
|
||||
'pd_vddsdio',
|
||||
'psram',
|
||||
],
|
||||
indirect=['config'],
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_esp_system_esp32c5(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=60)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@pytest.mark.esp32c5_eco3
|
||||
@idf_parametrize(
|
||||
'config',
|
||||
[
|
||||
'default',
|
||||
'psram_with_pd_top',
|
||||
],
|
||||
indirect=['config'],
|
||||
)
|
||||
@idf_parametrize('target', ['esp32c5'], indirect=['target'])
|
||||
def test_esp_system_esp32c5_eco3(dut: Dut) -> None:
|
||||
dut.run_all_single_board_cases(timeout=60)
|
||||
|
||||
|
||||
@pytest.mark.generic
|
||||
@idf_parametrize('config', ['default'], indirect=['config'])
|
||||
@idf_parametrize('target', ['supported_targets'], indirect=['target'])
|
||||
|
||||
@@ -1483,10 +1483,6 @@ config SOC_EXT_MEM_CACHE_TAG_IN_CPU_DOMAIN
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_PM_TOP_PD_NOT_ALLOWED
|
||||
bool
|
||||
default y
|
||||
|
||||
config SOC_PM_PAU_LINK_NUM
|
||||
int
|
||||
default 5
|
||||
|
||||
@@ -601,7 +601,6 @@
|
||||
#define SOC_PM_CPU_RETENTION_BY_SW (1)
|
||||
#define SOC_PM_MODEM_RETENTION_BY_REGDMA (1)
|
||||
#define SOC_EXT_MEM_CACHE_TAG_IN_CPU_DOMAIN (1)
|
||||
#define SOC_PM_TOP_PD_NOT_ALLOWED (1)
|
||||
|
||||
#define SOC_PM_PAU_LINK_NUM (5)
|
||||
#define SOC_PM_PAU_REGDMA_LINK_CONFIGURABLE (1)
|
||||
|
||||
@@ -131,4 +131,5 @@ env_markers =
|
||||
esp32c2eco4: esp32c2 major version(v2.0) chips
|
||||
recovery_bootloader: Runner with recovery bootloader offset set in
|
||||
esp32p4_eco4: Runner with esp32p4 eco4 connected
|
||||
esp32c5_eco3: Runner with esp32c5 eco3 connected
|
||||
eco_default: Runner with default eco connected
|
||||
|
||||
@@ -30,4 +30,5 @@ ECO_MARKERS = [
|
||||
'esp32c2eco4',
|
||||
'esp32c3eco7',
|
||||
'esp32p4_eco4',
|
||||
'esp32c5_eco3',
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user