Skip to content

Commit

Permalink
Merge branch 'feature/backport_c2_adc_runner_v5.0' into 'release/v5.0'
Browse files Browse the repository at this point in the history
esp_adc: added esp32c2 adc runners (v5.0)

See merge request espressif/esp-idf!20706
  • Loading branch information
suda-morris committed Oct 21, 2022
2 parents 903cb5e + 46d3627 commit 94d9c52
Show file tree
Hide file tree
Showing 5 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
@pytest.mark.esp32s2
@pytest.mark.esp32s3
@pytest.mark.esp32c3
@pytest.mark.esp32c2
@pytest.mark.adc
@pytest.mark.parametrize(
'config',
Expand All @@ -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)
Original file line number Diff line number Diff line change
@@ -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
18 changes: 17 additions & 1 deletion components/esp_adc/test_apps/adc/pytest_adc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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)
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 94d9c52

Please sign in to comment.