From 46d3627e66a5a4a8eb9fbbae235f2814dfc45119 Mon Sep 17 00:00:00 2001 From: Armando Date: Mon, 17 Oct 2022 11:09:56 +0800 Subject: [PATCH] esp_adc: added esp32c2 adc runners --- .../legacy_adc_driver/pytest_legacy_adc.py | 17 ++++++++++++++++- .../sdkconfig.ci.esp32c2_xtal26m_release | 8 ++++++++ components/esp_adc/test_apps/adc/pytest_adc.py | 18 +++++++++++++++++- .../adc/sdkconfig.ci.esp32c2_xtal26m_iram_safe | 13 +++++++++++++ .../adc/sdkconfig.ci.esp32c2_xtal26m_release | 6 ++++++ 5 files changed, 60 insertions(+), 2 deletions(-) create mode 100644 components/driver/test_apps/legacy_adc_driver/sdkconfig.ci.esp32c2_xtal26m_release create mode 100644 components/esp_adc/test_apps/adc/sdkconfig.ci.esp32c2_xtal26m_iram_safe create mode 100644 components/esp_adc/test_apps/adc/sdkconfig.ci.esp32c2_xtal26m_release diff --git a/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py b/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py index 881f8e0f6bd2..667555b36d63 100644 --- a/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py +++ b/components/driver/test_apps/legacy_adc_driver/pytest_legacy_adc.py @@ -9,7 +9,6 @@ @pytest.mark.esp32s2 @pytest.mark.esp32s3 @pytest.mark.esp32c3 -@pytest.mark.esp32c2 @pytest.mark.adc @pytest.mark.parametrize( 'config', @@ -22,3 +21,19 @@ def test_legacy_adc(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('*') dut.expect_unity_test_output(timeout=240) + + +# All ESP32C2 ADC runners are 26m xtal +@pytest.mark.esp32c2 +@pytest.mark.adc +@pytest.mark.parametrize( + 'config, baud', + [ + ('esp32c2_xtal26m_release', '74880'), + ], + indirect=True, +) +def test_legacy_adc_esp32c2_xtal_26mhz(dut: Dut) -> None: + dut.expect_exact('Press ENTER to see the list of tests') + dut.write('*') + dut.expect_unity_test_output(timeout=240) diff --git a/components/driver/test_apps/legacy_adc_driver/sdkconfig.ci.esp32c2_xtal26m_release b/components/driver/test_apps/legacy_adc_driver/sdkconfig.ci.esp32c2_xtal26m_release new file mode 100644 index 000000000000..493256fa2fe7 --- /dev/null +++ b/components/driver/test_apps/legacy_adc_driver/sdkconfig.ci.esp32c2_xtal26m_release @@ -0,0 +1,8 @@ +CONFIG_IDF_TARGET="esp32c2" +CONFIG_XTAL_FREQ_26=y + +CONFIG_PM_ENABLE=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y diff --git a/components/esp_adc/test_apps/adc/pytest_adc.py b/components/esp_adc/test_apps/adc/pytest_adc.py index bf7d2fb0939c..abc701f9e7a9 100644 --- a/components/esp_adc/test_apps/adc/pytest_adc.py +++ b/components/esp_adc/test_apps/adc/pytest_adc.py @@ -9,7 +9,6 @@ @pytest.mark.esp32s2 @pytest.mark.esp32s3 @pytest.mark.esp32c3 -@pytest.mark.esp32c2 @pytest.mark.adc @pytest.mark.parametrize('config', [ 'iram_safe', @@ -19,3 +18,20 @@ def test_adc(dut: Dut) -> None: dut.expect_exact('Press ENTER to see the list of tests') dut.write('*') dut.expect_unity_test_output(timeout=120) + + +# All ESP32C2 ADC runners are 26m xtal +@pytest.mark.esp32c2 +@pytest.mark.adc +@pytest.mark.parametrize( + 'config, baud', + [ + ('esp32c2_xtal26m_iram_safe', '74880'), + ('esp32c2_xtal26m_release', '74880'), + ], + indirect=True, +) +def test_adc_esp32c2_xtal_26mhz(dut: Dut) -> None: + dut.expect_exact('Press ENTER to see the list of tests') + dut.write('*') + dut.expect_unity_test_output(timeout=120) diff --git a/components/esp_adc/test_apps/adc/sdkconfig.ci.esp32c2_xtal26m_iram_safe b/components/esp_adc/test_apps/adc/sdkconfig.ci.esp32c2_xtal26m_iram_safe new file mode 100644 index 000000000000..f04805811dc0 --- /dev/null +++ b/components/esp_adc/test_apps/adc/sdkconfig.ci.esp32c2_xtal26m_iram_safe @@ -0,0 +1,13 @@ +CONFIG_IDF_TARGET="esp32c2" +CONFIG_XTAL_FREQ_26=y + +CONFIG_COMPILER_DUMP_RTL_FILES=y +CONFIG_ADC_ONESHOT_CTRL_FUNC_IN_IRAM=y +CONFIG_GPTIMER_ISR_IRAM_SAFE=y +CONFIG_GPTIMER_CTRL_FUNC_IN_IRAM=y +CONFIG_ADC_CONTINUOUS_ISR_IRAM_SAFE=y +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +# silent the error check, as the error string are stored in rodata, causing RTL check failure +CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y +CONFIG_HAL_ASSERTION_SILENT=y diff --git a/components/esp_adc/test_apps/adc/sdkconfig.ci.esp32c2_xtal26m_release b/components/esp_adc/test_apps/adc/sdkconfig.ci.esp32c2_xtal26m_release new file mode 100644 index 000000000000..42038ac69e21 --- /dev/null +++ b/components/esp_adc/test_apps/adc/sdkconfig.ci.esp32c2_xtal26m_release @@ -0,0 +1,6 @@ +CONFIG_IDF_TARGET="esp32c2" +CONFIG_XTAL_FREQ_26=y + +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y