Fix RNDIS board and enhance camera initialization (#1702)

* Add support for RNDIS board and enhance camera initialization

- Included rndis_board.cc in the build for ESP32S3 and ESP32P4 targets.
- Updated camera initialization logic in esp32s3_korvo2_v3_board.cc and esp32s3_korvo2_v3_board.cc to use a more structured camera_config_t setup.
- Improved code readability by refining comments and formatting in the camera initialization functions.

* Remove outdated camera configuration options from esp32s3-korvo2-v3-rndis config.json to streamline setup and improve clarity.

* Update IDF version in build configuration and component dependencies to v5.5.2 for improved compatibility.

* update discord links

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
This commit is contained in:
Xiaoxia
2026-01-28 16:11:26 +08:00
committed by GitHub
parent f6ca040d19
commit d9f7682b2d
9 changed files with 48 additions and 54 deletions

View File

@ -4,13 +4,6 @@
{
"name": "esp32s3-korvo2-v3-rndis",
"sdkconfig_append": [
"CONFIG_CAMERA_OV2640=y",
"CONFIG_CAMERA_OV3660=y",
"CONFIG_CAMERA_OV3660_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
"CONFIG_CAMERA_OV3660_DVP_RGB565_240X240_24FPS=y",
"CONFIG_CAMERA_OV2640_AUTO_DETECT_DVP_INTERFACE_SENSOR=y",
"CONFIG_CAMERA_OV2640_DVP_RGB565_240X240_25FPS=y",
"CONFIG_XIAOZHI_ENABLE_CAMERA_ENDIANNESS_SWAP=y"
]
}
]

View File

@ -50,6 +50,7 @@ static const ili9341_lcd_init_cmd_t vendor_specific_init[] = {
{0, (uint8_t []){0}, 0xff, 0},
};
// https://github.com/78/xiaozhi-esp32/pull/1655
class Esp32S3Korvo2V3Board : public RndisBoard {
private:
Button boot_button_;
@ -348,43 +349,41 @@ private:
}
void InitializeCamera() {
static esp_cam_ctlr_dvp_pin_config_t dvp_pin_config = {
.data_width = CAM_CTLR_DATA_WIDTH_8,
.data_io = {
[0] = CAMERA_PIN_D0,
[1] = CAMERA_PIN_D1,
[2] = CAMERA_PIN_D2,
[3] = CAMERA_PIN_D3,
[4] = CAMERA_PIN_D4,
[5] = CAMERA_PIN_D5,
[6] = CAMERA_PIN_D6,
[7] = CAMERA_PIN_D7,
},
.vsync_io = CAMERA_PIN_VSYNC,
.de_io = CAMERA_PIN_HREF,
.pclk_io = CAMERA_PIN_PCLK,
.xclk_io = CAMERA_PIN_XCLK,
camera_config_t camera_config = {
.pin_pwdn = CAMERA_PIN_PWDN,
.pin_reset = CAMERA_PIN_RESET,
.pin_xclk = CAMERA_PIN_XCLK,
.pin_sccb_sda = -1, // Use initialized I2C
.pin_sccb_scl = -1,
.pin_d7 = CAMERA_PIN_D7,
.pin_d6 = CAMERA_PIN_D6,
.pin_d5 = CAMERA_PIN_D5,
.pin_d4 = CAMERA_PIN_D4,
.pin_d3 = CAMERA_PIN_D3,
.pin_d2 = CAMERA_PIN_D2,
.pin_d1 = CAMERA_PIN_D1,
.pin_d0 = CAMERA_PIN_D0,
.pin_vsync = CAMERA_PIN_VSYNC,
.pin_href = CAMERA_PIN_HREF,
.pin_pclk = CAMERA_PIN_PCLK,
.xclk_freq_hz = XCLK_FREQ_HZ,
.ledc_timer = LEDC_TIMER_0,
.ledc_channel = LEDC_CHANNEL_0,
.pixel_format = PIXFORMAT_RGB565,
.frame_size = FRAMESIZE_QVGA,
.jpeg_quality = 12,
.fb_count = 2,
.fb_location = CAMERA_FB_IN_PSRAM,
.grab_mode = CAMERA_GRAB_WHEN_EMPTY,
.sccb_i2c_port = (i2c_port_t)1,
};
esp_video_init_sccb_config_t sccb_config = {
.init_sccb = false,
.i2c_handle = i2c_bus_,
.freq = 100000,
};
esp_video_init_dvp_config_t dvp_config = {
.sccb_config = sccb_config,
.reset_pin = CAMERA_PIN_RESET,
.pwdn_pin = CAMERA_PIN_PWDN,
.dvp_pin = dvp_pin_config,
.xclk_freq = XCLK_FREQ_HZ,
};
esp_video_init_config_t video_config = {
.dvp = &dvp_config,
};
camera_ = new Esp32Camera(video_config);
camera_ = new Esp32Camera(camera_config);
if (camera_ != nullptr) {
camera_->SetVFlip(true);
}
}
public:

View File

@ -353,12 +353,11 @@ private:
}
void InitializeCamera() {
// ESP32-S3 使用 esp_camera 组件
camera_config_t camera_config = {
.pin_pwdn = CAMERA_PIN_PWDN,
.pin_reset = CAMERA_PIN_RESET,
.pin_xclk = CAMERA_PIN_XCLK,
.pin_sccb_sda = -1, // 使用已初始化的 I2C
.pin_sccb_sda = -1, // Use initialized I2C
.pin_sccb_scl = -1,
.pin_d7 = CAMERA_PIN_D7,
.pin_d6 = CAMERA_PIN_D6,
@ -386,8 +385,7 @@ private:
};
camera_ = new Esp32Camera(camera_config);
if(camera_ != nullptr)
{
if(camera_ != nullptr) {
camera_->SetVFlip(true);
}
}