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.

/toolchain/1 of 42 min read620 words
  • toolchain
  • windows
Contents

Introduction#

This is the first guide in the Rust microcontroller series. It shows how to configure a basic Rust development environment. let me see reaction image 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

rustup self uninstall confirmation

Install the following software:

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 analyzer
  • even better toml
  • dependi

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. Visual Studio Installer modify button

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

Visual Studio desktop development workload selected

Windows SDK component selected in Visual Studio Installer

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

RUSTUP_HOME environment variable path

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

CARGO_HOME environment variable path

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.

rustup-init startup options

Enter 2 and press Enter. rustup customize installation menu When the confirmation appears, press Enter again. rustup host triple confirmation When the toolchain selection appears, enter nightly and press Enter. rustup toolchain selection prompt Accept the profile selection with Enter. rustup profile selection prompt When asked whether to modify the environment variables, enter y and press Enter to use the values configured earlier. rustup PATH modification prompt Another prompt appears after you press Enter. rustup installation confirmation screen Press Enter to continue. rustup installation progress The message Rust is installed now. Great! confirms a successful installation. Rust installed successfully message

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.


For further Rust learning, these resources are useful:

rust_book rust_book cool

Troubleshooting#

  • If the terminal cannot find cargo, open a new terminal or check that CARGO_HOME and PATH are 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.