2021-10-12 14:29:41 +01:00
|
|
|
# Deprecated
|
|
|
|
|
|
|
|
|
|
Installation instructions moved to: [esp-rs/rust-build](https://github.com/esp-rs/rust-build)
|
|
|
|
|
|
2021-06-11 08:31:15 +01:00
|
|
|
# Rust on Xtensa Installation for Linux 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-07-28 15:14:45 +01:00
|
|
|
Tested OS: Ubuntu 18 x64, Ubuntu 20 x64, Mint 20 x64, OpenSUSE Thumbleweed
|
2021-06-11 08:31:15 +01:00
|
|
|
|
|
|
|
|
## Prerequisites
|
|
|
|
|
|
|
|
|
|
- rustup - installed with nightly toolchain - https://rustup.rs/
|
|
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
## Installation commands
|
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
|
|
|
sudo apt install gcc wget xz-utils
|
|
|
|
|
|
|
|
|
|
rustup toolchain install nightly
|
|
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
VERSION="1.54.0-dev"
|
|
|
|
|
ARCH="x86_64-unknown-linux-gnu"
|
|
|
|
|
RUST_DIST="rust-${VERSION}-${ARCH}"
|
|
|
|
|
RUST_SRC_DIST="rust-src-${VERSION}"
|
|
|
|
|
TOOLCHAIN_DESTINATION_DIR="~/.rustup/toolchains/esp"
|
2021-06-11 08:31:15 +01:00
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
mkdir -p ${TOOLCHAIN_DESTINATION_DIR}
|
2021-06-11 08:31:15 +01:00
|
|
|
|
2021-08-12 07:16:13 +01:00
|
|
|
wget https://dl.espressif.com/dl/idf-rust/dist/${ARCH}/${RUST_DIST}.tar.xz
|
|
|
|
|
tar xvf ${RUST_DIST}.tar.xz
|
|
|
|
|
./${RUST_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs
|
|
|
|
|
|
|
|
|
|
wget https://dl.espressif.com/dl/idf-rust/dist/noarch/${RUST_SRC_DIST}.tar.xz
|
|
|
|
|
tar xvf ${RUST_SRC_DIST}.tar.xz
|
|
|
|
|
./${RUST_SRC_DIST}/install.sh --destdir=${TOOLCHAIN_DESTINATION_DIR} --prefix="" --without=rust-docs
|
2021-06-11 08:31:15 +01:00
|
|
|
|
2021-07-28 15:14:45 +01:00
|
|
|
rustup default esp
|
2021-06-11 08:31:15 +01:00
|
|
|
|
2021-08-30 09:11:56 +01:00
|
|
|
wget https://github.com/espressif/llvm-project/releases/download/esp-12.0.1-20210823/xtensa-esp32-elf-llvm12_0_1-esp-12.0.1-20210823-linux-amd64.tar.xz
|
|
|
|
|
tar xf xtensa-esp32-elf-llvm12_0_1-esp-12.0.1-20210823-linux-amd64.tar.xz
|
2021-06-11 08:31:15 +01:00
|
|
|
export PATH="`pwd`/xtensa-esp32-elf-clang/bin/:$PATH"
|
|
|
|
|
|
2021-06-14 07:51:26 +01:00
|
|
|
wget --continue https://github.com/espressif/rust-esp32-example/archive/refs/heads/main.zip
|
|
|
|
|
unzip main.zip
|
|
|
|
|
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
|
|
|
```
|