forked from espressif/esp-idf
Merge branch 'ci/test_i2s_with_psram_config' into 'master'
ci: test ana_cmpr, dac, i2s, touch with CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0 Closes IDF-13027, IDF-13028, IDF-13032, and IDF-13044 See merge request espressif/esp-idf!39005
This commit is contained in:
@@ -34,7 +34,14 @@ struct ana_cmpr_t {
|
|||||||
|
|
||||||
/* Helper macros */
|
/* Helper macros */
|
||||||
#define ANA_CMPR_NULL_POINTER_CHECK(p) ESP_RETURN_ON_FALSE((p), ESP_ERR_INVALID_ARG, TAG, "input parameter '" #p "' is NULL")
|
#define ANA_CMPR_NULL_POINTER_CHECK(p) ESP_RETURN_ON_FALSE((p), ESP_ERR_INVALID_ARG, TAG, "input parameter '" #p "' is NULL")
|
||||||
#define ANA_CMPR_NULL_POINTER_CHECK_ISR(p) ESP_RETURN_ON_FALSE_ISR((p), ESP_ERR_INVALID_ARG, TAG, "input parameter '" #p "' is NULL")
|
#define ANA_CMPR_NULL_POINTER_CHECK_SAFE(p) \
|
||||||
|
do { \
|
||||||
|
if (unlikely(!(p))) { \
|
||||||
|
ESP_EARLY_LOGE(TAG, "input parameter '" #p "' is NULL"); \
|
||||||
|
return ESP_ERR_INVALID_ARG; \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
#define ANA_CMPR_UNIT_CHECK(unit) ESP_RETURN_ON_FALSE((unit) >= 0 && (unit) < SOC_ANA_CMPR_NUM, ESP_ERR_INVALID_ARG, TAG, "invalid unit number")
|
#define ANA_CMPR_UNIT_CHECK(unit) ESP_RETURN_ON_FALSE((unit) >= 0 && (unit) < SOC_ANA_CMPR_NUM, ESP_ERR_INVALID_ARG, TAG, "invalid unit number")
|
||||||
|
|
||||||
/* Global static object of the Analog Comparator unit */
|
/* Global static object of the Analog Comparator unit */
|
||||||
@@ -194,10 +201,12 @@ esp_err_t ana_cmpr_del_unit(ana_cmpr_handle_t cmpr)
|
|||||||
|
|
||||||
esp_err_t ana_cmpr_set_internal_reference(ana_cmpr_handle_t cmpr, const ana_cmpr_internal_ref_config_t *ref_cfg)
|
esp_err_t ana_cmpr_set_internal_reference(ana_cmpr_handle_t cmpr, const ana_cmpr_internal_ref_config_t *ref_cfg)
|
||||||
{
|
{
|
||||||
ANA_CMPR_NULL_POINTER_CHECK_ISR(cmpr);
|
ANA_CMPR_NULL_POINTER_CHECK_SAFE(cmpr);
|
||||||
ANA_CMPR_NULL_POINTER_CHECK_ISR(ref_cfg);
|
ANA_CMPR_NULL_POINTER_CHECK_SAFE(ref_cfg);
|
||||||
ESP_RETURN_ON_FALSE_ISR(cmpr->ref_src == ANA_CMPR_REF_SRC_INTERNAL, ESP_ERR_INVALID_STATE,
|
if (unlikely(cmpr->ref_src != ANA_CMPR_REF_SRC_INTERNAL)) {
|
||||||
TAG, "the reference voltage does not come from internal");
|
ESP_EARLY_LOGE(TAG, "the reference voltage does not come from internal");
|
||||||
|
return ESP_ERR_INVALID_STATE;
|
||||||
|
}
|
||||||
|
|
||||||
// the underlying register may be accessed by different threads at the same time, so use spin lock to protect it
|
// the underlying register may be accessed by different threads at the same time, so use spin lock to protect it
|
||||||
portENTER_CRITICAL_SAFE(&s_spinlock);
|
portENTER_CRITICAL_SAFE(&s_spinlock);
|
||||||
@@ -209,8 +218,8 @@ esp_err_t ana_cmpr_set_internal_reference(ana_cmpr_handle_t cmpr, const ana_cmpr
|
|||||||
|
|
||||||
esp_err_t ana_cmpr_set_debounce(ana_cmpr_handle_t cmpr, const ana_cmpr_debounce_config_t *dbc_cfg)
|
esp_err_t ana_cmpr_set_debounce(ana_cmpr_handle_t cmpr, const ana_cmpr_debounce_config_t *dbc_cfg)
|
||||||
{
|
{
|
||||||
ANA_CMPR_NULL_POINTER_CHECK_ISR(cmpr);
|
ANA_CMPR_NULL_POINTER_CHECK_SAFE(cmpr);
|
||||||
ANA_CMPR_NULL_POINTER_CHECK_ISR(dbc_cfg);
|
ANA_CMPR_NULL_POINTER_CHECK_SAFE(dbc_cfg);
|
||||||
|
|
||||||
/* Transfer the time to clock cycles */
|
/* Transfer the time to clock cycles */
|
||||||
uint32_t wait_cycle = dbc_cfg->wait_us * (cmpr->src_clk_freq_hz / 1000000);
|
uint32_t wait_cycle = dbc_cfg->wait_us * (cmpr->src_clk_freq_hz / 1000000);
|
||||||
@@ -231,9 +240,11 @@ esp_err_t ana_cmpr_set_cross_type(ana_cmpr_handle_t cmpr, ana_cmpr_cross_type_t
|
|||||||
(void)cross_type;
|
(void)cross_type;
|
||||||
return ESP_ERR_NOT_SUPPORTED;
|
return ESP_ERR_NOT_SUPPORTED;
|
||||||
#else
|
#else
|
||||||
ANA_CMPR_NULL_POINTER_CHECK_ISR(cmpr);
|
ANA_CMPR_NULL_POINTER_CHECK_SAFE(cmpr);
|
||||||
ESP_RETURN_ON_FALSE_ISR(cross_type >= ANA_CMPR_CROSS_DISABLE && cross_type <= ANA_CMPR_CROSS_ANY,
|
if (unlikely(cross_type < ANA_CMPR_CROSS_DISABLE || cross_type > ANA_CMPR_CROSS_ANY)) {
|
||||||
ESP_ERR_INVALID_ARG, TAG, "invalid cross type");
|
ESP_EARLY_LOGE(TAG, "invalid cross type");
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
portENTER_CRITICAL_SAFE(&s_spinlock);
|
portENTER_CRITICAL_SAFE(&s_spinlock);
|
||||||
analog_cmpr_ll_set_intr_cross_type(cmpr->dev, cross_type);
|
analog_cmpr_ll_set_intr_cross_type(cmpr->dev, cross_type);
|
||||||
|
@@ -14,7 +14,7 @@ if(CONFIG_COMPILER_DUMP_RTL_FILES)
|
|||||||
--elf-file ${CMAKE_BINARY_DIR}/test_ana_cmpr.elf
|
--elf-file ${CMAKE_BINARY_DIR}/test_ana_cmpr.elf
|
||||||
find-refs
|
find-refs
|
||||||
--from-sections=.iram0.text
|
--from-sections=.iram0.text
|
||||||
--to-sections=.flash.text
|
--to-sections=.flash.text,.flash.rodata
|
||||||
--exit-code
|
--exit-code
|
||||||
DEPENDS ${elf}
|
DEPENDS ${elf}
|
||||||
)
|
)
|
||||||
|
@@ -13,5 +13,5 @@ endif()
|
|||||||
|
|
||||||
idf_component_register(SRCS ${srcs}
|
idf_component_register(SRCS ${srcs}
|
||||||
INCLUDE_DIRS "."
|
INCLUDE_DIRS "."
|
||||||
PRIV_REQUIRES unity esp_driver_gpio esp_driver_ana_cmpr esp_driver_gptimer esp_pm
|
PRIV_REQUIRES unity esp_driver_gpio esp_driver_ana_cmpr esp_driver_gptimer esp_pm esp_psram
|
||||||
WHOLE_ARCHIVE)
|
WHOLE_ARCHIVE)
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
CONFIG_COMPILER_DUMP_RTL_FILES=y
|
CONFIG_COMPILER_DUMP_RTL_FILES=y
|
||||||
CONFIG_ANA_CMPR_ISR_CACHE_SAFE=y
|
CONFIG_ANA_CMPR_ISR_CACHE_SAFE=y
|
||||||
CONFIG_ANA_CMPR_CTRL_FUNC_IN_IRAM=y
|
|
||||||
CONFIG_GPIO_CTRL_FUNC_IN_IRAM=y
|
CONFIG_GPIO_CTRL_FUNC_IN_IRAM=y
|
||||||
CONFIG_COMPILER_OPTIMIZATION_NONE=y
|
CONFIG_COMPILER_OPTIMIZATION_NONE=y
|
||||||
# place non-ISR FreeRTOS functions in Flash
|
# place non-ISR FreeRTOS functions in Flash
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
CONFIG_FREERTOS_HZ=1000
|
CONFIG_FREERTOS_HZ=1000
|
||||||
CONFIG_ESP_TASK_WDT=n
|
CONFIG_ESP_TASK_WDT_EN=n
|
||||||
|
@@ -0,0 +1,3 @@
|
|||||||
|
CONFIG_SPIRAM=y
|
||||||
|
CONFIG_SPIRAM_MODE_HEX=y
|
||||||
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
@@ -1,4 +1,4 @@
|
|||||||
CONFIG_FREERTOS_HZ=1000
|
CONFIG_FREERTOS_HZ=1000
|
||||||
CONFIG_ESP_TASK_WDT=n
|
CONFIG_ESP_TASK_WDT_EN=n
|
||||||
# Disable this config, otherwise DAC will be disabled when ADC initialized
|
# Disable this config, otherwise DAC will be disabled when ADC initialized
|
||||||
CONFIG_ADC_DISABLE_DAC_OUTPUT=n
|
CONFIG_ADC_DISABLE_DAC_OUTPUT=n
|
||||||
|
@@ -8,5 +8,6 @@ if(CONFIG_SOC_I2S_SUPPORTS_ETM AND CONFIG_SOC_GPIO_SUPPORT_ETM)
|
|||||||
endif()
|
endif()
|
||||||
|
|
||||||
idf_component_register(SRCS ${srcs}
|
idf_component_register(SRCS ${srcs}
|
||||||
PRIV_REQUIRES unity esp_driver_pcnt spi_flash esp_driver_gpio esp_driver_i2s esp_driver_uart
|
PRIV_REQUIRES unity esp_driver_pcnt spi_flash
|
||||||
|
esp_driver_gpio esp_driver_i2s esp_driver_uart esp_psram
|
||||||
WHOLE_ARCHIVE)
|
WHOLE_ARCHIVE)
|
||||||
|
@@ -16,8 +16,26 @@ from pytest_embedded_idf.utils import idf_parametrize
|
|||||||
)
|
)
|
||||||
@idf_parametrize(
|
@idf_parametrize(
|
||||||
'target',
|
'target',
|
||||||
['esp32', 'esp32s2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32s3', 'esp32h2', 'esp32p4', 'esp32c61'],
|
['esp32', 'esp32s2', 'esp32c3', 'esp32c5', 'esp32c6', 'esp32h2', 'esp32p4', 'esp32c61'],
|
||||||
indirect=['target'],
|
indirect=['target'],
|
||||||
)
|
)
|
||||||
def test_i2s(dut: Dut) -> None:
|
def test_i2s(dut: Dut) -> None:
|
||||||
dut.run_all_single_board_cases()
|
dut.run_all_single_board_cases()
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.octal_psram
|
||||||
|
@pytest.mark.parametrize(
|
||||||
|
'config',
|
||||||
|
[
|
||||||
|
'iram_safe',
|
||||||
|
'release',
|
||||||
|
],
|
||||||
|
indirect=True,
|
||||||
|
)
|
||||||
|
@idf_parametrize(
|
||||||
|
'target',
|
||||||
|
['esp32s3'],
|
||||||
|
indirect=['target'],
|
||||||
|
)
|
||||||
|
def test_i2s_psram(dut: Dut) -> None:
|
||||||
|
dut.run_all_single_board_cases()
|
||||||
|
@@ -0,0 +1,3 @@
|
|||||||
|
CONFIG_SPIRAM=y
|
||||||
|
CONFIG_SPIRAM_MODE_HEX=y
|
||||||
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
@@ -0,0 +1,4 @@
|
|||||||
|
CONFIG_SPIRAM=y
|
||||||
|
CONFIG_SPIRAM_MODE_OCT=y
|
||||||
|
CONFIG_SPIRAM_SPEED_80M=y
|
||||||
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
@@ -2,5 +2,5 @@ set(srcs "test_app_main.c" "test_touch_sens_common.c")
|
|||||||
|
|
||||||
idf_component_register(SRCS ${srcs}
|
idf_component_register(SRCS ${srcs}
|
||||||
INCLUDE_DIRS "."
|
INCLUDE_DIRS "."
|
||||||
PRIV_REQUIRES unity esp_driver_touch_sens
|
PRIV_REQUIRES unity esp_driver_touch_sens esp_psram
|
||||||
WHOLE_ARCHIVE)
|
WHOLE_ARCHIVE)
|
||||||
|
@@ -1,2 +1,3 @@
|
|||||||
CONFIG_FREERTOS_HZ=1000
|
CONFIG_FREERTOS_HZ=1000
|
||||||
CONFIG_ESP_TASK_WDT_INIT=n
|
CONFIG_ESP_TASK_WDT_INIT=n
|
||||||
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
||||||
|
@@ -0,0 +1,3 @@
|
|||||||
|
CONFIG_SPIRAM=y
|
||||||
|
CONFIG_SPIRAM_MODE_HEX=y
|
||||||
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
@@ -0,0 +1,2 @@
|
|||||||
|
CONFIG_SPIRAM=y
|
||||||
|
CONFIG_SPIRAM_MALLOC_ALWAYSINTERNAL=0
|
Reference in New Issue
Block a user