From 80db6f440c30d0237d982fbcf3f01d7388a113a9 Mon Sep 17 00:00:00 2001 From: armando Date: Fri, 1 Aug 2025 12:11:25 +0800 Subject: [PATCH] ci(psram): enable xip psram test on h4 --- .../esp_psram/test_apps/.build-test-rules.yml | 10 +++++ .../esp_psram/test_apps/psram/pytest_psram.py | 31 ++++++++----- ...esp32c5_advanced => sdkconfig.ci.advanced} | 2 - ...advanced => sdkconfig.ci.esp32h4_advanced} | 7 +-- ...5_release => sdkconfig.ci.esp32h4_release} | 2 +- .../psram/sdkconfig.ci.esp32s31_250m_release | 8 ++++ .../test_apps/psram/sdkconfig.ci.esp32s31_xip | 13 ++++++ ....esp32c61_release => sdkconfig.ci.release} | 2 - .../xip_from_psram/pytest_xip_from_psram.py | 45 ++++++++++--------- .../xip_from_psram/sdkconfig.ci.esp32p4_200m | 1 - .../xip_from_psram/sdkconfig.ci.esp32s31_250m | 2 + 11 files changed, 79 insertions(+), 44 deletions(-) rename components/esp_psram/test_apps/psram/{sdkconfig.ci.esp32c5_advanced => sdkconfig.ci.advanced} (94%) rename components/esp_psram/test_apps/psram/{sdkconfig.ci.esp32c61_advanced => sdkconfig.ci.esp32h4_advanced} (72%) rename components/esp_psram/test_apps/psram/{sdkconfig.ci.esp32c5_release => sdkconfig.ci.esp32h4_release} (84%) create mode 100644 components/esp_psram/test_apps/psram/sdkconfig.ci.esp32s31_250m_release create mode 100644 components/esp_psram/test_apps/psram/sdkconfig.ci.esp32s31_xip rename components/esp_psram/test_apps/psram/{sdkconfig.ci.esp32c61_release => sdkconfig.ci.release} (83%) create mode 100644 examples/system/xip_from_psram/sdkconfig.ci.esp32s31_250m diff --git a/components/esp_psram/test_apps/.build-test-rules.yml b/components/esp_psram/test_apps/.build-test-rules.yml index 95c983baabf..ab3cc773aef 100644 --- a/components/esp_psram/test_apps/.build-test-rules.yml +++ b/components/esp_psram/test_apps/.build-test-rules.yml @@ -4,6 +4,16 @@ components/esp_psram/test_apps/psram: disable: - if: SOC_SPIRAM_SUPPORTED != 1 - if: CONFIG_NAME == "xip_psram_no_boot_init" and SOC_SPIRAM_XIP_SUPPORTED != 1 + - if: CONFIG_NAME == "release" SOC_SPIRAM_XIP_SUPPORTED != 1 + - if: IDF_TARGET in ["esp32", "esp32s2", "esp32s3", "esp32p4", "esp32h4", "esp32s31"] and CONFIG_NAME in ["release", "advanced"] + temporary: false + reason: + - esp32 doesn't have xip_psram + - esp32s2 doesn't have 120M + - esp32s3 needs to specify line mode + - esp32p4/s31 needs higher than 200/250M test + - esp32h4 needs 48/64M test + depends_components: - *common_components - esp_psram diff --git a/components/esp_psram/test_apps/psram/pytest_psram.py b/components/esp_psram/test_apps/psram/pytest_psram.py index 124446d4bae..8b2d0003bfb 100644 --- a/components/esp_psram/test_apps/psram/pytest_psram.py +++ b/components/esp_psram/test_apps/psram/pytest_psram.py @@ -90,14 +90,11 @@ def test_psram_esp32p4(dut: Dut) -> None: @pytest.mark.generic @pytest.mark.parametrize( 'config', - [ - 'esp32c5_release', - 'esp32c5_advanced', - ], + ['esp32s31_250m_release', 'esp32s31_xip'], indirect=True, ) -@idf_parametrize('target', ['esp32c5'], indirect=['target']) -def test_psram_esp32c5(dut: Dut) -> None: +@idf_parametrize('target', ['esp32s31'], indirect=['target']) +def test_psram_esp32s31(dut: Dut) -> None: dut.run_all_single_board_cases() @@ -105,13 +102,27 @@ def test_psram_esp32c5(dut: Dut) -> None: @pytest.mark.parametrize( 'config', [ - 'esp32c61_release', - 'esp32c61_advanced', + 'esp32h4_release', + 'esp32h4_advanced', ], indirect=True, ) -@idf_parametrize('target', ['esp32c61'], indirect=['target']) -def test_psram_esp32c61(dut: Dut) -> None: +@idf_parametrize('target', ['esp32h4'], indirect=['target']) +def test_psram_esp32h4(dut: Dut) -> None: + dut.run_all_single_board_cases() + + +@pytest.mark.generic +@pytest.mark.parametrize( + 'config', + [ + 'release', + 'advanced', + ], + indirect=True, +) +@idf_parametrize('target', ['esp32c5', 'esp32c61'], indirect=['target']) +def test_psram_general(dut: Dut) -> None: dut.run_all_single_board_cases() diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_advanced b/components/esp_psram/test_apps/psram/sdkconfig.ci.advanced similarity index 94% rename from components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_advanced rename to components/esp_psram/test_apps/psram/sdkconfig.ci.advanced index c679eec187d..d53279be687 100644 --- a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_advanced +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.advanced @@ -1,5 +1,3 @@ -CONFIG_IDF_TARGET="esp32c5" - CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_advanced b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32h4_advanced similarity index 72% rename from components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_advanced rename to components/esp_psram/test_apps/psram/sdkconfig.ci.esp32h4_advanced index 7d386150c12..1bc207274c7 100644 --- a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_advanced +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32h4_advanced @@ -1,14 +1,9 @@ -CONFIG_IDF_TARGET="esp32c61" - +CONFIG_IDF_TARGET="esp32h4" CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y -# Flash frequency has to be 120M if SPIRAM speed is set to 120MHz -CONFIG_ESPTOOLPY_FLASHFREQ_120M=y - CONFIG_SPIRAM=y -CONFIG_SPIRAM_SPEED_120M=y CONFIG_SPIRAM_XIP_FROM_PSRAM=y CONFIG_SPIRAM_ALLOW_BSS_SEG_EXTERNAL_MEMORY=y CONFIG_SPIRAM_ALLOW_NOINIT_SEG_EXTERNAL_MEMORY=y diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_release b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32h4_release similarity index 84% rename from components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_release rename to components/esp_psram/test_apps/psram/sdkconfig.ci.esp32h4_release index f2d1d3af6e8..379aed1029f 100644 --- a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c5_release +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32h4_release @@ -1,4 +1,4 @@ -CONFIG_IDF_TARGET="esp32c5" +CONFIG_IDF_TARGET="esp32h4" CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32s31_250m_release b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32s31_250m_release new file mode 100644 index 00000000000..9464e04d958 --- /dev/null +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32s31_250m_release @@ -0,0 +1,8 @@ +CONFIG_IDF_TARGET="esp32s31" + +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y + +CONFIG_SPIRAM=y +CONFIG_SPIRAM_SPEED_250M=y diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32s31_xip b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32s31_xip new file mode 100644 index 00000000000..a56e68c637b --- /dev/null +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32s31_xip @@ -0,0 +1,13 @@ +CONFIG_IDF_TARGET="esp32s31" + +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y + +CONFIG_SPIRAM=y +CONFIG_SPIRAM_SPEED_250M=y +CONFIG_SPIRAM_XIP_FROM_PSRAM=y + +CONFIG_PARTITION_TABLE_CUSTOM=y +CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv" +CONFIG_PARTITION_TABLE_FILENAME="partitions.csv" diff --git a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_release b/components/esp_psram/test_apps/psram/sdkconfig.ci.release similarity index 83% rename from components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_release rename to components/esp_psram/test_apps/psram/sdkconfig.ci.release index cf3f51fad5c..36ed5eb72ea 100644 --- a/components/esp_psram/test_apps/psram/sdkconfig.ci.esp32c61_release +++ b/components/esp_psram/test_apps/psram/sdkconfig.ci.release @@ -1,5 +1,3 @@ -CONFIG_IDF_TARGET="esp32c61" - CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y diff --git a/examples/system/xip_from_psram/pytest_xip_from_psram.py b/examples/system/xip_from_psram/pytest_xip_from_psram.py index e673db4af01..81cd35452a8 100644 --- a/examples/system/xip_from_psram/pytest_xip_from_psram.py +++ b/examples/system/xip_from_psram/pytest_xip_from_psram.py @@ -3,6 +3,7 @@ import pytest from pytest_embedded.dut import Dut from pytest_embedded_idf.utils import idf_parametrize +from pytest_embedded_idf.utils import soc_filtered_targets @pytest.mark.generic @@ -14,7 +15,7 @@ from pytest_embedded_idf.utils import idf_parametrize ], indirect=True, ) -@idf_parametrize('target', ['esp32s2', 'esp32s3', 'esp32p4', 'esp32c5', 'esp32c61'], indirect=['target']) +@idf_parametrize('target', soc_filtered_targets('SOC_SPIRAM_XIP_SUPPORTED == 1'), indirect=['target']) def test_xip_from_psram_example_generic(dut: Dut) -> None: dut.expect_exact('found partition') @@ -27,27 +28,6 @@ def test_xip_from_psram_example_generic(dut: Dut) -> None: assert float(response_time) <= 12 -@pytest.mark.generic -@pytest.mark.parametrize( - 'config', - [ - 'generic', - ], - indirect=True, -) -@idf_parametrize('target', ['esp32s31'], indirect=['target']) -def test_xip_from_psram_example_s31(dut: Dut) -> None: - dut.expect_exact('found partition') - - res = dut.expect(r'callback\(in PSRAM\) response time: (\d{1,3}) us') - response_time = res.group(1).decode('utf8') - assert float(response_time) <= 5 - - res = dut.expect(r'callback\(in IRAM\) response time: (\d{1,3}) us') - response_time = res.group(1).decode('utf8') - assert float(response_time) <= 5 - - @pytest.mark.MSPI_F4R8 @pytest.mark.parametrize( 'config', @@ -88,3 +68,24 @@ def test_xip_from_psram_example_p4_200m(dut: Dut) -> None: res = dut.expect(r'callback\(in IRAM\) response time: (\d{1,3}) us') response_time = res.group(1).decode('utf8') assert float(response_time) <= 10 + + +@pytest.mark.generic +@pytest.mark.parametrize( + 'config', + [ + 'esp32s31_250m', + ], + indirect=True, +) +@idf_parametrize('target', ['esp32s31'], indirect=['target']) +def test_xip_from_psram_example_s31(dut: Dut) -> None: + dut.expect_exact('found partition') + + res = dut.expect(r'callback\(in PSRAM\) response time: (\d{1,3}) us') + response_time = res.group(1).decode('utf8') + assert float(response_time) <= 5 + + res = dut.expect(r'callback\(in IRAM\) response time: (\d{1,3}) us') + response_time = res.group(1).decode('utf8') + assert float(response_time) <= 5 diff --git a/examples/system/xip_from_psram/sdkconfig.ci.esp32p4_200m b/examples/system/xip_from_psram/sdkconfig.ci.esp32p4_200m index 1a978368629..f804553c4f9 100644 --- a/examples/system/xip_from_psram/sdkconfig.ci.esp32p4_200m +++ b/examples/system/xip_from_psram/sdkconfig.ci.esp32p4_200m @@ -1,3 +1,2 @@ CONFIG_IDF_TARGET="esp32p4" -CONFIG_IDF_EXPERIMENTAL_FEATURES=y CONFIG_SPIRAM_SPEED_200M=y diff --git a/examples/system/xip_from_psram/sdkconfig.ci.esp32s31_250m b/examples/system/xip_from_psram/sdkconfig.ci.esp32s31_250m new file mode 100644 index 00000000000..bc65dad3f74 --- /dev/null +++ b/examples/system/xip_from_psram/sdkconfig.ci.esp32s31_250m @@ -0,0 +1,2 @@ +CONFIG_IDF_TARGET="esp32s31" +CONFIG_SPIRAM_SPEED_250M=y