Skip to content

Commit 957438b

Browse files
committed
Merge branch 'fix/fix_dvp_cam_detect_err_in_web' into 'master'
fix: fix dvp cam detect err when using xclk from soc See merge request espressif/esp-video-components!316
2 parents d0be7c2 + 481bdb1 commit 957438b

File tree

9 files changed

+16
-4
lines changed

9 files changed

+16
-4
lines changed

esp_cam_sensor/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,15 @@
55
- Added line exposure time info in camera drivers.
66
- Added OS02N10 MIPI camera sensor driver.
77
- Added exposure value to "esp_cam_sensor_gh_exp_gain_t" to let the application set the exposure value instead of the exposure time
8+
- Added detect delay in DVP camera sensors driver.
89

910
## 1.3.0
1011
- Changed YUV422 sequence for SC030IOT, SC101IOT, GC0308, and BF3A03 sensors to depend on CONFIG_CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER
1112
- Changed YUV422 sequence for SC030IOT, SC101IOT, GC0308, and BF3A03 sensors to depend on CONFIG_CAMERA_SENSOR_SWAP_PIXEL_BYTE_ORDER.
1213
- Fixed OV2640 JPEG compression quality calculation issue.
1314
- Fixed incorrect format selection in OV2640 Kconfig.
1415
- Removed the GROUP Hold function in the SC2336 driver.
15-
- Modified GPIO pin type from int8_t to gpio_num_t.
16+
- Modified GPIO pin type from int8_t to gpio_num_t
1617

1718
## 1.2.1
1819
- Deprecated ledc intr type config

esp_cam_sensor/sensors/bf3a03/bf3a03.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -513,6 +513,7 @@ static esp_err_t bf3a03_power_on(esp_cam_sensor_device_t *dev)
513513

514514
if (dev->xclk_pin >= 0) {
515515
BF3A03_ENABLE_OUT_XCLK(dev->xclk_pin, dev->xclk_freq_hz);
516+
delay_ms(6);
516517
}
517518

518519
if (dev->pwdn_pin >= 0) {

esp_cam_sensor/sensors/gc2145/gc2145.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -833,6 +833,7 @@ static esp_err_t gc2145_power_on(esp_cam_sensor_device_t *dev)
833833

834834
if (dev->xclk_pin >= 0) {
835835
GC2145_ENABLE_OUT_XCLK(dev->xclk_pin, dev->xclk_freq_hz);
836+
delay_ms(5);
836837
}
837838

838839
if (dev->pwdn_pin >= 0) {

esp_cam_sensor/sensors/ov2640/ov2640.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ static esp_err_t ov2640_get_sensor_id(esp_cam_sensor_device_t *dev, esp_cam_sens
327327
{
328328
esp_err_t ret = ESP_FAIL;
329329
uint8_t pid = 0;
330+
330331
if (ov2640_set_bank(dev->sccb_handle, BANK_SENSOR) == ESP_OK) {
331332
ov2640_read_reg(dev->sccb_handle, BANK_SENSOR, REG_PID, &pid);
332333
}
@@ -787,6 +788,7 @@ static esp_err_t ov2640_power_on(esp_cam_sensor_device_t *dev)
787788

788789
if (dev->xclk_pin >= 0) {
789790
OV2640_ENABLE_OUT_CLOCK(dev->xclk_pin, dev->xclk_freq_hz);
791+
delay_ms(5);
790792
}
791793

792794
if (dev->pwdn_pin >= 0) {

esp_cam_sensor/sensors/sc030iot/sc030iot.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,7 @@ static esp_err_t sc030iot_power_on(esp_cam_sensor_device_t *dev)
442442

443443
if (dev->xclk_pin >= 0) {
444444
SC030IOT_ENABLE_OUT_XCLK(dev->xclk_pin, dev->xclk_freq_hz);
445+
delay_ms(6);
445446
}
446447

447448
if (dev->pwdn_pin >= 0) {

esp_cam_sensor/sensors/sc101iot/sc101iot.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
@@ -349,7 +349,9 @@ static esp_err_t sc101iot_power_on(esp_cam_sensor_device_t *dev)
349349
esp_err_t ret = ESP_OK;
350350

351351
if (dev->xclk_pin >= 0) {
352+
ESP_LOGW(TAG, "In delay");
352353
SC101IOT_ENABLE_OUT_XCLK(dev->xclk_pin, dev->xclk_freq_hz);
354+
delay_ms(5);
353355
}
354356

355357
if (dev->pwdn_pin >= 0) {

esp_video/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
- Fix sdkconfig.default.esp32s3 for better image bandwidth
1818
- Modify GPIO pin type from int8_t to gpio_num_t
1919
- Compatible with ESP-IDF v5.4.x(x ≥ 3), v5.5.1, and the later versions of the ESP-IDF DVP CAM driver
20+
- Initialize the video device first in the web example to avoid sensor detection failure.
2021

2122
## 1.1.0
2223

esp_video/examples/common_components/example_video_common/Kconfig.projbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ menu "Example Video Initialization Configuration"
266266

267267
config EXAMPLE_DVP_XCLK_FREQ
268268
int "XCLK Frequency (Hz)"
269+
default 10000000 if IDF_TARGET_ESP32S3
269270
default 20000000
270271
help
271272
Master clock frequency for DVP camera sensor.

esp_video/examples/simple_video_server/main/simple_video_server_example.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -782,6 +782,10 @@ void app_main(void)
782782
ESP_ERROR_CHECK(nvs_flash_init());
783783
}
784784

785+
/*For camera devices that require the host to provide XCLK, the video_init() must be called immediately after the device is restarted,
786+
otherwise the camera device may not be able to start due to the lack of the main clock.*/
787+
ESP_ERROR_CHECK(example_video_init());
788+
785789
ESP_ERROR_CHECK(esp_netif_init());
786790
ESP_ERROR_CHECK(esp_event_loop_create_default());
787791

@@ -795,8 +799,6 @@ void app_main(void)
795799
*/
796800
ESP_ERROR_CHECK(example_connect());
797801

798-
ESP_ERROR_CHECK(example_video_init());
799-
800802
web_cam_video_config_t config[] = {
801803
#if EXAMPLE_ENABLE_MIPI_CSI_CAM_SENSOR
802804
{

0 commit comments

Comments
 (0)