Deploy your cloud AI Xiaozhi voice assistant using ESP32S3 + reSpeaker
Goal: Make ESP32S3 work with the reSpeaker XVF3800 and run the Xiaozhi assistant leveraging cloud large-models. Project source: https://github.com/Seeed-Projects/Xiaozhi_Esp32S3_reSpeaker Seeed-Projects: https://github.com/Seeed-Projects
reSpeaker XVF3800 is a professional 4-microphone circular array based on the XMOS XVF3800 chip. It provides reliable voice pickup in noisy environments with features including dual modes, 360° far-field pickup (up to 5 m), acoustic echo cancellation (AEC), automatic gain control (AGC), direction of arrival (DoA), dereverberation, beamforming and noise suppression. With its robust capture and denoising abilities, Xiaozhi gets a much better "ear".

Part 1: reSpeaker hardware firmware preparation
This section targets the reSpeaker XVF3800 hardware itself. The default USB firmware does not support I2S output, so you must flash a dedicated I2S firmware to use it with hosts such as XIAO ESP32S3.
Note: The I2S firmware uses I2C DFU (not USB DFU). If the device already has I2S firmware but behaves abnormally, enter "safe mode" first and then use USB DFU to recover or switch firmware. Safe mode supports both USB DFU and I2C DFU. See official references:
1.1 Preparation
Hardware
- reSpeaker XVF3800 USB 4-Mic Array
- USB Type-C data cable (power + data)
- Computer: Windows / macOS / Linux
- If integrated with XIAO ESP32S3, ensure proper soldering for I2S / I2C / power connections
Software (install dfu-util)
Windows:
- Download and unzip a
dfu-utilbinary (e.g.D:\dfu-util-0.11-binaries\win64\). - Add the directory containing
dfu-util.exeto PATH. - Verify with
dfu-util -V. - If
dfu-util -lreturnsLIBUSB_ERROR_NOT_SUPPORTED, use Zadig to replace the device driver with WinUSB.
macOS (Homebrew):
brew install dfu-util
dfu-util -l
Linux (Debian / Ubuntu / Raspberry Pi OS):
sudo apt update
sudo apt install dfu-util
sudo dfu-util -l
Download the I2S firmware
- Visit the firmware repo: https://github.com/respeaker/reSpeaker_XVF3800_USB_4MIC_ARRAY/tree/master/xmos_firmwares
- Download a
.binfile with a name starting withi2s(e.g.respeaker_xvf3800_i2s_dfu_firmware_v1.0.x.bin).
1.2 Connect and enter DFU mode
Wiring note
- Use the USB-C port near the 3.5mm headphone jack (the XMOS side) when connecting to your computer; do NOT use the XIAO side port.
Enter safe mode (recommended)
Use this when: current firmware is I2S but you want USB, firmware is corrupted, or wrong firmware was flashed.
- Completely remove power.
- Hold the onboard "Mute" button.
- While holding it, reconnect power.
- When the red LED starts blinking, release the button — the device is now in safe mode.
1.3 Flash the I2S firmware using dfu-util
Confirm the device is visible
# Linux / Raspberry Pi OS
sudo dfu-util -l
# macOS / Windows
dfu-util -l
Expected output contains Found DFU: [2886:001a] ... alt=1, name="reSpeaker DFU Upgrade".
Flash command
# Linux / Raspberry Pi OS (replace path)
sudo dfu-util -R -e -a 1 -D /path/to/respeaker_xvf3800_i2s_dfu_firmware_v1.0.x.bin
# macOS / Windows (no sudo)
dfu-util -R -e -a 1 -D /path/to/respeaker_xvf3800_i2s_dfu_firmware_v1.0.x.bin
Parameters: -R (reset/restart), -e (erase), -a 1 (write to Upgrade alt), -D (firmware file).
1.4 Verification & troubleshooting
Verify firmware
After flashing, the device will auto-reboot and I2S firmware should be active. You can verify by reading audio data from the device with the ESP32S3 as the I2S host.
FAQ
- Q:
dfu-util -ldoesn't show the device?- Check USB cable and port (must use the XMOS-side connector).
- If the device currently runs I2S firmware, enter safe mode before flashing.
- Windows users: ensure WinUSB driver via Zadig.
- Q: Error during flashing?
- Try a different USB cable or host port, and retry in safe mode.
- Q: No audio after flashing?
- Verify I2S host configuration (sample rate, channels) matches the firmware settings.
Part 2: Xiaozhi software adaptation changes
This section addresses code changes to make the Xiaozhi project support the reSpeaker XVF3800.
2.1 Overview of changes
Core changes:
- Added a shared I2C bus wrapper to centrally manage the I2C master and avoid conflicts.
- Added hardware probe during startup: probe XVF3800 over I2C before application start.
- Decoupled board-level configuration: use
config.hmacros for pins and addresses to ease porting. - Build updates: include the new BSP source files in the build.
2.2 Key code change locations
A. New: shared I2C bus
- Files:
main/shared_i2c_bus.h/main/shared_i2c_bus.c - Purpose: Provide
shared_i2c_master_bus_get()which uses the ESP-IDF I2C master API with internal pull-ups enabled by default.
B. New: reSpeaker audio hardware initialization
- File:
main/audio_bsp.c - Function:
audio_hardware_init() - Logic: Acquire shared I2C bus, call
i2c_master_probe()to detectXVF3800_I2C_ADDR(0x2C) and print probe logs.
C. Change: startup order
- File:
main/main.cc - Change: Call
audio_hardware_init()beforeApplication::GetInstance().Start().
D. Change: build & board config
CMakeLists.txt: addaudio_bsp.candshared_i2c_bus.cto the build sources.boards/xiao-esp32s3-sense/config.h:- Add
I2C_SDA_PIN(5),I2C_SCL_PIN(6). - Add
XVF3800_I2C_ADDR(0x2C). - Complete I2S pin and bitwidth settings.
- Add
Part 3: Build, flash and deploy
This section guides compiling the adapted firmware and flashing it to the ESP32S3.
3.1 Confirm hardware connections
Ensure connections between ESP32S3 and reSpeaker XVF3800:
- I2S audio lines connected correctly.
- I2C control lines connected: ESP32S3 GPIO5 (SDA) / GPIO6 (SCL) to XVF3800.
3.2 Select build target
idf.py set-target esp32s3
3.3 Menuconfig
idf.py menuconfig
Required adjustments:
- Select board:
Xiaozhi Assistant -> Board Type -> Seeed Studio XIAO ESP32S3 Sense. - Avoid pin conflicts: if I2S uses GPIO43/44, switch console output to USB:
Component config -> ESP System Settings -> Channel for console output -> USB Serial/JTAG. - Flash settings:
Serial flasher config -> Flash size -> 8 MBandPartition Table -> Custom partition CSV file -> partitions/v1/8m.csv.
3.4 Build & flash
idf.py build
idf.py flash
3.5 Monitor logs & verify
idf.py monitor
Part 4: Network setup and activation
After flashing, the device needs network configuration and cloud binding to use AI conversation features.
4.1 Connect to device hotspot
- Use your phone to find the Wi-Fi SSID named
Xiaozhi-XXXXXX. - Open a browser and go to
http://192.168.4.1.
4.2 Configure Wi-Fi
- On the captive portal wait ~5s for network scanning.
- Choose your 2.4GHz Wi-Fi (iPhone hotspot: enable "Max Compatibility").
- Enter the password and click "Connect".
- After "Login successful", the device will reboot in ~3 seconds.

4.3 Add the device to the management backend
- Get the device ID: after the device is online, wake it by saying "Hello Xiaozhi" and listen for the 6-digit verification code.
- Go to https://xiaozhi.me and sign up / sign in.
- In the "Agents" or device management section, select "Add device", enter the 6-digit device ID and submit.

Once completed, your reSpeaker–Xiaozhi device should be ready and operational.
Tech Support & Product Discussion
Thank you for choosing our products! We are here to provide you with different support to ensure that your experience with our products is as smooth as possible. We offer several communication channels to cater to different preferences and needs.