Toolchain
Set up a Rust embedded environment in five minutes
Install VSCode, Visual Studio Community Edition, and the Rust toolchain on Windows for embedded development.
Contents
Introduction#
This is the first guide in the Rust microcontroller series. It shows how to configure a basic Rust development environment.
Unlike traditional microcontroller development with C/C++, Rust needs one general development environment. You do not need IDEs such as Keil-uVision5, IAR, SES, MRS/MRS2, or STM32CubeIDE.
This guide uses Windows. The setup is simpler on Linux; platform differences are called out where needed.
Checklist#
| Item | Details |
|---|---|
| Operating system | Windows (Linux notes are included where relevant) |
| Editor | VSCode |
| Build dependency | Visual Studio Community Edition |
| Rust installer | rustup-init.exe |
| Expected result | The terminal can run cargo, rustc, and rustup |
If you have tried Rust and want to remove it, open a terminal, run the command below, type y, and press Enter.
rustup self uninstall

Install the following software:
VSCode-
A code editor with a modern editing experience.
Visual Studio Community Edition-
Provides the low-level
SDKandlinkerused by theMSVC ABI. rustup-init.exe-
The
rustinstallation bootstrapper.
If VSCode and Visual Studio Community Edition are already installed, you can start Rust development with only a few additional steps.
Install VSCode and Visual Studio Community Edition from the links above.
Install VSCode and Visual Studio Community Edition#
The steps below assume that VSCode and Visual Studio Community Edition are installed.
First, configure VSCode. Create a dedicated profile for Rust so it does not mix with other toolchains, then install these extensions:
rust analyzereven better tomldependi
Next, open Visual Studio Installer, which manages Visual Studio Community Edition.
Make sure the following components are installed. Compare the screenshots with your installer.
Open Visual Studio Installer and click the Modify button highlighted in the screenshot.

In the dialog, make sure the highlighted components are selected and installed.


Two of the three setup stages are complete.
Install Rust#
The third stage installs Rust.
The default installer places the entire Rust toolchain on the C drive. Set environment variables first if you want to use another drive.
This guide uses the D drive. Create two directories there for the Rust toolchain.
Configure environment variables#
Create a directory named RUST, open it, and create .cargo and .rustup directories inside.
# variable name
RUSTUP_HOME
# variable value
D:\RUST\.rustup

# variable name
CARGO_HOME
# variable value
D:\RUST\.cargo

The environment variables are configured.
Double-click rustup-init.exe.
The highlighted output in the terminal confirms that the environment variables are ready for the Rust toolchain.

Enter 2 and press Enter.

Enter again.

toolchain selection appears, enter nightly and press Enter.

profile selection with Enter.

modify the environment variables, enter y and press Enter to use the values configured earlier.

Enter.

Enter to continue.

Rust is installed now. Great! confirms a successful installation.

These steps may feel long for beginners, but they provide a predictable installation layout.
On Linux, install gcc and run the official installation command. The environment variables work the same way, usually by adding them to .bashrc; the defaults are often sufficient.
The basic Rust environment on Windows is now ready. Use it for desktop applications and command-line tools, or add platform tools for embedded development.
Recommended resources#
For further Rust learning, these resources are useful:

- The Rust Book
-
Read this book alongside the video course.

Troubleshooting#
- If the terminal cannot find
cargo, open a new terminal or check thatCARGO_HOMEandPATHare active. - If installation stalls, check the network proxy, antivirus software, and system permissions.
- Before developing for a chip platform, install its
target, flashing tool, and debugger.
Discussion
Comments and discussion
Sign in with GitHub to leave a comment, ask a question, or add context.