About this Install Guide

This guide is intended to get you up and running with this tool quickly with the most common settings. For a thorough review of all options, refer to the official documentation.

Rust is an open source programming language.

This install guide is for developers using Rust for their embedded applications.

If you are using Rust to build Linux applications on an Arm Linux platform, refer to Rust for Linux Applications instead.

This install guide describes a setup using an Ubuntu Linux host.

For a thorough review of all options, refer to the official documentation. See The Embedded Rust Book .

Installation

Download and install Rust

Run the following command to download and install Rust:

    

        
        
            curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
        
    

Start a new shell or run the following command to continue:

    

        
        
            source "$HOME/.cargo/env"
        
    

To confirm the installation is complete, run the following (cargo is the Rust package manager):

    

        
        
            rustc --version
cargo version
        
    

The output is similar to:

    

        
        rustc 1.78.0 (9b00956e5 2024-04-29)
cargo 1.78.0 (54d8815d0 2024-03-26)

        
    

Add Arm cross-compilation support

Add cross compilation support for the required Arm Architectures. For example, to add support for Armv7-M architecture, you can use:

    

        
        
            rustup target add thumbv7m-none-eabi
        
    

For a full list of supported architectures, use:

    

        
        
            rustup target list
        
    

Install cargo-generate

To generate a project from a template, you need cargo-generate. To install and rebuild use:

    

        
        
            sudo apt install -y libssl-dev pkg-config
sudo apt install -y build-essential
cargo install cargo-generate
        
    

Install cargo-binutils (optional)

Other utilities are also available. For completeness, they can be installed with:

    

        
        
            cargo install cargo-binutils
rustup component add llvm-tools-preview
        
    

You are now ready to build an embedded application in Rust.


Feedback

How would you rate the overall quality of this tool quick-install guide?