Skip to content
Open
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
ea4119d
feat: add support for ESP32-P4-Function-EV-Board with configuration a…
n2flowjs-bot Sep 16, 2025
2d3ce13
detect wake word model from index.json
78 Sep 16, 2025
a09e438
update wait time before entering wifi configure mode
78 Sep 16, 2025
03de1cb
Merge tag 'v2.0.2'
n2flowjs-bot Sep 17, 2025
c89ae7b
feat: Enhance ESP32-P4 Function EV Board support with LCD and touch i…
n2flowjs-bot Sep 17, 2025
f9eafa9
feat: Update ESP32-P4 Function EV Board configuration for improved to…
n2flowjs-bot Sep 17, 2025
e01d91e
Merge remote-tracking branch 'upstream/v2'
n2flowjs-bot Sep 17, 2025
d180b51
Merge remote-tracking branch 'upstream/main'
n2flowjs-bot Sep 26, 2025
1d583dd
feat: add touch I2C configuration and improve initialization structure
n2flowjs-bot Sep 26, 2025
5893606
Merge remote-tracking branch 'upstream/main'
n2flowjs-bot Sep 27, 2025
81d00cf
Remove ESP hosted configuration from defaults
isthaison Oct 2, 2025
ab57ee2
Merge branch 'main' into main
isthaison Oct 23, 2025
13d9a4c
chore: update documentation for improved clarity
n2flowjs-bot Oct 23, 2025
3d5058d
Merge branch 'main' of https://github.com/isthaison/xiaozhi-esp32
n2flowjs-bot Oct 23, 2025
f1e3d9e
refactor: remove obsolete files for ESP32-P4-Function-EV-Board and ad…
n2flowjs-bot Oct 23, 2025
88e8a0e
refactor: reintroduce ESP32-P4-Function-EV-Board implementation with …
n2flowjs-bot Oct 23, 2025
bf390cf
refactor: restore esp32_p4_function_ev_board dependency with updated …
n2flowjs-bot Oct 24, 2025
e93cfd6
Merge remote-tracking branch 'upstream/main'
n2flowjs-bot Nov 8, 2025
bc500c2
Remove ESP-P4-Function-EV-Board configuration and update README with …
n2flowjs-bot Nov 8, 2025
a7ee3c7
Update main/boards/esp-p4-function-ev-board/esp-p4-function-ev-board.cc
isthaison Nov 8, 2025
f03a07b
Update main/boards/esp-p4-function-ev-board/esp-p4-function-ev-board.cc
isthaison Nov 8, 2025
5cea896
Enhance camera initialization in ESP-P4-Function-EV-Board; add fallba…
n2flowjs-bot Nov 8, 2025
664838e
Merge branch 'main' of https://github.com/isthaison/xiaozhi-esp32
n2flowjs-bot Nov 8, 2025
959877f
Update clock source for MIPI DSI configuration in ESP-P4-Function-EV-…
n2flowjs-bot Nov 8, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion main/boards/esp-p4-function-ev-board/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,13 @@ Board support for ESP-P4-Function-EV-Board. Wi‑Fi uses ESP‑Hosted via the on
## Features
- Wi‑Fi: `esp_wifi_remote` + `esp_hosted` (SDIO) with ESP32‑C6 co‑processor
- Display: 7" MIPI‑DSI LCD (1024×600) via adapter; can also run headless
- Audio: Can run with dummy codec; board includes ES8311 + PA if needed
- Audio: ES8311 codec with speaker and microphone support
- Touch: GT911 capacitive touch controller
- SD Card: MicroSD card support (MMC mode)
- Camera: MIPI-CSI camera interface (OV5647, SC2336 sensors supported)
- USB: USB host/device support
- SPIFFS: Built-in flash filesystem support
- Fonts: Custom font support with Unicode characters (Vietnamese, Chinese, etc.)

## Configure
In `menuconfig`: Xiaozhi Assistant -> Board Type -> ESP-P4-Function-EV-Board
Expand Down
47 changes: 47 additions & 0 deletions main/boards/esp-p4-function-ev-board/esp-p4-function-ev-board.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Display
#include "display/display.h"
#include "display/lcd_display.h"
#include "lvgl_theme.h"
// Backlight
// PwmBacklight is declared in backlight headers pulled by display/lcd_display includes via lvgl stack

Expand Down Expand Up @@ -88,6 +89,47 @@ class ESP32P4FunctionEvBoard : public WifiBoard
ESP_ERROR_CHECK(bsp_touch_new(NULL, &tp_));
}

void InitializeSdCard()
{
ESP_LOGI(TAG, "Initializing SD card");
esp_err_t ret = bsp_sdcard_mount();
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to mount SD card: %s", esp_err_to_name(ret));
} else {
ESP_LOGI(TAG, "SD card mounted successfully");
}
}

void InitializeCamera()
{
ESP_LOGI(TAG, "Initializing camera");
bsp_camera_cfg_t camera_cfg = {0};
esp_err_t ret = bsp_camera_start(&camera_cfg);
if (ret != ESP_OK) {
ESP_LOGE(TAG, "Failed to initialize camera: %s", esp_err_to_name(ret));
} else {
ESP_LOGI(TAG, "Camera initialized successfully");
}
}
Comment on lines 106 to 161
Copy link

Copilot AI Nov 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The camera is initialized but never exposed through a GetCamera() method, and there's no cleanup in the destructor. This means:

  1. The initialized camera resources cannot be accessed by the application
  2. Camera resources may leak on board destruction

Consider either:

  • Adding a virtual Camera* GetCamera() override method that returns a Camera wrapper for the BSP camera
  • Adding camera cleanup in the destructor (e.g., bsp_camera_stop() if available)
  • Removing the camera initialization if the camera functionality is not yet ready to be used

Copilot uses AI. Check for mistakes.

void InitializeFonts()
{
ESP_LOGI(TAG, "Initializing font support");
// Font initialization is handled by the Assets system
// The board supports loading fonts from assets partition
// Verify that fonts are properly loaded by checking theme
auto& theme_manager = LvglThemeManager::GetInstance();
auto current_theme = theme_manager.GetTheme("light");
if (current_theme != nullptr) {
auto text_font = current_theme->text_font();
if (text_font != nullptr && text_font->font() != nullptr) {
ESP_LOGI(TAG, "Custom font loaded successfully: line_height=%d", text_font->font()->line_height);
} else {
ESP_LOGW(TAG, "Custom font not loaded, using built-in font");
}
}
}

public:

ESP32P4FunctionEvBoard() : boot_button_(0)
Expand All @@ -97,6 +139,9 @@ class ESP32P4FunctionEvBoard : public WifiBoard
InitializeLCD();
InitializeButtons();
InitializeTouch();
InitializeSdCard();
InitializeCamera();
InitializeFonts();
GetBacklight()->RestoreBrightness();
}

Expand All @@ -105,6 +150,8 @@ class ESP32P4FunctionEvBoard : public WifiBoard
// Clean up display pointer
delete display_;
display_ = nullptr;
// Unmount SD card
bsp_sdcard_unmount();
// If other resources need cleanup, add here
}

Expand Down
Loading