<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="https://blog.implrust.com/feed_style.xsl" type="text/xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <tabi:metadata xmlns:tabi="https://github.com/welpo/tabi">
        <tabi:base_url>https:&#x2F;&#x2F;blog.implrust.com</tabi:base_url>
        <tabi:separator>
            •
        </tabi:separator>
        <tabi:about_feeds>This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader. Visit About Feeds to learn more and get started. It&#x27;s free.</tabi:about_feeds>
        <tabi:visit_the_site>Visit website</tabi:visit_the_site>
        <tabi:recent_posts>Recent posts</tabi:recent_posts>
        <tabi:last_updated_on>Updated on $DATE</tabi:last_updated_on>
        <tabi:default_theme></tabi:default_theme>
        <tabi:post_listing_date>date</tabi:post_listing_date>
        <tabi:current_section>cortex-m</tabi:current_section>
    </tabi:metadata><link rel="extra-stylesheet" href="https://blog.implrust.com/skins/lowcontrast_orange.css?h=43aaccb17d8ec616ace4" /><title>impl Blog for Rust - cortex-m</title>
        <subtitle>impl Rust Blog Posts</subtitle>
    <link href="https://blog.implrust.com/tags/cortex-m/atom.xml" rel="self" type="application/atom+xml"/>
    <link href="https://blog.implrust.com/tags/cortex-m/" rel="alternate" type="text/html"/>
    <generator uri="https://www.getzola.org/">Zola</generator><updated>2026-08-04T00:00:00+00:00</updated><id>https://blog.implrust.com/tags/cortex-m/atom.xml</id><entry xml:lang="en">
        <title>Setting Up an Embedded Rust Development Environment</title>
        <published>2026-08-04T00:00:00+00:00</published>
        <updated>2026-08-04T00:00:00+00:00</updated>
        <author>
            <name>implFerris</name>
        </author>
        <link rel="alternate" href="https://blog.implrust.com/posts/2026/08/embedded-rust-development-environment/" type="text/html"/>
        <id>https://blog.implrust.com/posts/2026/08/embedded-rust-development-environment/</id>
        
            <content type="html">&lt;p&gt;When developing embedded applications with Rust, you will need to install a few tools on your computer.&lt;&#x2F;p&gt;
&lt;p&gt;If you’ve already written Rust programs on your desktop, most of the setup is already done. We only need to add support for embedded targets and install a few additional tools for flashing and debugging firmware.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;install-rust&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#install-rust&quot; aria-label=&quot;Anchor link for: install-rust&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Install Rust&lt;&#x2F;h2&gt;
&lt;p&gt;If you do not already have Rust installed, download and install it from the official Rust website. I recommend following the installation instructions on the official Rust website:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;rust-lang.org&#x2F;tools&#x2F;install&#x2F;&quot;&gt;https:&#x2F;&#x2F;rust-lang.org&#x2F;tools&#x2F;install&#x2F;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;On Linux and macOS, you can install Rust by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;curl&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt; --proto&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt; &amp;#39;&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt;=https&lt;&#x2F;span&gt;&lt;span class=&quot;z-punctuation&quot;&gt;&amp;#39;&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt; --tlsv1.2 -sSf&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; https:&#x2F;&#x2F;sh.rustup.rs&lt;&#x2F;span&gt;&lt;span class=&quot;z-keyword z-operator&quot;&gt; |&lt;&#x2F;span&gt;&lt;span class=&quot;z-entity z-name&quot;&gt; sh&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;On Windows, download and run the installer from the Rust website.&lt;&#x2F;p&gt;
&lt;div class=&quot;admonition tip&quot;&gt;
    &lt;div class=&quot;admonition-icon admonition-icon-tip&quot;&gt;&lt;&#x2F;div&gt;
    &lt;div class=&quot;admonition-content&quot;&gt;
        &lt;strong class=&quot;admonition-title&quot;&gt;TIP&lt;&#x2F;strong&gt;
        &lt;p&gt;To be frank, if this is your first time learning Rust, I do not recommend jumping straight into Embedded Rust. Spend some time learning the basics of Rust first. It will make your Embedded Rust journey much easier.&lt;&#x2F;p&gt;
&lt;p&gt;After all, I assume you chose Rust not because you just want to copy and paste code. You want to understand how things work, enjoy the learning process, and benefit from the safety that Rust provides.&lt;&#x2F;p&gt;

    &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;Once the installation is complete, verify it by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;rustc&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt; --version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt; --version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;rustup&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt; --version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You should see the installed versions printed on the screen.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;install-the-arm-cortex-m-target&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#install-the-arm-cortex-m-target&quot; aria-label=&quot;Anchor link for: install-the-arm-cortex-m-target&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Install the ARM Cortex-M Target&lt;&#x2F;h2&gt;
&lt;p&gt;Rust supports many embedded architectures, including ARM Cortex-M, RISC-V, and Xtensa.&lt;&#x2F;p&gt;
&lt;p&gt;In this article, we’ll install the ARM Cortex-M targets, as they are used by many popular development boards such as the Raspberry Pi Pico, Raspberry Pi Pico W, Pico 2, and STM32 Blue Pill.&lt;&#x2F;p&gt;
&lt;div class=&quot;admonition note&quot;&gt;
    &lt;div class=&quot;admonition-icon admonition-icon-note&quot;&gt;&lt;&#x2F;div&gt;
    &lt;div class=&quot;admonition-content&quot;&gt;
        &lt;strong class=&quot;admonition-title&quot;&gt;NOTE&lt;&#x2F;strong&gt;
        &lt;p&gt;If you’re developing for an ESP32 board, the setup process is slightly different because ESP32 uses a different architecture. You’ll need to install the appropriate Rust target and development tools.&lt;&#x2F;p&gt;
&lt;p&gt;If you’re looking for a step-by-step guide, I also have a dedicated free book on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;esp32.implrust.com&#x2F;&quot;&gt;Embedded Rust with ESP32&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;

    &lt;&#x2F;div&gt;
&lt;&#x2F;div&gt;
&lt;p&gt;Different microcontrollers use different Cortex-M cores, so Rust provides a separate compilation target for each one.&lt;&#x2F;p&gt;
&lt;p&gt;Some common targets are:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Cortex-M Core&lt;&#x2F;th&gt;&lt;th&gt;Rust Target&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Cortex-M0 &#x2F; M0+&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;thumbv6m-none-eabi&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Cortex-M3&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;thumbv7m-none-eabi&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Cortex-M4 &#x2F; M7&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;thumbv7em-none-eabi&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Cortex-M4F &#x2F; M7F&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;thumbv7em-none-eabihf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Cortex-M33&lt;&#x2F;td&gt;&lt;td&gt;&lt;code&gt;thumbv8m.main-none-eabihf&lt;&#x2F;code&gt;&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;Install the target for boards based on the ARM Cortex-M0+ core, such as the Raspberry Pi Pico and Pico W.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;rustup&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; target add thumbv6m-none-eabi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Install the target for boards based on the ARM Cortex-M3 core, such as the STM32 Blue Pill (STM32F103).&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;rustup&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; target add thumbv7m-none-eabi&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Install the target for boards based on the ARM Cortex-M33 core with hardware floating-point support, such as the Raspberry Pi Pico 2 (RP2350).&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;rustup&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; target add thumbv8m.main-none-eabihf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;install-probe-rs&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#install-probe-rs&quot; aria-label=&quot;Anchor link for: install-probe-rs&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Install probe-rs&lt;&#x2F;h2&gt;
&lt;p&gt;Once you’ve compiled your Embedded Rust application, you’ll need a way to flash it onto your development board and debug it. &lt;code&gt;probe-rs&lt;&#x2F;code&gt;, a modern tool for flashing, debugging, and interacting with embedded microcontrollers.&lt;&#x2F;p&gt;
&lt;p&gt;I recommend following the installation instructions on the official probe-rs website:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;probe.rs&#x2F;docs&#x2F;getting-started&#x2F;installation&#x2F;&quot;&gt;https:&#x2F;&#x2F;probe.rs&#x2F;docs&#x2F;getting-started&#x2F;installation&#x2F;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Once the installation is complete, verify it by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;probe-rs&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt; --version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If the version is printed successfully, probe-rs is installed correctly.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;install-cargo-generate&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#install-cargo-generate&quot; aria-label=&quot;Anchor link for: install-cargo-generate&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Install cargo-generate&lt;&#x2F;h2&gt;
&lt;p&gt;When starting a new project, you’ll often need to create the same files and write the same configuration before you can begin writing code. &lt;code&gt;cargo-generate&lt;&#x2F;code&gt; is a tool that helps to create a new project from a template, so you don’t have to set up everything manually.&lt;&#x2F;p&gt;
&lt;p&gt;I normally use &lt;code&gt;cargo-generate&lt;&#x2F;code&gt; to create new projects from templates. There are many templates available from the community, and once you’re familiar with the Rust ecosystem, you can create your own templates, store them in a Git repository or local directory, and use them to generate future projects.&lt;&#x2F;p&gt;
&lt;p&gt;Install it by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; install cargo-generate&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Verify the installation by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; generate&lt;&#x2F;span&gt;&lt;span class=&quot;z-constant&quot;&gt; --version&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;install-cargo-binutils-optional&quot;&gt;&lt;a class=&quot;header-anchor no-hover-padding&quot; href=&quot;#install-cargo-binutils-optional&quot; aria-label=&quot;Anchor link for: install-cargo-binutils-optional&quot;&gt;&lt;span class=&quot;link-icon&quot; aria-hidden=&quot;true&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;a&gt;
Install cargo-binutils (Optional)&lt;&#x2F;h2&gt;
&lt;p&gt;&lt;code&gt;cargo-binutils&lt;&#x2F;code&gt; provides additional commands for inspecting compiled binaries. It can display firmware size, disassemble machine code, and inspect symbols.&lt;&#x2F;p&gt;
&lt;p&gt;While it isn’t required for Embedded Rust development, it can be useful when debugging or exploring what the compiler generated.&lt;&#x2F;p&gt;
&lt;p&gt;Install it by running:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo z-code&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;cargo&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; install cargo-binutils&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span class=&quot;z-entity z-name&quot;&gt;rustup&lt;&#x2F;span&gt;&lt;span class=&quot;z-string&quot;&gt; component add llvm-tools&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;That’s it! Your Embedded Rust development environment is now ready.&lt;&#x2F;p&gt;
</content>
        <summary type="html">Set up a complete Embedded Rust development environment. Install Rust, configure the ARM Cortex-M target, install probe-rs, and verify your setup before programming embedded microcontrollers.</summary>
        </entry>
</feed>
