-
Notifications
You must be signed in to change notification settings - Fork 7.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ESP32S3 LCD 和 Camera同时使用出现冲突 (IDFGH-11787) #12882
Comments
@liruya which esp32_camera version are you using? Can you share your initialization code for the LCD and the Camera? I test the esp-idf/5.1.2 + esp32_camera v2.0.6 and didn't see this error. |
esp32-camera版本2.0.6, 单独使用Camera没有问题, 问题出在Camera和LCD i80接口/RGB接口同时使用时. |
|
/*
* SPDX-FileCopyrightText: 2010-2022 Espressif Systems (Shanghai) CO LTD
*
* SPDX-License-Identifier: CC0-1.0
*/
#include <stdio.h>
#include <inttypes.h>
#include "sdkconfig.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_log.h"
#include "esp_camera.h"
#include "esp_lcd_panel_io.h"
#define TAG "example"
void lcd_disp_init(void)
{
ESP_LOGI(TAG, "Initialize Intel 8080 bus");
esp_lcd_i80_bus_handle_t i80_bus = NULL;
esp_lcd_i80_bus_config_t bus_config = {
.clk_src = LCD_CLK_SRC_PLL240M,
.dc_gpio_num = 0,
.wr_gpio_num = 0,
.data_gpio_nums = {
0, 0, 0, 0, 0, 0, 0, 0
},
.bus_width = 8,
.max_transfer_bytes = 200 * 100 * sizeof(uint16_t),
.psram_trans_align = 64,
.sram_trans_align = 4
};
ESP_ERROR_CHECK(esp_lcd_new_i80_bus(&bus_config, &i80_bus));
ESP_LOGI(TAG, "Install panel IO");
esp_lcd_panel_io_handle_t io_handle = NULL;
esp_lcd_panel_io_i80_config_t io_config = {
.cs_gpio_num = 0,
.pclk_hz = 10000000,
.trans_queue_depth = 10,
.dc_levels = {
.dc_idle_level = 0,
.dc_cmd_level = 0,
.dc_dummy_level = 0,
.dc_data_level = 1
},
.lcd_cmd_bits = 8,
.lcd_param_bits = 8
};
ESP_ERROR_CHECK(esp_lcd_new_panel_io_i80(i80_bus, &io_config, &io_handle));
}
static camera_config_t camera_config = {
.pin_pwdn = 1,
.pin_reset = 1,
.pin_xclk = 1,
.pin_sccb_sda = 1,
.pin_sccb_scl = 2,
.pin_pclk = 1,
.pin_href = 1,
.pin_vsync = 1,
.pin_d7 = 1,
.pin_d6 = 1,
.pin_d5 = 1,
.pin_d4 = 1,
.pin_d3 = 1,
.pin_d2 = 1,
.pin_d1 = 1,
.pin_d0 = 1,
.xclk_freq_hz = 2000000,
.ledc_timer = 0,
.ledc_channel = 0,
.pixel_format = PIXFORMAT_RGB565,
.frame_size = FRAMESIZE_QVGA,
.jpeg_quality = 12, // 0-63, for OV series camera sensors, lower number means higher quality
.fb_count = 1, //When jpeg mode is used, if fb_count more than one, the driver will work in continuous mode.
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,
};
void app_main(void)
{
lcd_disp_init();
ESP_ERROR_CHECK(esp_camera_init(&camera_config));
} yes, I still can't see the issue with the above code. Please ignore the GPIO settings. I just want to test the |
LCD和Camera初始化冲突找到解决办法, 确实是配置中断的冲突, LCD和Camera中断用同一个中断源, 导致分配中断失败. 目前LCD用80接口基本正常, 可以初始化成功, 摄像头实时采集并显示到LCD. 但是LCD用RGB接口, 可以初始化成功, 但是Camera采集失败, 提示Failed to get the frame on time! |
Hi @liruya Thanks for keeping debug! But I doubt if the camera should use |
If my understanding is correct: I'm wondering what happened if 2 components that both have called gpio_install_isr_service() For example, if I have code using examples/bluetooth/esp_ble_mesh/common_components/button/button.c Then different call sequence has different intr_alloc_flags setting. CC @me-no-dev for the question in #12882 (comment) |
There are two areas worth investigating:
|
@WangYuxin-esp thanks for the pointers! @AxelLin please try espressif/esp32-camera#629 |
@suda-morris the flag is there to help speed things up a bit. ESP32 needs it to convert I2S samples to actual data. I can make it optional for S2 and S3 with @AxelLin OK if I add it to the same PR for you to try? |
@liruya Did you try esp32-camera v2.0.8? Is this still an issue? |
Answers checklist.
General issue report
esp-idf版本5.1.2.
ESP32S3 LCD用i80接口或者RGB接口, 同时使用Camera, 就会出现这种情况.
如果先初始化LCD, 则Camera初始化失败, 如果先初始化Camera, 则LCD初始化失败.
如果LCD用SPI接口, 则没有问题.
定位到 esp_intr_alloc_intrstatus -> get_available_int 这里, 中断配置失败. LCD和Camera的中断配置出现冲突, 不知道怎么解决.
The text was updated successfully, but these errors were encountered: