2021-06-11 08:31:15 +01:00
|
|
|
# Rust on Xtensa Installation for Windows x64
|
|
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
Following instructions are specific for ESP32 and ESP32-S series based on Xtensa architecture.
|
|
|
|
|
|
|
|
|
|
Instructions for ESP-C series based on RISC-V architecture are described in document for [ESP32-C3](../README.md#esp32-c3).
|
|
|
|
|
|
2021-06-11 08:31:15 +01:00
|
|
|
Tested OS: Windows 10 x64
|
|
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
|
|
|
|
- Visual Studio - installed with option Desktop development with C++
|
|
|
|
|
- rustup - installed with nightly toolchain - https://rustup.rs/
|
|
|
|
|
- Chocolatey - https://chocolatey.org/
|
|
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
## Installation commands for PowerShell
|
2021-06-11 08:31:15 +01:00
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
```sh
|
2021-06-11 08:31:15 +01:00
|
|
|
choco install 7zip
|
|
|
|
|
|
|
|
|
|
rustup toolchain install nightly
|
|
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
$Version="1.54.0-dev"
|
|
|
|
|
$Arch="x86_64-pc-windows-msvc"
|
|
|
|
|
$RustDist="rust-${VERSION}-${ARCH}"
|
2021-07-28 15:14:45 +01:00
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
mkdir -p ~\.rustup\toolchains\ -ErrorAction SilentlyContinue
|
|
|
|
|
pushd ~\.rustup\toolchains\
|
2021-06-11 08:31:15 +01:00
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
Invoke-WebRequest "https://dl.espressif.com/dl/idf-rust/dist/${Arch}/${RustDist}.zip" -OutFile "${RustDist}.zip"
|
|
|
|
|
7z x .\${RustDist}.zip
|
2021-06-11 08:31:15 +01:00
|
|
|
popd
|
|
|
|
|
|
2021-07-28 15:14:45 +01:00
|
|
|
rustup default esp
|
2021-06-11 08:31:15 +01:00
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
Invoke-WebRequest https://dl.espressif.com/dl/idf-rust/dist/${Arch}/xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip -OutFile xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip
|
2021-07-28 15:14:45 +01:00
|
|
|
7z x xtensa-esp32-elf-llvm11_0_0-llvmorg-11-init-21249-g36dbc8b-win64.zip
|
2021-08-12 07:16:13 +01:00
|
|
|
$env:LIBCLANG_PATH=Join-Path -Path (Get-Location) -ChildPath xtensa-esp32-elf-clang\bin
|
|
|
|
|
$env:PATH+=";$env:LIBCLANG_PATH"
|
2021-06-11 08:31:15 +01:00
|
|
|
|
|
|
|
|
Invoke-WebRequest https://github.com/espressif/rust-esp32-example/archive/refs/heads/main.zip -OutFile rust-esp32-example.zip
|
|
|
|
|
7z x rust-esp32-example.zip
|
2021-06-14 07:51:26 +01:00
|
|
|
cd rust-esp32-example-main
|
2021-08-12 07:16:13 +01:00
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Select architecture for the build
|
|
|
|
|
|
|
|
|
|
For the ESP32 - default (Xtensa architecture):
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
idf.py set-target esp32
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For the ESP32-S2 (Xtensa architecture):
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
idf.py set-target esp32s2
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
For the ESP32-S3 (Xtensa architecture):
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
idf.py set-target esp32s3
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Build and flash
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
idf.py build flash
|
2021-06-11 08:31:15 +01:00
|
|
|
```
|