ESP32 | Rust | Configure environment on Linux (Ubuntu)

rustup update

apt-get install -y git curl gcc clang ninja-build cmake libudev-dev unzip xz-utils python3 python3-pip python3-venv libusb-1.0-0 libssl-dev pkg-config

git clone https://github.com/esp-rs/rust-build.git
cd rust-build
./install-rust-toolchain.sh
. ./export-esp.sh


cargo install espup
 # To install Espressif Rust ecosystem
espup install
. $HOME/export-esp.sh

cargo install espflash

If cargo run not works because of PERMISSION DENIED error, then you should change the owner of the serial port. In my case I have /dev/ttyUSB0, so that:

sudo chown MY_LINUX_USER  /dev/ttyUSB0

Replace MY_LINUX_USER with your username.

Then run again

cargo run