Commit Graph

882 Commits

Author SHA1 Message Date
b7dc88f6ab fix(esp32-p4): split each P4 build into rev<3 + -p4x twin variants
【中文】
针对 PR #1943 的评审建议(Y1hsiaochunnn + laride):当前市面的 ESP32-P4
几乎都是 rev v1.x / v2.x 硅片,IDF 默认 REV_MIN_301 会让 bootloader 被
bootloader.rev3.ld 链到高位 HP_SRAM,导致在存量硬件上第一条指令就 panic。
未来 ESP32-P4X(rev >= 3.x)又需要保留默认配置,因此不能在所有 P4 board
上一刀切地写死 CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y。

方案:对所有 P4 config.json 的每个现有变体,添加 REV_LESS_V3 + REV_MIN_100,
并复制一份加 `-p4x` 后缀的孪生变体(不加上述两行,保持 IDF 默认 REV_MIN_301
以支持未来 P4X 芯片)。

受影响的 6 份 config.json,共 14 个原变体,复制后新增 14 个 `-p4x` 变体:
- main/boards/waveshare/esp32-p4-wifi6-touch-lcd/config.json(8 -> 16 变体,
  其中 7b 变体保留 32MB flash + custom 分区配置)
- main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json
- main/boards/waveshare/esp32-p4-nano/config.json
- main/boards/esp-p4-function-ev-board/config.json
- main/boards/wireless-tag-wtp4c5mp07s/config.json
- main/boards/m5stack-tab5/config.json

---

[English]
Per review on PR #1943 (Y1hsiaochunnn + laride): almost all ESP32-P4 silicon
on the market today is rev v1.x / v2.x. IDF's default REV_MIN_301 links the
bootloader via bootloader.rev3.ld into the upper HP_SRAM window, which those
chips cannot execute; the CPU panics on the first opcode. Future ESP32-P4X
(rev >= 3.x) still needs the IDF default, so we cannot hard-code
CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y across all P4 boards.

Strategy: for each existing variant in every P4 config.json, add REV_LESS_V3
+ REV_MIN_100 to target current silicon, and add a `-p4x` twin variant
without those two configs (keeping IDF default REV_MIN_301) for future P4X
chips.

Affects 6 config.json files, 14 original variants duplicated into 14 `-p4x`
twins:
- main/boards/waveshare/esp32-p4-wifi6-touch-lcd/config.json (8 -> 16
  variants; the 7b variant keeps its 32 MB flash + custom partition configs)
- main/boards/waveshare/esp32-p4-wifi6-touch-lcd-3.5/config.json
- main/boards/waveshare/esp32-p4-nano/config.json
- main/boards/esp-p4-function-ev-board/config.json
- main/boards/wireless-tag-wtp4c5mp07s/config.json
- main/boards/m5stack-tab5/config.json
2026-04-21 14:30:58 +08:00
2461efdc72 fix(waveshare-p4-7b): target v1.x chip rev and 32MB flash layout
【中文】
7B 变体使用 v1.x 版本的 ESP32-P4 芯片和 32MB flash,但 config.json 中
对应的 sdkconfig_append 既没声明芯片版本,也没声明 flash 大小。IDF 因此
默认按 rev v3.1 + 16MB flash 构建,bootloader 被链接脚本
bootloader.rev3.ld 放到 0x4ffa_xxxx 的高位 HP_SRAM,这个区域在 v1.x
硅上不可取指,ROM 加载完跳过去,CPU 在第一条指令就
"Guru Meditation Error: Core 0 panic'ed (Illegal instruction)",
bootloader log 一行都打不出来。

添加 CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y + CONFIG_ESP32P4_REV_MIN_100=y
让 bootloader.ld(低位 HP_SRAM 0x4ff2_xxxx)被选中,并声明
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y + partitions/v2/32m.csv,使 image
header 和分区表和板子实际硬件对齐;CONFIG_ESPTOOLPY_FLASH_MODE_AUTO_DETECT=n
与已知 32MB 板子 sensecap-watcher 保持一致。

在 v1.3 版本的 P4-WIFI6-Touch-LCD-7B 上验证通过:bootloader 段现在加载到
0x4ff33ce0 / 0x4ff29ed0 / 0x4ff2cbd0;启动过程中 MIPI-DSI LCD、GT911
触控、OV5647 摄像头、ES8311+ES7210 音频和 ESP32-C6 SDIO 协处理器
全部正常初始化;状态机进入 wifi_configuring,对外发出 Xiaozhi-XXXX 配网热点。

---

[English]
The 7B variant ships with a v1.x ESP32-P4 silicon and a 32 MB flash, but
the existing sdkconfig_append declared neither. IDF then defaults to rev
v3.1 + 16 MB, and the bootloader is linked via bootloader.rev3.ld into
the 0x4ffa_xxxx upper HP_SRAM window. That range is not fetchable on
v1.x silicon, so the ROM jumps to the loaded bootloader and the CPU
panics on the first opcode with "Guru Meditation Error: Core 0 panic'ed
(Illegal instruction)" before any bootloader log is printed.

Add CONFIG_ESP32P4_SELECTS_REV_LESS_V3=y + CONFIG_ESP32P4_REV_MIN_100=y
so bootloader.ld (low HP_SRAM 0x4ff2_xxxx) is used, and declare
CONFIG_ESPTOOLPY_FLASHSIZE_32MB=y + partitions/v2/32m.csv so the image
header and partition offsets match the board. Disable flash-mode
auto-detect for parity with the other known 32 MB board (sensecap-watcher).

Verified on a v1.3 P4-WIFI6-Touch-LCD-7B: bootloader segments now load
at 0x4ff33ce0 / 0x4ff29ed0 / 0x4ff2cbd0; boot completes through MIPI DSI,
GT911 touch, OV5647 camera, ES8311+ES7210 audio and the ESP32-C6 SDIO
coprocessor; device reaches wifi_configuring and exposes the Xiaozhi-XXXX AP.
2026-04-18 01:38:06 +08:00
e5ebde454e Merge pull request #1937 from DrayxR3X/esp32-s3-touch-amoled-1.43c
add waveshare esp32-s3-touch-amoled-1.43c
2026-04-17 13:59:37 +08:00
d2687956cd resolve conflict 2026-04-17 10:48:13 +08:00
87f6faee79 Update Chinese and English documentation for custom board setup and MCP protocol
- Added a comprehensive guide for creating custom boards in the XiaoZhi AI project, detailing directory structure, configuration files, and initialization code.
- Introduced a new document explaining the MCP protocol for IoT control, including message formats and interaction flows.
- Updated existing documentation to reflect changes in tool registration and usage examples for the MCP protocol.
- Enhanced README files for better clarity and consistency across languages.
2026-04-17 03:36:37 +08:00
69b1a978e9 Add NULLLAB-AI-VOX3 Board (#1900) 2026-04-16 19:31:53 +08:00
6074fdeb71 feat(cardputer-adv): add TCA8418 keyboard and WiFi config UI (#1929)
Add full keyboard support and keyboard-based WiFi configuration for
M5Stack Cardputer Adv:

- TCA8418 I2C keyboard driver with 56-key matrix, interrupt-driven
  key events, and debounce handling
- Keyboard WiFi config UI: scan/select/input SSID and password
  directly on the device without needing a phone
- Volume control (up/down arrows) and brightness control (left/right)
  via keyboard with fine-step adjustment near bounds
- Enter key to toggle chat state
- Display offset and backlight fixes for ST7789V2
- README with flash parameters and hardware specs

Co-authored-by: bot <bot@localhost>
2026-04-14 17:02:00 +08:00
7dc61300d1 add waveshare esp32-s3-touch-amoled-1.43c 2026-04-14 15:52:40 +08:00
97c0e75eec feat:添加正点原子DNESP32S3B3开发板的小智AI例程 (#1931) 2026-04-13 21:09:11 +08:00
efeb3ad119 fix: remove submodule (#1925) 2026-04-10 17:09:39 +08:00
36d742e4d7 ESP-VoCat: BMI270 motion feedback, capacitive slider (v1.2), and single-pad button (v1.0) (#1902)
* Add support bmi270

* Add support slider

* Add support touch for v1.0
2026-04-08 10:12:56 +08:00
ab2cae5746 Fix crash when adjusting volume via button while Es8311 audio device is disabled (#1917)
* Initial plan

* Fix crash when adjusting volume via button while audio device is disabled

When both input and output are disabled, UpdateDeviceState() sets dev_ to
nullptr. Pressing a volume button calls SetOutputVolume() which previously
called esp_codec_dev_set_out_vol(dev_, volume) without null-checking dev_,
causing a crash via ESP_ERROR_CHECK.

Fix: Add null guard for dev_ and mutex lock for thread safety. The volume
is still saved via AudioCodec::SetOutputVolume() and will be applied when
the device is reopened by UpdateDeviceState().

Agent-Logs-Url: https://github.com/78/xiaozhi-esp32/sessions/945c653a-ed16-49af-aefe-5cfb473402c6

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
2026-04-07 18:35:06 +08:00
7a7c74a747 Add touch screen support to freenove 2.8 (#1901)
* Add touch screen support to freenove 2.8

Volume and brightness levels on vertical/horizontal swipe
Listening, chat state and wifi config on press/long press

* Simplified

Removed swipes. Touch quiet unresponsive on Freenove board.

* Remove unused parts

* Modify long tap duration in TouchTask

Updated touch driver logic to change long tap duration from 600ms to 3000ms.

* Cosmetic fix
2026-04-07 17:18:24 +08:00
cc7cbe78ba Merge pull request #1821 from ggc121238/main
feat: add waveshare esp32-s3-cam-xxxx support
2026-04-03 14:14:35 +08:00
ggc
314edc5c51 content: add ESP32-S3-CAM-OVxxxx 2026-04-02 16:37:24 +08:00
7e7890183e Content: fixed ESP_LCD_TOUCH_IO_I2C_FT5x06_CONFIG issue 2026-04-02 14:21:01 +08:00
2c5d7757e5 Content: Removed some irrelevant code 2026-04-02 14:21:01 +08:00
43b4d35b2e Content: Removed irrelevant code 2026-04-02 14:21:01 +08:00
33ed917172 content: fixed config.json and config.h 2026-04-02 14:21:01 +08:00
89d51fdc23 content: add ESP32-P4-WIFI6-Touch-LCD-3.5 2026-04-02 14:21:01 +08:00
022d9848de Add freenove-esp32s3-display-2.8-lcd (#1876)
* add freenove-esp32s3-display-2.8-lcd

from https://github.com/Freenove/xiaozhi-esp32 and updated to v2.2.4

* add Freenove_ESP32S3_DISPLAY_2_8_LCD to configs

* Update from manufacturer

https://github.com/Freenove/xiaozhi-esp32/tree/New

* Delete main/boards/freenove-esp32s3-display-2.8-lcd/_static/ReadMe/media-kit-2.8-lcd-top.jpg

orphan

* Delete main/boards/freenove-esp32s3-display-2.8-lcd/_static/ReadMe/media-kit-2.8-lcd-sideview.jpg

orphan

* Delete main/boards/freenove-esp32s3-display-2.8-lcd/_static/ReadMe directory

* readme update
2026-04-01 12:46:53 +08:00
8afebe560a Merge pull request #1895 from Y1hsiaochunnn/touchcompatible
fix: Default configuration of GT911
2026-03-31 10:22:59 +08:00
a63f8bc08b fix: Default configuration of GT911 2026-03-31 10:10:12 +08:00
4dc1a8c75f Merge pull request #1892 from DrayxR3X/esp32-c6-touch-amoled-2.16
add waveshare esp32-c6-touch-amoled-2.16
2026-03-31 09:16:16 +08:00
121a2d45e7 Merge branch '78:main' into esp32-c6-touch-amoled-2.16 2026-03-30 18:16:11 +08:00
06b3b7613c Merge pull request #1891 from Y1hsiaochunnn/gt911_err
fix: Compilation errors caused by default configuration changes of the touch chip
2026-03-30 16:17:58 +08:00
addf5fcc64 fix: touch configuration security risk fixed 2026-03-30 15:29:31 +08:00
a877d95f74 fix: touch_config errors 2026-03-30 15:12:22 +08:00
76a5c19000 add waveshare esp32-c6-touch-amoled-2.16 2026-03-30 15:07:45 +08:00
7d63797dfa fix: GT911 config errors 2026-03-30 15:05:20 +08:00
0f3199a812 feat: adapt to esp_codec_dev>=1.5.5 (#1878)
* feat: adapt to esp_codec_dev>=1.5.5

* fix: fix board config resolution in release script
2026-03-26 23:56:45 +08:00
6d51b9dbde Bump version to 2.2.5 (#1882)
* Initial plan

* bump version to 2.2.5

Co-authored-by: 78 <4488133+78@users.noreply.github.com>
Agent-Logs-Url: https://github.com/78/xiaozhi-esp32/sessions/841b9fce-b34b-4cbd-b46a-20b48fd35d4c

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
2026-03-26 23:52:38 +08:00
d340efe58d Remove unused flag for playing popup sound on listening state in ContinueWakeWordInvoke() function (#1881) 2026-03-26 13:12:02 +08:00
d9f0ef13aa Fix GIF emoji flickering by merging lock scopes in SetEmotion() (#1880)
* Initial plan

* Fix GIF emoji flickering by merging lock scopes in SetEmotion()

Remove the separate first lock scope that hid emoji_image_ before
destroying gif_controller_ (added by PR #1848). Instead, move the
gif_controller_ cleanup into each lock scope where new content is set,
so destruction and creation happen atomically. This prevents both the
original race condition crash AND the visible flickering.

Co-authored-by: 78 <4488133+78@users.noreply.github.com>
Agent-Logs-Url: https://github.com/78/xiaozhi-esp32/sessions/2dd0ff3a-4556-47a6-8d40-a30e18c01923

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
2026-03-26 12:53:06 +08:00
-10
358819bf2e change to use cJSON_ParseWithLength (#1873) 2026-03-23 21:05:06 +08:00
cef581d723 Update dependencies in idf_component.yml to latest versions: esp-ml30… (#1867)
* Update dependencies in idf_component.yml to latest versions: esp-ml307 to ~3.6.5, uart-eth-modem to ~0.3.4, esp32-camera to ^2.1.5, lvgl to ~9.5.0, esp_lvgl_port to ~2.7.2, esp_mmap_assets to ^1.3.2, and adc_battery_estimation to ^0.2.1.

* Update esp-wifi-connect version and adjust partition sizes in 4m.csv
2026-03-22 13:05:42 +08:00
dbb8e1d409 fix(eda-robot-pro): Optimize gait algorithm (#1871) 2026-03-22 07:03:10 +08:00
-10
78008ab9d3 add refresh display theme param for Apply function (#1865) 2026-03-22 06:23:58 +08:00
cab8a7cecf Merge pull request #1868 from shunian11/main
feat: add waveshare esp32-s3-touch-lcd-1.54 and waveshare esp32-s3-lcd-0.85
2026-03-20 19:00:43 +08:00
74fa5413fc update config.json 2026-03-20 16:48:06 +08:00
cc4e12fa74 add manufacturer in config.json 2026-03-20 15:10:46 +08:00
1c195fea4f Update config.json 2026-03-20 11:11:24 +08:00
a4bf13b30d add waveshare esp32-s3-lcd-0.85 2026-03-20 11:03:29 +08:00
619dd2801c add waveshare esp32-s3-touch-lcd-1.54 2026-03-20 10:49:58 +08:00
280b2ff856 Fix crash when LAMP_GPIO or BUILTIN_LED_GPIO is GPIO_NUM_NC (#1853)
* Initial plan

* Add GPIO_NUM_NC guards for LampController and SingleLed across all board files

Boards crash when LAMP_GPIO or BUILTIN_LED_GPIO is set to GPIO_NUM_NC because
LampController and SingleLed are instantiated unconditionally.

Fix: Guard LampController with `if (LAMP_GPIO != GPIO_NUM_NC)` in InitializeTools()
and guard SingleLed with `if (BUILTIN_LED_GPIO != GPIO_NUM_NC)` in GetLed(),
falling back to NoLed when GPIO is not connected.

Fixes the reported crash on bread-compact-wifi-lcd and hardens all similar boards.

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

* Fix crash when LAMP_GPIO or BUILTIN_LED_GPIO is GPIO_NUM_NC (minimal 2-file fix)

Instead of adding guards in every board file (36 files), fix the root cause
in just 2 source files:

1. SingleLed constructor: replace assert(gpio != GPIO_NUM_NC) with graceful
   early return, leaving led_strip_ as nullptr (all methods already null-check it)
2. LampController constructor: add early return when gpio_num == GPIO_NUM_NC

This fixes the crash on bread-compact-wifi-lcd and any other board where
these GPIOs are set to GPIO_NUM_NC.

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

* Remove esp_timer_delete from destructor to match original behavior

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
2026-03-20 07:02:03 +08:00
527cd1fd58 Restore README.md and update Discord links to https://discord.gg/C759fGMBcZ in all language versions (#1862)
* Initial plan

* Restore README.md and update Discord links to https://discord.gg/C759fGMBcZ in all language versions

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
2026-03-19 03:54:13 +08:00
55698b2d74 Update Discord link in README.md 2026-03-19 03:25:59 +08:00
e503a32d84 feat: Add Waevshare Product ESP32-P4-WIFI6-Touch-LCD-4.3 Support (#1858)
* feat: Add Waevshare Product ESP32-P4-WIFI6-Touch-LCD-4.3 Support

* feat: Supplement README

* feat: Remove redundant conf
2026-03-19 03:05:08 +08:00
564e929aea Fix race condition in GIF emotion switching causing crash (#1848)
* Initial plan

* Fix GIF emotion switching crash: hide emoji_image_ before destroying gif_controller_

The crash was caused by a race condition in SetEmotion() where two separate
DisplayLockGuard scopes allowed the LVGL render task to access freed GIF image
data between lock scopes. By hiding emoji_image_ before destroying
gif_controller_ in the same lock scope, LVGL won't try to render the image
with freed data during the gap.

Co-authored-by: 78 <4488133+78@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: 78 <4488133+78@users.noreply.github.com>
2026-03-15 22:14:02 +08:00
bbd5f70c3c fix: add explicit UTF-8 encoding to file operations for Windows compatibility (#1845)
On Windows, Python's default encoding is the system locale (e.g., cp1252,
gbk) rather than UTF-8. This causes UnicodeDecodeError when reading
sdkconfig files, CMakeLists.txt, or JSON configs that contain non-ASCII
characters (e.g., Chinese comments, UTF-8 BOM).

Fix: Add explicit encoding='utf-8' to all text file open() calls in:
- scripts/release.py (Path.open() for config.json, CMakeLists.txt, sdkconfig)
- scripts/build_default_assets.py (io.open() for sdkconfig, open() for headers/configs)
- scripts/versions.py (open() for info.json read/write)

Relates to #1792

Co-authored-by: Nicola Spieser <redbasecap@users.noreply.github.com>
2026-03-15 18:49:49 +08:00