espflash

A serial flasher utility for ESP devices. Supports flashing ESP32, ESP32-C3, ESP32-S2, and ESP8266.

The esp-rs/espflash repository contains two crates, cargo-espflash and espflash. You can find more information on both of these in their respective sections below.

cargo-espflash

Provides a subcommand for cargo which handles cross-compilation and flashing. Note that this requires the unstable build-std cargo feature; for more information on this please refer to the cargo documentation.

To install:

$ cargo install cargo-espflash

This command must be run within a Cargo project, ie.) a directory containing a Cargo.toml file. For example, to build an example named 'blinky' in release mode, flash the resulting binary to a device, and then subsequently start a serial monitor:

$ cargo espflash --example=blinky --release --monitor

For more information please see to the cargo-espflash README.

espflash

Provides a standalone command-line application which flashes an ELF file to a device.

To install:

$ cargo install espflash

Assuming you have built an ELF binary by other means already, espflash can be used to download it to your device. For example, if you have built the getting-started/blinky example from esp-idf using idf.py you might run something like:

$ espflash build/blinky

For more information please see to the espflash README.