From c51f656ee71b14bb026d3f444a39d513c0506c82 Mon Sep 17 00:00:00 2001 From: gaoxu Date: Mon, 12 May 2025 15:30:13 +0800 Subject: [PATCH 1/3] feat(cam): esp_cam add pm lock function and test --- components/esp_driver_cam/CMakeLists.txt | 4 +++ .../esp_driver_cam/csi/src/esp_cam_ctlr_csi.c | 20 +++++++++++++ .../csi/src/esp_cam_ctlr_csi_internal.h | 9 +++++- .../private_include/esp_cam_ctlr_dvp_cam.h | 9 +++++- .../dvp/src/esp_cam_ctlr_dvp_cam.c | 23 +++++++++++++++ .../isp_dvp/src/esp_cam_ctlr_isp_dvp.c | 28 +++++++++++++++++++ .../test_apps/csi/main/test_csi_ov5647.c | 10 +++++-- .../test_apps/csi/pytest_csi.py | 2 +- .../test_apps/csi/sdkconfig.ci.pm_enable | 8 ++++++ 9 files changed, 107 insertions(+), 6 deletions(-) create mode 100644 components/esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable diff --git a/components/esp_driver_cam/CMakeLists.txt b/components/esp_driver_cam/CMakeLists.txt index e0a06e35866..cd6f3371dfc 100644 --- a/components/esp_driver_cam/CMakeLists.txt +++ b/components/esp_driver_cam/CMakeLists.txt @@ -34,3 +34,7 @@ idf_component_register(SRCS ${srcs} REQUIRES ${requires} PRIV_REQUIRES ${priv_requires} ) + +if(CONFIG_PM_ENABLE) + idf_component_optional_requires(PRIVATE esp_pm) +endif() diff --git a/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c b/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c index c05ca87decd..db05fcf03b1 100644 --- a/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c +++ b/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c @@ -212,6 +212,10 @@ esp_err_t esp_cam_new_csi_ctlr(const esp_cam_ctlr_csi_config_t *config, esp_cam_ }; ESP_GOTO_ON_ERROR(dw_gdma_channel_register_event_callbacks(csi_dma_chan, &csi_dma_cbs, ctlr), err, TAG, "failed to register dwgdma callback"); +#if CONFIG_PM_ENABLE + ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "cam_csi_ctlr", &ctlr->pm_lock), err, TAG, "failed to create pm lock"); +#endif //CONFIG_PM_ENABLE + ctlr->spinlock = (portMUX_TYPE)portMUX_INITIALIZER_UNLOCKED; ctlr->csi_fsm = CSI_FSM_INIT; ctlr->base.del = s_ctlr_del; @@ -241,6 +245,12 @@ esp_err_t s_del_csi_ctlr(csi_controller_t *ctlr) ESP_RETURN_ON_FALSE(ctlr, ESP_ERR_INVALID_ARG, TAG, "invalid argument: null pointer"); ESP_RETURN_ON_FALSE(ctlr->csi_fsm == CSI_FSM_INIT, ESP_ERR_INVALID_STATE, TAG, "processor isn't in init state"); +#if CONFIG_PM_ENABLE + if (ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_delete(ctlr->pm_lock), TAG, "delete pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE + if (ctlr->dma_chan) { ESP_RETURN_ON_ERROR(dw_gdma_del_channel(ctlr->dma_chan), TAG, "failed to delete dwgdma channel"); } @@ -408,6 +418,11 @@ esp_err_t s_csi_ctlr_enable(esp_cam_ctlr_handle_t handle) portENTER_CRITICAL(&ctlr->spinlock); ctlr->csi_fsm = CSI_FSM_ENABLED; +#if CONFIG_PM_ENABLE + if (ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_acquire(ctlr->pm_lock), TAG, "acquire pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE portEXIT_CRITICAL(&ctlr->spinlock); return ESP_OK; @@ -421,6 +436,11 @@ esp_err_t s_csi_ctlr_disable(esp_cam_ctlr_handle_t handle) portENTER_CRITICAL(&ctlr->spinlock); ctlr->csi_fsm = CSI_FSM_INIT; +#if CONFIG_PM_ENABLE + if (ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_release(ctlr->pm_lock), TAG, "release pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE portEXIT_CRITICAL(&ctlr->spinlock); return ESP_OK; diff --git a/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi_internal.h b/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi_internal.h index 0a8a7508d5f..0baf6d55960 100644 --- a/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi_internal.h +++ b/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi_internal.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -21,6 +21,10 @@ #include "soc/soc_caps.h" #include "esp_private/dw_gdma.h" +#if CONFIG_PM_ENABLE +#include "esp_pm.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -62,6 +66,9 @@ struct csi_controller_t { void *cbs_user_data; //callback userdata dw_gdma_channel_handle_t dma_chan; //dwgdma channel handle size_t csi_transfer_size; //csi transfer size for dwgdma +#if CONFIG_PM_ENABLE + esp_pm_lock_handle_t pm_lock; //Power management lock +#endif esp_cam_ctlr_t base; }; diff --git a/components/esp_driver_cam/dvp/private_include/esp_cam_ctlr_dvp_cam.h b/components/esp_driver_cam/dvp/private_include/esp_cam_ctlr_dvp_cam.h index 5c9b311ee1a..3bf5502d942 100644 --- a/components/esp_driver_cam/dvp/private_include/esp_cam_ctlr_dvp_cam.h +++ b/components/esp_driver_cam/dvp/private_include/esp_cam_ctlr_dvp_cam.h @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -12,6 +12,10 @@ #include "esp_cam_ctlr_dvp_dma.h" #include "esp_cam_ctlr_dvp.h" +#if CONFIG_PM_ENABLE +#include "esp_pm.h" +#endif + #ifdef __cplusplus extern "C" { #endif @@ -49,6 +53,9 @@ typedef struct esp_cam_ctlr_dvp_cam { uint8_t *backup_buffer; /*!< DVP CAM backup buffer */ bool bk_buffer_exposed; /*!< status of if back_buffer is exposed to users */ portMUX_TYPE spinlock; /*!< DVP CAM spinlock */ +#if CONFIG_PM_ENABLE + esp_pm_lock_handle_t pm_lock; /*!< Power management lock */ +#endif } esp_cam_ctlr_dvp_cam_t; #ifdef __cplusplus diff --git a/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c b/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c index b92404fae60..163ed9ca92c 100644 --- a/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c +++ b/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c @@ -481,6 +481,11 @@ static esp_err_t esp_cam_ctlr_dvp_cam_enable(esp_cam_ctlr_handle_t handle) ret = ESP_OK; } cam_hal_start_streaming(&ctlr->hal); +#if CONFIG_PM_ENABLE + if (ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_acquire(ctlr->pm_lock), TAG, "acquire pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE portEXIT_CRITICAL(&ctlr->spinlock); @@ -508,8 +513,16 @@ static esp_err_t esp_cam_ctlr_dvp_cam_disable(esp_cam_ctlr_handle_t handle) ctlr->dvp_fsm = ESP_CAM_CTLR_DVP_CAM_FSM_INIT; ret = ESP_OK; } +<<<<<<< HEAD cam_hal_stop_streaming(&ctlr->hal); +======= +#if CONFIG_PM_ENABLE + if (ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_release(ctlr->pm_lock), TAG, "release pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE +>>>>>>> 701e771d785 (feat(cam): esp_cam add pm lock function and test) portEXIT_CRITICAL(&ctlr->spinlock); return ret; @@ -607,6 +620,12 @@ static esp_err_t esp_cam_ctlr_dvp_cam_del(esp_cam_ctlr_handle_t handle) heap_caps_free(ctlr->backup_buffer); } +#if CONFIG_PM_ENABLE + if (ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_delete(ctlr->pm_lock), TAG, "delete pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE + s_dvp_declaim_ctlr(ctlr->ctlr_id); heap_caps_free(ctlr); @@ -852,6 +871,10 @@ esp_err_t esp_cam_new_dvp_ctlr(const esp_cam_ctlr_dvp_config_t *config, esp_cam_ ESP_GOTO_ON_ERROR(gdma_register_rx_event_callbacks(ctlr->dma.dma_chan, &cbs, ctlr), fail4, TAG, "failed to register DMA event callbacks"); +#if CONFIG_PM_ENABLE + ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "dvp_cam_ctlr", &ctlr->pm_lock), fail5, TAG, "failed to create pm lock"); +#endif //CONFIG_PM_ENABLE + /* Initialize DVP controller */ cam_hal_config_t cam_hal_config = { diff --git a/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c b/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c index 085a5695777..5f7f3401873 100644 --- a/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c +++ b/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c @@ -31,6 +31,10 @@ #include "esp_cam_ctlr_isp_dvp.h" #include "../../dvp_share_ctrl.h" +#if CONFIG_PM_ENABLE +#include "esp_pm.h" +#endif + #if CONFIG_CAM_CTLR_ISP_DVP_ISR_CACHE_SAFE #define ISP_DVP_MEM_ALLOC_CAPS (MALLOC_CAP_INTERNAL | MALLOC_CAP_8BIT) #else @@ -55,6 +59,9 @@ typedef struct isp_dvp_controller_t { dw_gdma_channel_handle_t dma_chan; //dwgdma channel handle size_t dvp_transfer_size; //csi transfer size for dwgdma bool isr_installed; //is isr installed +#if CONFIG_PM_ENABLE + esp_pm_lock_handle_t pm_lock; //Power management lock +#endif esp_cam_ctlr_t base; } isp_dvp_controller_t; @@ -182,6 +189,11 @@ esp_err_t esp_cam_new_isp_dvp_ctlr(isp_proc_handle_t isp_proc, const esp_cam_ctl mipi_csi_brg_ll_set_burst_len(isp_proc->csi_brg_hw, 512); esp_cam_ctlr_t *cam_ctlr = &(dvp_ctlr->base); + +#if CONFIG_PM_ENABLE + ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "isp_dvp_cam_ctlr", &dvp_ctlr->pm_lock), err, TAG, "failed to create pm lock"); +#endif //CONFIG_PM_ENABLE + cam_ctlr->del = s_isp_del_dvp_controller; cam_ctlr->enable = s_isp_dvp_enable; cam_ctlr->start = s_isp_dvp_start; @@ -225,6 +237,12 @@ esp_err_t s_isp_del_dvp_controller(esp_cam_ctlr_handle_t handle) if (dvp_ctlr->trans_que) { vQueueDeleteWithCaps(dvp_ctlr->trans_que); } +#if CONFIG_PM_ENABLE + if (dvp_ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_delete(dvp_ctlr->pm_lock), TAG, "delete pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE + free(dvp_ctlr); return ESP_OK; @@ -298,6 +316,11 @@ static esp_err_t s_isp_dvp_enable(esp_cam_ctlr_handle_t handle) portENTER_CRITICAL(&dvp_ctlr->spinlock); dvp_ctlr->fsm = ISP_FSM_ENABLE; +#if CONFIG_PM_ENABLE + if (dvp_ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_acquire(dvp_ctlr->pm_lock), TAG, "acquire pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE portEXIT_CRITICAL(&dvp_ctlr->spinlock); return ESP_OK; @@ -311,6 +334,11 @@ static esp_err_t s_isp_dvp_disable(esp_cam_ctlr_handle_t handle) portENTER_CRITICAL(&dvp_ctlr->spinlock); dvp_ctlr->fsm = ISP_FSM_INIT; +#if CONFIG_PM_ENABLE + if (dvp_ctlr->pm_lock) { + ESP_RETURN_ON_ERROR(esp_pm_lock_release(dvp_ctlr->pm_lock), TAG, "release pm_lock failed"); + } +#endif // CONFIG_PM_ENABLE portEXIT_CRITICAL(&dvp_ctlr->spinlock); return ESP_OK; diff --git a/components/esp_driver_cam/test_apps/csi/main/test_csi_ov5647.c b/components/esp_driver_cam/test_apps/csi/main/test_csi_ov5647.c index 19b62682c69..23ef8ce6fc1 100644 --- a/components/esp_driver_cam/test_apps/csi/main/test_csi_ov5647.c +++ b/components/esp_driver_cam/test_apps/csi/main/test_csi_ov5647.c @@ -51,6 +51,9 @@ static bool IRAM_ATTR camera_trans_finished(esp_cam_ctlr_handle_t handle, esp_ca TEST_CASE("TEST esp_cam on ov5647", "[csi][camera][ov5647]") { + new_buffer_count = 0; + trans_finished_count = 0; + size_t frame_buffer_size = TEST_MIPI_CSI_DISP_HRES * TEST_MIPI_DSI_DISP_VRES * TEST_RGB565_BITS_PER_PIXEL / 8; @@ -127,11 +130,12 @@ TEST_CASE("TEST esp_cam on ov5647", "[csi][camera][ov5647]") TEST_ESP_OK(esp_isp_enable(isp_proc)); TEST_ESP_OK(esp_cam_ctlr_start(cam_handle)); TEST_ESP_OK(esp_cam_ctlr_receive(cam_handle, &trans_data, ESP_CAM_CTLR_MAX_DELAY)); - vTaskDelay(100 / portTICK_PERIOD_MS); + vTaskDelay(1000 / portTICK_PERIOD_MS); TEST_ESP_OK(esp_cam_ctlr_stop(cam_handle)); - TEST_ASSERT_GREATER_THAN(2, new_buffer_count); - TEST_ASSERT_GREATER_THAN(2, trans_finished_count); + // At least 35 new buffers callback and 34 completed transfer callback are expected within 1 second when camera is 50fps. + TEST_ASSERT_GREATER_OR_EQUAL(35, new_buffer_count); + TEST_ASSERT_GREATER_OR_EQUAL(34, trans_finished_count); TEST_ESP_OK(esp_cam_ctlr_disable(cam_handle)); TEST_ESP_OK(esp_cam_ctlr_del(cam_handle)); diff --git a/components/esp_driver_cam/test_apps/csi/pytest_csi.py b/components/esp_driver_cam/test_apps/csi/pytest_csi.py index 51d788d67df..e01cf5d86c9 100644 --- a/components/esp_driver_cam/test_apps/csi/pytest_csi.py +++ b/components/esp_driver_cam/test_apps/csi/pytest_csi.py @@ -8,7 +8,7 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic @pytest.mark.parametrize( 'config', - ['cache_safe', 'release'], + ['cache_safe', 'release', 'pm_enable'], indirect=True, ) @idf_parametrize('target', ['esp32p4'], indirect=['target']) diff --git a/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable b/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable new file mode 100644 index 00000000000..918a1c0ef10 --- /dev/null +++ b/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable @@ -0,0 +1,8 @@ +# 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 + +CONFIG_PM_ENABLE=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y +CONFIG_PM_DFS_INIT_AUTO=y From 70f0964850087ee2be3e8c926a0e820e3a531751 Mon Sep 17 00:00:00 2001 From: gaoxu Date: Wed, 12 Nov 2025 16:25:58 +0800 Subject: [PATCH 2/3] feat(cam): esp_cam add pm lock function and test --- components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c | 2 +- components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c | 5 +---- components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c b/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c index db05fcf03b1..f84caa96031 100644 --- a/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c +++ b/components/esp_driver_cam/csi/src/esp_cam_ctlr_csi.c @@ -213,7 +213,7 @@ esp_err_t esp_cam_new_csi_ctlr(const esp_cam_ctlr_csi_config_t *config, esp_cam_ ESP_GOTO_ON_ERROR(dw_gdma_channel_register_event_callbacks(csi_dma_chan, &csi_dma_cbs, ctlr), err, TAG, "failed to register dwgdma callback"); #if CONFIG_PM_ENABLE - ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "cam_csi_ctlr", &ctlr->pm_lock), err, TAG, "failed to create pm lock"); + ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "cam_csi_ctlr", &ctlr->pm_lock), err, TAG, "failed to create pm lock"); #endif //CONFIG_PM_ENABLE ctlr->spinlock = (portMUX_TYPE)portMUX_INITIALIZER_UNLOCKED; diff --git a/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c b/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c index 163ed9ca92c..48cc0e6c4ae 100644 --- a/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c +++ b/components/esp_driver_cam/dvp/src/esp_cam_ctlr_dvp_cam.c @@ -513,16 +513,13 @@ static esp_err_t esp_cam_ctlr_dvp_cam_disable(esp_cam_ctlr_handle_t handle) ctlr->dvp_fsm = ESP_CAM_CTLR_DVP_CAM_FSM_INIT; ret = ESP_OK; } -<<<<<<< HEAD cam_hal_stop_streaming(&ctlr->hal); -======= #if CONFIG_PM_ENABLE if (ctlr->pm_lock) { ESP_RETURN_ON_ERROR(esp_pm_lock_release(ctlr->pm_lock), TAG, "release pm_lock failed"); } #endif // CONFIG_PM_ENABLE ->>>>>>> 701e771d785 (feat(cam): esp_cam add pm lock function and test) portEXIT_CRITICAL(&ctlr->spinlock); return ret; @@ -872,7 +869,7 @@ esp_err_t esp_cam_new_dvp_ctlr(const esp_cam_ctlr_dvp_config_t *config, esp_cam_ fail4, TAG, "failed to register DMA event callbacks"); #if CONFIG_PM_ENABLE - ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "dvp_cam_ctlr", &ctlr->pm_lock), fail5, TAG, "failed to create pm lock"); + ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "dvp_cam_ctlr", &ctlr->pm_lock), fail5, TAG, "failed to create pm lock"); #endif //CONFIG_PM_ENABLE /* Initialize DVP controller */ diff --git a/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c b/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c index 5f7f3401873..fd66bdb2f4a 100644 --- a/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c +++ b/components/esp_driver_cam/isp_dvp/src/esp_cam_ctlr_isp_dvp.c @@ -191,7 +191,7 @@ esp_err_t esp_cam_new_isp_dvp_ctlr(isp_proc_handle_t isp_proc, const esp_cam_ctl esp_cam_ctlr_t *cam_ctlr = &(dvp_ctlr->base); #if CONFIG_PM_ENABLE - ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_APB_FREQ_MAX, 0, "isp_dvp_cam_ctlr", &dvp_ctlr->pm_lock), err, TAG, "failed to create pm lock"); + ESP_GOTO_ON_ERROR(esp_pm_lock_create(ESP_PM_NO_LIGHT_SLEEP, 0, "isp_dvp_cam_ctlr", &dvp_ctlr->pm_lock), err, TAG, "failed to create pm lock"); #endif //CONFIG_PM_ENABLE cam_ctlr->del = s_isp_del_dvp_controller; From 22f56c69825ee3de25402b1a4d8713e96ccb2e5c Mon Sep 17 00:00:00 2001 From: gaoxu Date: Wed, 12 Nov 2025 16:28:56 +0800 Subject: [PATCH 3/3] ci(cam): test csi/dvp/isp_dvp and test iram_safe --- components/esp_driver_cam/test_apps/csi/pytest_csi.py | 2 +- .../esp_driver_cam/test_apps/csi/sdkconfig.ci.cache_safe | 8 ++++++++ .../esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable | 4 ---- .../esp_driver_cam/test_apps/csi/sdkconfig.ci.release | 4 ++++ components/esp_driver_cam/test_apps/dvp/pytest_dvp.py | 2 +- .../esp_driver_cam/test_apps/dvp/sdkconfig.ci.cache_safe | 2 ++ .../esp_driver_cam/test_apps/dvp/sdkconfig.ci.release | 7 +++++++ .../esp_driver_cam/test_apps/isp_dvp/pytest_isp_dvp.py | 5 +++++ .../test_apps/isp_dvp/sdkconfig.ci.cache_safe | 8 ++++++++ .../esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.release | 7 +++++++ 10 files changed, 43 insertions(+), 6 deletions(-) create mode 100644 components/esp_driver_cam/test_apps/dvp/sdkconfig.ci.release create mode 100644 components/esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.release diff --git a/components/esp_driver_cam/test_apps/csi/pytest_csi.py b/components/esp_driver_cam/test_apps/csi/pytest_csi.py index e01cf5d86c9..51d788d67df 100644 --- a/components/esp_driver_cam/test_apps/csi/pytest_csi.py +++ b/components/esp_driver_cam/test_apps/csi/pytest_csi.py @@ -8,7 +8,7 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic @pytest.mark.parametrize( 'config', - ['cache_safe', 'release', 'pm_enable'], + ['cache_safe', 'release'], indirect=True, ) @idf_parametrize('target', ['esp32p4'], indirect=['target']) diff --git a/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.cache_safe b/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.cache_safe index 6a7ded982f3..edd91f201cb 100644 --- a/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.cache_safe +++ b/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.cache_safe @@ -1 +1,9 @@ +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 + CONFIG_CAM_CTLR_MIPI_CSI_ISR_CACHE_SAFE=y +CONFIG_CAM_CTLR_ISP_DVP_ISR_CACHE_SAFE=y +CONFIG_CAM_CTLR_DVP_CAM_ISR_CACHE_SAFE=y diff --git a/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable b/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable index 918a1c0ef10..3d9291ddeda 100644 --- a/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable +++ b/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.pm_enable @@ -2,7 +2,3 @@ CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y CONFIG_HAL_ASSERTION_SILENT=y - -CONFIG_PM_ENABLE=y -CONFIG_FREERTOS_USE_TICKLESS_IDLE=y -CONFIG_PM_DFS_INIT_AUTO=y diff --git a/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.release b/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.release index 3cff15d49e2..1eb2b05fc20 100644 --- a/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.release +++ b/components/esp_driver_cam/test_apps/csi/sdkconfig.ci.release @@ -1,3 +1,7 @@ CONFIG_COMPILER_OPTIMIZATION_SIZE=y CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y + +CONFIG_PM_ENABLE=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y +CONFIG_PM_DFS_INIT_AUTO=y diff --git a/components/esp_driver_cam/test_apps/dvp/pytest_dvp.py b/components/esp_driver_cam/test_apps/dvp/pytest_dvp.py index 7e15807406a..69ad75977fc 100644 --- a/components/esp_driver_cam/test_apps/dvp/pytest_dvp.py +++ b/components/esp_driver_cam/test_apps/dvp/pytest_dvp.py @@ -8,7 +8,7 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic @pytest.mark.parametrize( 'config', - ['cache_safe'], + ['cache_safe', 'release'], indirect=True, ) @idf_parametrize('target', ['esp32p4'], indirect=['target']) diff --git a/components/esp_driver_cam/test_apps/dvp/sdkconfig.ci.cache_safe b/components/esp_driver_cam/test_apps/dvp/sdkconfig.ci.cache_safe index 97180e808b1..edd91f201cb 100644 --- a/components/esp_driver_cam/test_apps/dvp/sdkconfig.ci.cache_safe +++ b/components/esp_driver_cam/test_apps/dvp/sdkconfig.ci.cache_safe @@ -4,4 +4,6 @@ CONFIG_COMPILER_OPTIMIZATION_CHECKS_SILENT=y CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y CONFIG_HAL_ASSERTION_SILENT=y +CONFIG_CAM_CTLR_MIPI_CSI_ISR_CACHE_SAFE=y +CONFIG_CAM_CTLR_ISP_DVP_ISR_CACHE_SAFE=y CONFIG_CAM_CTLR_DVP_CAM_ISR_CACHE_SAFE=y diff --git a/components/esp_driver_cam/test_apps/dvp/sdkconfig.ci.release b/components/esp_driver_cam/test_apps/dvp/sdkconfig.ci.release new file mode 100644 index 00000000000..1eb2b05fc20 --- /dev/null +++ b/components/esp_driver_cam/test_apps/dvp/sdkconfig.ci.release @@ -0,0 +1,7 @@ +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y + +CONFIG_PM_ENABLE=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y +CONFIG_PM_DFS_INIT_AUTO=y diff --git a/components/esp_driver_cam/test_apps/isp_dvp/pytest_isp_dvp.py b/components/esp_driver_cam/test_apps/isp_dvp/pytest_isp_dvp.py index 211e25d4de3..1015e2502cc 100644 --- a/components/esp_driver_cam/test_apps/isp_dvp/pytest_isp_dvp.py +++ b/components/esp_driver_cam/test_apps/isp_dvp/pytest_isp_dvp.py @@ -6,6 +6,11 @@ from pytest_embedded_idf.utils import idf_parametrize @pytest.mark.generic +@pytest.mark.parametrize( + 'config', + ['cache_safe', 'release'], + indirect=True, +) @idf_parametrize('target', ['esp32p4'], indirect=['target']) def test_isp_dvp(dut: Dut) -> None: dut.run_all_single_board_cases() diff --git a/components/esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.cache_safe b/components/esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.cache_safe index 6a7ded982f3..edd91f201cb 100644 --- a/components/esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.cache_safe +++ b/components/esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.cache_safe @@ -1 +1,9 @@ +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 + CONFIG_CAM_CTLR_MIPI_CSI_ISR_CACHE_SAFE=y +CONFIG_CAM_CTLR_ISP_DVP_ISR_CACHE_SAFE=y +CONFIG_CAM_CTLR_DVP_CAM_ISR_CACHE_SAFE=y diff --git a/components/esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.release b/components/esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.release new file mode 100644 index 00000000000..1eb2b05fc20 --- /dev/null +++ b/components/esp_driver_cam/test_apps/isp_dvp/sdkconfig.ci.release @@ -0,0 +1,7 @@ +CONFIG_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_BOOTLOADER_COMPILER_OPTIMIZATION_SIZE=y +CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_SILENT=y + +CONFIG_PM_ENABLE=y +CONFIG_FREERTOS_USE_TICKLESS_IDLE=y +CONFIG_PM_DFS_INIT_AUTO=y