We currently maintain two template repositories:
Both templates are based on
cargo-generate, a tool that allows you to create a new project based on some existing template. In our case,
esp-template can be used to generate an application with all the required configurations and dependencies.
cargo install cargo-generate
Generate a project based on one of the templates:
cargo generate esp-rs/esp-template
esp-templatefor more details on the template project.
cargo generate esp-rs/esp-idf-template cargo
esp-idf-templatefor more details on the template project.
cargo generatesubcommand is invoked, you will be prompted to answer several questions regarding the target of your application. Upon completion of this process, you will have a buildable project with all the correct configurations.
Build/Run the generated project:
cargo buildto compile the project using the appropriate toolchain and target.
cargo runto compile the project, flash it, and open a serial monitor with our target device.
Both template repositories have a prompt for Dev Containers support, see details in Dev Containers section of the template README.
Dev Containers use the
idf-rust container image, which was explained in the Using Container section of the Setting up a Development Environment chapter. This image provides an environment ready to develop Rust applications for Espressif chips with no installation required. Dev Containers also have integration with Wokwi simulator, to simulate the project, and allow flashing from the container using