rustzx-esp32
rustzx-esp32 copied to clipboard
ESP32 implementation of RustZX Spectrum emulator
RustZX for ESP32
Rust Bare Metal implementation of ZX Spectrum for ESP32. The project is still work in progress.
Hardware (working):
- ZX Spectrum with USB keyboard over ESP-NOW (wireless)
- ESP32-S3-BOX, M5Stack CoreS3 or ESP32-C6-DevKitC-1 as main emulator unit with display
- ESP32-S3-USB-OTG as USB keyboard to ESP-NOW converter (wireless) (ESP-IDF)
- ZX Spectrum with UART keyboard over
espflash monitor
- ESP32-C6-DevKitC-1 as main emulator unit with display
- ZX Spectrum PS/2 keyboard over UART (wired)
- M5Stack CoreS3 as main emulator unit with display
- ESP32-C3 DevKit as PS/2 or USB COMBO keyboard converter to serial
Hardware (work-in-progress):
- ESP32 C3 DevKit RUST - app is not yet optimized for low memory
ZX Spectrum with USB keyboard over ESP-NOW (wireless)
Assembly
Assembly of the keyboard
- plug USB keyboard to ESP32-S3-USB-OTG USB HOST connector
- plug USB power supply to ESP32-S3-USB-OTG USB DEV connector
- plug mini-USB connector to port for flashing
Flashing keyboard
- use ESP-IDF 5.2
cd esp32-s3-usb-otg-keyboard
idf.py build flash monitor
- code is based on ESP-IDF USB HID example
Assembly of the main part
- connect ESP32-S3-BOX or M5Stack CoreS3 with USB-C to computer and flash the application
Software setup
- use espup to install Rust toolchain for Xtensa (ESP32-S3)
espup install
- use espflash to flash binaries
cargo install espflash
- download a
.tap
file from Speccy archives and store it todata/hello.tap
Run
Flash and monitor the application.
ESP32-S3-BOX:
cd esp32-s3-box
cargo run --release
M5Stack CoreS3:
cd m5stack-cores3
cargo run --release
ESP32-C6-DevKitC-1:
cd esp32-c6
cargo run --release
ZX Spectrum with UART keyboard over espflash monitor
Software setup
- use espup to install Rust toolchain for Xtensa (ESP32-S3)
espup install
- use espflash to flash binaries
cargo install espflash
- download a
.tap
file from Speccy archives and store it todata/hello.tap
Run
Flash and monitor the application.
ESP32-C6-DevKitC-1:
cd esp32-c6
cargo run --release
Command cargo run --release
will turn on espflash monitor
after the flashing.
You can use the monitor console as kkeyboard output.
ZX Spectrum PS/2 keyboard over UART (wired)
Assembly
Assmebly of the keyboard
- flash ESP32-C3 which should serve as keyboard converter from PS/2 or USB to serial
git clone https://github.com/georgik/ps2keyboard-esp32c3.git --branch feature/serial-converter
cd ps2keyboard-esp32c3
cargo run --release
- take PS/2 keyboard and wire it to ESP32-C3 according to PS/2 ESP32-C3 circuit
- in case of USB keyboard you can skip PS/2 connector and wirePS/2 ESP32-C3 circuit to USB connector using the schematics from USB to PS2 convertor
- recommendation: use wire wrapping to connect parts
Assembly of the main part
- connect ESP32-C3 keyboard converter and M5Stack CoreS3
GPIO4 RX (ESP32-C3 KB) - GPIO17 TX or T at Grove Port C (M5Stack CoreS3)
GPIO5 TX (ESP32-C3 KB) - GPIO18 RX or R at Grove Port C (M5Stack CoreS3)
GND (ESP32-C3 KB) - GND (M5Stack CoreS3)
Software setup
- use espup to install Rust toolchain for Xtensa (ESP32-S3)
espup install
- use espflash to flash binaries
cargo install espflash
- download a
.tap
file from Speccy archives and store it todata/hello.tap
Run
Flash and monitor the application:
cd m5stack-cores3-ps2-keyboard
cargo run --release
Hit enter to load the tape included in the memory.
References
- RustZX wrapper code reused from https://github.com/pacmancoder/rustzx
- ESP-IDF USB HID example
- Rust ESP-NOW
- older RustZX-ESP32 based with std on v1.0.0-archive