Skip to content
Build from source

Build from source

The firmware is a Rust project. The source code is in https://github.com/j3corre/esp32-rust-chess, under the MIT license. The ESP32-C3 and C6 use the standard Rust toolchain (RISC-V targets); the ESP32-S3 needs Espressif’s esp toolchain for Xtensa, installed by espup.

One-time setup – Rust targets, espflash, the esp toolchain for the S3:

git clone https://github.com/j3corre/esp32-rust-chess.git && cd esp32-rust-chess
WITH_S3=1 scripts/unix/setup.sh

On Linux the script adds you to the uucp / dialout group – log out and in again.

Build and flash – the chip is selected with CHIP:

scripts/unix/flash.sh                         # ESP32-C6 with display (default)
CHIP=esp32c3 scripts/unix/flash.sh            # ESP32-C3
CHIP=esp32s3 scripts/unix/flash.sh            # ESP32-S3
BOARD=tdongle scripts/unix/flash.sh           # LilyGO T-Dongle-S3 (ESP32-S3 + 160×80 display)
PORT=/dev/ttyACM1 CHIP=esp32s3 scripts/unix/flash.sh   # several boards connected
scripts/unix/monitor.sh                       # serial console only

Update: git pull and flash again.

Do not flash with --flash-mode qio – several boards do not boot in QIO mode. If a board stops responding, hold BOOT, press RST, release BOOT and flash again.

Develop without a board

The simulator runs the same game hub, engine and web app on a PC:

cargo run --release -p chess-sim          # http://localhost:8080
cargo run --release -p chess-sim -- --uci # the engine as a UCI program (Arena, cutechess, …)
cargo test                                # unit tests of all libraries