-
Notifications
You must be signed in to change notification settings - Fork 257
Description
Hello, friends!
I recently purchased this Xiaozhi ESP32 project from AliExpress. The hardware is excellent, but the company severely limits Xiaozhi's capabilities. I've searched the repository and there's no firmware available for this specific board.
I spent an entire day investigating and reverse-engineering all possible hardware information, and I managed to gather quite a lot of useful data.
I would like to know if anyone is interested in compiling a "clean" Xiaozhi firmware for this board.
Below are all the hardware details I've collected. Thank you very much!
AiKoder S3 LCD - Hardware Configuration
📋 Board Information
Board: aikoder-s3-lcd
Version: 2.0
Chip: ESP32-S3
Cores: 2
Flash Size: 8MB
Minimum Free Heap: [check at runtime]
IDF Version: [from firmware]
🔌 GPIO Pinout (Extraído do Firmware)
Display - JD9853 (SPI)
MOSI (SDA) : GPIO38
SCK (SCLK) : GPIO39
CS : GPIO40
DC : Not specified in firmware
RESET : Not specified in firmware
Backlight : GPIO13 (PWM)
Resolution : 240x240
Interface : SPI3_HOST, 40 MHz
Touch - CST816D (I²C)
Address : 0x15
SDA : [To be determined via I²C scan]
SCL : [To be determined via I²C scan]
INT : Not specified
RESET : Not specified
Audio - ES8311 Codec
I²C Control Bus:
Address : 0x18
SDA : GPIO2 ✓ Confirmed
SCL : GPIO1 ✓ Confirmed
I²S Audio Data Bus:
BCLK : GPIO17 ✓ Confirmed
WS (LRCK) : GPIO18 ✓ Confirmed
DOUT (Speaker) : GPIO8 ✓ Confirmed
DIN (Mic) : GPIO7 ✓ Confirmed
MCLK : GPIO16 (optional)
Sample Rate : 16 kHz (default), supports up to 24 kHz
Bits per Sample: 16-bit
Power Control:
PA Control : GPIO3 (Power Amplifier Enable - must be HIGH)
Headphone Det : GPIO3 or GPIO40 (needs confirmation)
System
Boot Button : GPIO0
Battery ADC : GPIO9 (ADC1_CH8)
Charging Det : GPIO10 (optional)
📝 Configuration Strings (from firmware)
Display Settings
display : [enabled]
brightness : [0-100, configurable]
theme : light/dark
rotation : 0/90/180/270
Audio Settings
codec : ES8311
sample_rate : 16000 (or 24000)
volume : [0-100]
⚙️ Hardware Features (from firmware strings)
Supported Protocols
-
WiFi: 802.11 b/g/n (2.4GHz)
- Modes: Station, AP, Auto
- Encryption: Open, WEP, WPA-PSK, WPA2-PSK, WPA2-ENT, WPA3-SAE, etc.
-
Bluetooth: Supported (BT_MAC, BT_BB)
-
I²C Buses: Multiple (I2C_MASTER, I2C_EXT0, I2C_EXT1)
-
SPI Buses: SPI1, SPI2, SPI3
-
I²S: I2S0, I2S1 (audio interfaces)
Peripherals
- UART0, UART1, UART2
- LEDC (PWM channels)
- TWAI (CAN bus support)
- USB (serial-jtag)
- SDIO_HOST
- GPIO (including GPIO_NMI)
- PCNT (pulse counter)
- RMT (remote control)
- ADC (analog inputs)
- Timers (TIMER1, TIMER2, SYSTIMER)
🔧 Partition Table
Label Type Subtype Address Size
nvs data nvs [address] [size]
otadata data ota [address] [size]
phy_init data phy [address] [size]
model [type] [subtype] [address] [size]
app app [subtype] [address] [size]
📚 Firmware Modules
Core Components
- esp_system: System initialization and power management
- heap: Memory allocation (DRAM, IRAM, RTCRAM, SPIRAM/PSRAM)
- nvs: Non-volatile storage
- esp_hw_support: Hardware support (clocks, interrupts, GPIO)
- freertos: Real-time operating system
- esp_timer: High-resolution timers
- newlib: C standard library
- pthread: POSIX threads
Communication
- esp_netif: Network interface
- lwip: TCP/IP stack
- esp_wifi: WiFi driver
- esp_event: Event loop
- mqtt: MQTT client
- esp_http_client: HTTP client
- esp_https_ota: OTA updates
Peripherals
- driver/gpio: GPIO control
- driver/i2c: I²C master/slave
- driver/spi: SPI master
- driver/i2s: I²S audio
- driver/ledc: PWM/LED control
- driver/uart: Serial communication
- esp_lcd: LCD panel interface (including JD9853 support)
Graphics
- LVGL: GUI library (esp_lvgl_port)
- esp_lcd_jd9853: JD9853 display driver
Audio
- ES8311: Audio codec driver
- i2s: I²S interface for audio streaming
Storage
- esp_partition: Partition management
- nvs_flash: NVS operations
- spiffs: File system
🚀 Arduino IDE Configuration
Board: ESP32S3 Dev Module
Upload Speed: 921600
USB CDC On Boot: Enabled
CPU Frequency: 240MHz (WiFi)
Flash Mode: QIO 80MHz
Flash Size: 8MB
PSRAM: OPI PSRAM
Partition Scheme: Default 4MB with spiffs (or custom)
Core Debug Level: None
📦 PlatformIO Configuration
[env:aikoder-s3-lcd]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
board_build.mcu = esp32s3
board_build.f_cpu = 240000000L
board_build.flash_mode = qio
board_build.psram_type = opi
board_upload.flash_size = 8MB
build_flags =
-DBOARD_HAS_PSRAM
-DARDUINO_USB_CDC_ON_BOOT=1
# Audio I²C (Confirmed)
-DES8311_SDA=2
-DES8311_SCL=1
# Audio I²S (Confirmed)
-DI2S_BCLK=17
-DI2S_WS=18
-DI2S_DOUT=8
-DI2S_DIN=7
-DI2S_MCLK=16
# Power Control
-DPA_CTRL=3
# Display
-DLCD_MOSI=38
-DLCD_SCK=39
-DLCD_CS=40
-DLCD_BL=13
monitor_speed = 115200⚠️ Important Notes
Audio ES8311
- I²C Bus: SDA=GPIO2, SCL=GPIO1 ✓ CONFIRMED
- I²S Bus: BCLK=17, WS=18, DOUT=8, DIN=7 ✓ CONFIRMED
- PA Control: GPIO3 must be set HIGH to enable audio amplifier
- Chip Address: 0x18 (7-bit I²C address)
- The ES8311 requires initialization via I²C before audio playback
Display JD9853
- Uses SPI3_HOST interface
- 240x240 resolution
- Backlight controlled via PWM on GPIO13
- The command
JD9853: The 3Ah command has been usedappears in logs
Touch CST816D
- I²C address: 0x15
- Exact I²C pins need to be discovered via scanning
- Possible pins: GPIO4/5 or GPIO6/7
Power Management
- Battery monitoring: GPIO9 (ADC1_CH8)
- Calibration scheme detected in firmware
- Sleep modes supported
🔍 Firmware Strings Reference
Key strings found in firmware that may be useful:
"aikoder-s3-lcd"
"Xiaozhi" (Possible hotspot name)
"Duplex channels created"
"Es8311AudioCodec initialized"
"Display: Power management not supported"
"Backlight: Set brightness to %d"
"Battery level"
"Entering Wi-Fi configuration mode"
📖 Extracted Information Summary
✅ Confirmed Hardware
- ESP32-S3 with 8MB Flash, 2MB PSRAM
- JD9853 display controller (240x240 SPI)
- ES8311 audio codec (I²S + I²C)
- CST816D capacitive touch (I²C)
✅ Confirmed Pins
- ES8311 I²C: SDA=2, SCL=1
- ES8311 I²S: BCLK=17, WS=18, DOUT=8, DIN=7
- PA Control: GPIO3
- Display: MOSI=38, SCK=39, CS=40, BL=13
- System: Boot=0, Battery=9
❓ To Be Confirmed
- Touch I²C pins (SDA/SCL)
- Display DC and RESET pins
- Headphone detection pin
- Additional GPIO functions
📄 Source
Information extracted from firmware.bin and system logs provided by the user.
Last Updated: November 2025

