[](https://deepwiki.com/kassane/zig-esp-idf-sample) # Using Zig Language & Toolchain with ESP-IDF | Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-H2 | ESP32-P4 | ESP32-H4 | ESP32-S2 | ESP32-S3 | | ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | -------- | ## STATUS: Experimental ## Description This project aims to integrate Zig language and toolchain with the [Espressif IoT Development Framework](https://github.com/espressif/esp-idf) for enhanced development capabilities on ESP32 and its variants. More information about building and using Zig with ESP-IDF can be found in the [documentation](docs/getting-started.md). ## Prerequisites - [Zig](https://ziglang.org/download) toolchain - v0.16.0 or master - [ESP-IDF](https://github.com/espressif/esp-idf) - v5.x or v6.x or master ### Targets Allowed
| Target | Architecture | Features | Zig Build Configuration |
|---|---|---|---|
| ESP32 | Xtensa LX6 | Dual-core, WiFi, BT Classic, BLE | -Dtarget=xtensa-freestanding-none -Dcpu=esp32 |
| ESP32-S2 | Xtensa LX7 | Single-core, WiFi, USB OTG | -Dtarget=xtensa-freestanding-none -Dcpu=esp32s2 |
| ESP32-S3 | Xtensa LX7 | Dual-core, WiFi, BLE 5.0, USB OTG, AI | -Dtarget=xtensa-freestanding-none -Dcpu=esp32s3 |
| ESP32-C2 | RISC-V | Single-core, WiFi, BLE 5.0, Low-cost | -Dtarget=riscv32-freestanding-none -Dcpu=generic_rv32+m+c+zicsr+zifencei |
| ESP32-C3 | RISC-V | Single-core, WiFi, BLE 5.0, Low-power | |
| ESP32-C5 | RISC-V | Single-core, WiFi 6, BLE 5.0 | -Dtarget=riscv32-freestanding-none -Dcpu=generic_rv32+m+a+c+zicsr+zifencei |
| ESP32-C6 | RISC-V | Single-core, WiFi 6, BLE 5.0, Zigbee, Thread | |
| ESP32-C61 | RISC-V | Single-core, WiFi 6, BLE 5.0, Low-cost | |
| ESP32-H2 | RISC-V | BLE 5.0, Zigbee 3.0, Thread, No WiFi | |
| ESP32-H21 | RISC-V | BLE 5.0, Zigbee 3.0, Thread, No WiFi | |
| ESP32-H4 | RISC-V | BLE 5.2, Zigbee, Thread, FPU, No WiFi | -Dtarget=riscv32-freestanding-eabihf -Dcpu=esp32h4 (Espressif fork) / generic_rv32+m+a+c+f+zicsr+zifencei (upstream) |
| ESP32-P4 | RISC-V | Dual-core, AI, DSP, FPU, No WiFi/BT | -Dtarget=riscv32-freestanding-eabihf -Dcpu=esp32p4 (Espressif fork) / generic_rv32+m+a+c+f+zicsr+zifencei (upstream) |