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:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@ -92,7 +92,7 @@ jobs:
|
|||||||
include: ${{ fromJson(needs.prepare.outputs.variants) }}
|
include: ${{ fromJson(needs.prepare.outputs.variants) }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: espressif/idf:release-v5.5
|
image: espressif/idf:v5.5.2
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|||||||
@ -160,7 +160,7 @@ This is an open-source ESP32 project, released under the MIT license, allowing a
|
|||||||
|
|
||||||
We hope this project helps everyone understand AI hardware development and apply rapidly evolving large language models to real hardware devices.
|
We hope this project helps everyone understand AI hardware development and apply rapidly evolving large language models to real hardware devices.
|
||||||
|
|
||||||
If you have any ideas or suggestions, please feel free to raise Issues or join our [Discord](https://discord.gg/x3S4jgXHk3) or QQ group: 994694848
|
If you have any ideas or suggestions, please feel free to raise Issues or join our [Discord](https://discord.gg/bXqgAfRm) or QQ group: 994694848
|
||||||
|
|
||||||
## Star History
|
## Star History
|
||||||
|
|
||||||
|
|||||||
@ -156,7 +156,7 @@ Feishuドキュメントチュートリアルをご覧ください:
|
|||||||
|
|
||||||
このプロジェクトを通じて、AIハードウェア開発を理解し、急速に進化する大規模言語モデルを実際のハードウェアデバイスに応用できるようになることを目指しています。
|
このプロジェクトを通じて、AIハードウェア開発を理解し、急速に進化する大規模言語モデルを実際のハードウェアデバイスに応用できるようになることを目指しています。
|
||||||
|
|
||||||
ご意見やご提案があれば、いつでもIssueを提出するか、[Discord](https://discord.gg/x3S4jgXHk3) または QQグループ:1011329060 にご参加ください。
|
ご意見やご提案があれば、いつでもIssueを提出するか、[Discord](https://discord.gg/bXqgAfRm) または QQグループ:1011329060 にご参加ください。
|
||||||
|
|
||||||
## スター履歴
|
## スター履歴
|
||||||
|
|
||||||
|
|||||||
@ -156,7 +156,7 @@ v1 的稳定版本为 1.9.2,可以通过 `git checkout v1` 来切换到 v1 版
|
|||||||
|
|
||||||
我们希望通过这个项目,能够帮助大家了解 AI 硬件开发,将当下飞速发展的大语言模型应用到实际的硬件设备中。
|
我们希望通过这个项目,能够帮助大家了解 AI 硬件开发,将当下飞速发展的大语言模型应用到实际的硬件设备中。
|
||||||
|
|
||||||
如果你有任何想法或建议,请随时提出 Issues 或加入 [Discord](https://discord.gg/x3S4jgXHk3) 或 QQ 群:1011329060
|
如果你有任何想法或建议,请随时提出 Issues 或加入 [Discord](https://discord.gg/bXqgAfRm) 或 QQ 群:1011329060
|
||||||
|
|
||||||
## Star History
|
## Star History
|
||||||
|
|
||||||
|
|||||||
@ -777,7 +777,9 @@ endif()
|
|||||||
|
|
||||||
# Include EspVideo if target is ESP32S3 or ESP32P4
|
# Include EspVideo if target is ESP32S3 or ESP32P4
|
||||||
if(CONFIG_IDF_TARGET_ESP32S3 OR CONFIG_IDF_TARGET_ESP32P4)
|
if(CONFIG_IDF_TARGET_ESP32S3 OR CONFIG_IDF_TARGET_ESP32P4)
|
||||||
list(APPEND SOURCES "boards/common/esp_video.cc")
|
list(APPEND SOURCES "boards/common/esp_video.cc"
|
||||||
|
"boards/common/rndis_board.cc"
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# Include Esp32Camera if target is ESP32S3
|
# Include Esp32Camera if target is ESP32S3
|
||||||
@ -792,6 +794,7 @@ idf_component_register(SRCS ${SOURCES}
|
|||||||
PRIV_REQUIRES
|
PRIV_REQUIRES
|
||||||
esp_pm
|
esp_pm
|
||||||
esp_psram
|
esp_psram
|
||||||
|
esp_netif
|
||||||
esp_driver_gpio
|
esp_driver_gpio
|
||||||
esp_driver_uart
|
esp_driver_uart
|
||||||
esp_driver_spi
|
esp_driver_spi
|
||||||
|
|||||||
@ -4,13 +4,6 @@
|
|||||||
{
|
{
|
||||||
"name": "esp32s3-korvo2-v3-rndis",
|
"name": "esp32s3-korvo2-v3-rndis",
|
||||||
"sdkconfig_append": [
|
"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"
|
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@ -50,6 +50,7 @@ static const ili9341_lcd_init_cmd_t vendor_specific_init[] = {
|
|||||||
{0, (uint8_t []){0}, 0xff, 0},
|
{0, (uint8_t []){0}, 0xff, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// https://github.com/78/xiaozhi-esp32/pull/1655
|
||||||
class Esp32S3Korvo2V3Board : public RndisBoard {
|
class Esp32S3Korvo2V3Board : public RndisBoard {
|
||||||
private:
|
private:
|
||||||
Button boot_button_;
|
Button boot_button_;
|
||||||
@ -348,43 +349,41 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InitializeCamera() {
|
void InitializeCamera() {
|
||||||
static esp_cam_ctlr_dvp_pin_config_t dvp_pin_config = {
|
camera_config_t camera_config = {
|
||||||
.data_width = CAM_CTLR_DATA_WIDTH_8,
|
.pin_pwdn = CAMERA_PIN_PWDN,
|
||||||
.data_io = {
|
.pin_reset = CAMERA_PIN_RESET,
|
||||||
[0] = CAMERA_PIN_D0,
|
.pin_xclk = CAMERA_PIN_XCLK,
|
||||||
[1] = CAMERA_PIN_D1,
|
.pin_sccb_sda = -1, // Use initialized I2C
|
||||||
[2] = CAMERA_PIN_D2,
|
.pin_sccb_scl = -1,
|
||||||
[3] = CAMERA_PIN_D3,
|
.pin_d7 = CAMERA_PIN_D7,
|
||||||
[4] = CAMERA_PIN_D4,
|
.pin_d6 = CAMERA_PIN_D6,
|
||||||
[5] = CAMERA_PIN_D5,
|
.pin_d5 = CAMERA_PIN_D5,
|
||||||
[6] = CAMERA_PIN_D6,
|
.pin_d4 = CAMERA_PIN_D4,
|
||||||
[7] = CAMERA_PIN_D7,
|
.pin_d3 = CAMERA_PIN_D3,
|
||||||
},
|
.pin_d2 = CAMERA_PIN_D2,
|
||||||
.vsync_io = CAMERA_PIN_VSYNC,
|
.pin_d1 = CAMERA_PIN_D1,
|
||||||
.de_io = CAMERA_PIN_HREF,
|
.pin_d0 = CAMERA_PIN_D0,
|
||||||
.pclk_io = CAMERA_PIN_PCLK,
|
.pin_vsync = CAMERA_PIN_VSYNC,
|
||||||
.xclk_io = CAMERA_PIN_XCLK,
|
.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 = {
|
camera_ = new Esp32Camera(camera_config);
|
||||||
.init_sccb = false,
|
if (camera_ != nullptr) {
|
||||||
.i2c_handle = i2c_bus_,
|
camera_->SetVFlip(true);
|
||||||
.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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -353,12 +353,11 @@ private:
|
|||||||
}
|
}
|
||||||
|
|
||||||
void InitializeCamera() {
|
void InitializeCamera() {
|
||||||
// ESP32-S3 使用 esp_camera 组件
|
|
||||||
camera_config_t camera_config = {
|
camera_config_t camera_config = {
|
||||||
.pin_pwdn = CAMERA_PIN_PWDN,
|
.pin_pwdn = CAMERA_PIN_PWDN,
|
||||||
.pin_reset = CAMERA_PIN_RESET,
|
.pin_reset = CAMERA_PIN_RESET,
|
||||||
.pin_xclk = CAMERA_PIN_XCLK,
|
.pin_xclk = CAMERA_PIN_XCLK,
|
||||||
.pin_sccb_sda = -1, // 使用已初始化的 I2C
|
.pin_sccb_sda = -1, // Use initialized I2C
|
||||||
.pin_sccb_scl = -1,
|
.pin_sccb_scl = -1,
|
||||||
.pin_d7 = CAMERA_PIN_D7,
|
.pin_d7 = CAMERA_PIN_D7,
|
||||||
.pin_d6 = CAMERA_PIN_D6,
|
.pin_d6 = CAMERA_PIN_D6,
|
||||||
@ -386,8 +385,7 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
camera_ = new Esp32Camera(camera_config);
|
camera_ = new Esp32Camera(camera_config);
|
||||||
if(camera_ != nullptr)
|
if(camera_ != nullptr) {
|
||||||
{
|
|
||||||
camera_->SetVFlip(true);
|
camera_->SetVFlip(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -114,11 +114,12 @@ dependencies:
|
|||||||
rules:
|
rules:
|
||||||
- if: target in [esp32s3, esp32c5]
|
- if: target in [esp32s3, esp32c5]
|
||||||
|
|
||||||
## Required IDF version
|
|
||||||
idf:
|
|
||||||
version: '>=5.5.1'
|
|
||||||
espressif/esp_lcd_touch_st7123: ^1.0.0
|
espressif/esp_lcd_touch_st7123: ^1.0.0
|
||||||
espressif/iot_usbh_rndis:
|
espressif/iot_usbh_rndis:
|
||||||
version: ^0.3.1
|
version: ^0.3.1
|
||||||
rules:
|
rules:
|
||||||
- if: target in [esp32s3, esp32p4]
|
- if: target in [esp32s3, esp32p4]
|
||||||
|
|
||||||
|
## Required IDF version
|
||||||
|
idf:
|
||||||
|
version: '>=5.5.2'
|
||||||
|
|||||||
Reference in New Issue
Block a user