🌐
GitHub
github.com › stm32-rs › stm32f4xx-hal
GitHub - stm32-rs/stm32f4xx-hal: A Rust embedded-hal HAL for all MCUs in the STM32 F4 family · GitHub
A Rust embedded-hal HAL for all MCUs in the STM32 F4 family - stm32-rs/stm32f4xx-hal
Starred by 677 users
Forked by 218 users
Languages   Rust
🌐
GitHub
github.com › stm32-rs › stm32f1xx-hal
GitHub - stm32-rs/stm32f1xx-hal: A Rust embedded-hal HAL impl for the STM32F1 family based on japarics stm32f103xx-hal · GitHub
A Rust embedded-hal HAL impl for the STM32F1 family based on japarics stm32f103xx-hal - stm32-rs/stm32f1xx-hal
Starred by 645 users
Forked by 190 users
Languages   Rust
🌐
Rust
docs.rs › stm32f4xx-hal
stm32f4xx_hal - Rust
Multi device hardware abstraction on top of the peripheral access API for the STMicro STM32F4 series microcontrollers.
🌐
crates.io
crates.io › crates › stm32-hal2
stm32-hal2 - crates.io: Rust Package Registry
March 6, 2026 - Eg run rustup target add thumbv7em-none-eabihf. You'll need to change the last part if using a Cortex-M0, Cortex-M33, (Eg Stm32G0 or L5 respectively) or if you don't want to use hardware floats. Install flash and debug tools: cargo install flip-link, cargo install probe-rs --features cli. Clone the quickstart repo: git clone https://github.com/David-OConnor/stm32-hal...
🌐
Reddit
reddit.com › r/rust › embedded rust stm32 hal preference
r/rust on Reddit: Embedded Rust STM32 HAL Preference
March 3, 2024 -

After about a week of learning Rust and going through both The Rust Programming Language Book and The Embedded Rust Book, I have reached a crossroads in my development path. I am in the process of weighing the pros/cons of existing embedded HAL crates.

From what I have come across, there are two major contenders suggested around the community: embedded-hal and Embassy

As it seems, embedded-hal is the official rust-supported crate while Embassy is a community project with HAL and built-in async. However, with the latest 1.0 release of embedded-hal, it seems they also support async calls now. This makes me wonder how different these two crates are in terms of implementation and performance.

If you had to choose a path forward for time-sensitive designs (audio DSP and robotics control systems), which path would you recommend?

🌐
Hashnode
apollolabsblog.hashnode.dev › series › stm32f4-embedded-rust-hal
STM32F4 with Embedded Rust at the HAL
However, I was working on a side project that I needed to use DMA for, and getting it to work with the HAL was thus far the most painful experience I faced in embedded Rust. A... ... This blog post is the third of a three-part series of posts where I explore interrupts for the STM32F401RE microcontroller using embedded Rust at the HAL level.
🌐
GitHub
github.com › stm32-rs › stm32f3xx-hal
GitHub - stm32-rs/stm32f3xx-hal: A Rust embedded-hal HAL for all MCUs in the STM32 F3 family · GitHub
A Rust embedded-hal HAL for all MCUs in the STM32 F3 family - stm32-rs/stm32f3xx-hal
Starred by 176 users
Forked by 73 users
Languages   Rust
🌐
Rust
docs.rs › stm32f1xx-hal
stm32f1xx_hal - Rust
[dependencies] embedded-hal = "0.2.3" nb = "0.1.2" cortex-m = "0.6.2" cortex-m-rt = "0.6.11" # Panic behaviour, see https://crates.io/keywords/panic-impl for alternatives panic-halt = "0.2.0" ... Registers that are not reset as long as Vbat or Vdd has power. ... Peripheral access API for STM32F103 microcontrollers (generated using svd2rust v0.36.1 (4052ce6 2025-04-04))
Find elsewhere
🌐
crates.io
crates.io › crates › stm32f4xx-hal › dependencies
stm32f4xx-hal - crates.io: Rust Package Registry
Bus/Device connection mechanisms for embedded-hal, a Hardware Abstraction Layer (HAL) for embedded systems ... A platform agnostic driver for the FT6x06 type touch panel controller used on STM32F4 series board.
🌐
GitHub
github.com › stm32-rs › stm32f0xx-hal
GitHub - stm32-rs/stm32f0xx-hal: A Rust `embedded-hal` implementation for all MCUs in the STM32 F0 family
A Rust `embedded-hal` implementation for all MCUs in the STM32 F0 family - stm32-rs/stm32f0xx-hal
Starred by 159 users
Forked by 64 users
Languages   Rust 98.1% | Shell 1.2% | Rust 98.1% | Shell 1.2%
🌐
crates.io
crates.io › crates › stm32-hal
stm32-hal - crates.io: Rust Package Registry
HAL layer for STM32 devices on top of STM32 device crates (stm32f103xx) · Licensed under either of
🌐
GitHub
github.com › stm32-rs › stm32f7xx-hal
GitHub - stm32-rs/stm32f7xx-hal: A Rust embedded-hal HAL for all MCUs in the STM32 F7 family
A Rust embedded-hal HAL for all MCUs in the STM32 F7 family - stm32-rs/stm32f7xx-hal
Starred by 125 users
Forked by 72 users
Languages   Rust 99.6% | Rust 99.6%
🌐
Lib.rs
lib.rs › crates › stm32-hal2
stm32-hal2 — embedded dev in Rust // Lib.rs
March 6, 2026 - Eg run rustup target add thumbv7em-none-eabihf. You'll need to change the last part if using a Cortex-M0, Cortex-M33, (Eg Stm32G0 or L5 respectively) or if you don't want to use hardware floats. Install flash and debug tools: cargo install flip-link, cargo install probe-rs --features cli. Clone the quickstart repo: git clone https://github.com/David-OConnor/stm32-hal...
🌐
crates.io
crates.io › crates › stm32h7xx-hal
stm32h7xx-hal - crates.io: Rust Package Registry
The idea behind this crate is to gloss over the slight differences in the various peripherals available on those MCUs so a HAL can be written for all chips in that same family without having to cut and paste crates for every single model. This crate relies on Adam Greig's fantastic stm32h7 crate to provide appropriate register definitions, and implements a partial set of the embedded-hal traits.
🌐
Rust
docs.rs › stm32-hal2
stm32_hal2 - Rust
Additional examples in the examples folder demonstrate how to use various STM32 peripherals; most of these examples focus on a single peripheral. When specifying this crate as a dependency in Cargo.toml, you need to specify a feature representing your MCU. If this is for code that runs on an MCU directly (ie not a library), also include a run-time feature, following the template l4rt. For example: cortex-m = { version = "^0.7.7", features = ["critical-section-single-core"] } cortex-m-rt = "0.7.2" hal = { package = "stm32-hal2", version = "^1.5.5", features = ["l4x3", "l4rt"]}
🌐
Hacker News
news.ycombinator.com › item
I’m currently working on a product using rust on stm32 hardware. I’m very thankf... | Hacker News
November 21, 2021 - Each HAL implements different things, or the same thing in different ways. I’m in the middle of switching from the stm32f1 i started on to the more capable stm32f4 and it’s been a painful switch. I assume this would also suck in other languages, but it seems fixable in rust.
Top answer
1 of 1
3

Some answers from Discord:

  1. stm32l1xx-hal already depends on stm32l1 as seen here. There isn't any need to import it twice. It is enough to add to file Cargo.toml:

    [dependencies.stm32l1xx-hal]
    version = "0.1.0"
    default-features = false
    features = ["stm32l151", "rt"]
    
    
  • Note that the default-features = false is optional, but without it the compiler was giving me an error.
  1. The syntaxes are equivalent, but as I said above, I only need to add the HAL one. You can add curly braces {} in the first style to add the options, such as:

    stm32l1xx-hal = { version = "0.1.0", features = ["stm32l151", "rt"]}
    
    
  2. The right code for doing the blinky (which was on PB6, not PB4) was:

    #![no_main]
    #![no_std]
    
    use panic_halt as _;
    
    use cortex_m_rt::entry;
    use stm32l1xx_hal::delay::Delay;
    use stm32l1xx_hal::gpio::GpioExt;
    use stm32l1xx_hal::hal::digital::v2::OutputPin;
    use stm32l1xx_hal::rcc::{Config, RccExt};
    use stm32l1xx_hal::stm32::Peripherals;
    use stm32l1xx_hal::stm32::CorePeripherals;
    use stm32l1xx_hal::time::MicroSeconds;
    
    
    #[entry]
    fn main() -> ! {
    
        let p = Peripherals::take().unwrap();
        let cp = CorePeripherals::take().unwrap();
    
        // Get LED pin PB6
        let gpiob = p.GPIOB.split();
        let mut led = gpiob.pb6.into_push_pull_output();
    
        // Set up a delay
        let rcc = p.RCC.freeze(Config::default());
        let mut delay = Delay::new(cp.SYST, rcc.clocks);
    
        loop {
    
            // Turn LED On
            led.set_high().unwrap();
    
            delay.delay(MicroSeconds(1_000_000_u32));
    
            // Turn LED Off
            led.set_low().unwrap();
    
            delay.delay(MicroSeconds(1_000_000_u32));
        }
    }
    
    
  • For me, the key was to understand that the split method can be called from the Peripherals because stm32l1xx-hal implemented split for a struct defined in stm32l1. In other words, the HAL crate is not only defining new structs, but also extending functionality for existing structs. I need to wrap my head around trait design patterns.
🌐
Rust Programming Language
users.rust-lang.org › embedded
HAL support for new devices - embedded - The Rust Programming Language Forum
September 26, 2018 - I'm intrigued by the potential for rust in the embedded space. As a platform for experimentation, I purchased an STM32 F4 discovery board. I chose the F4 model to match the CPU on typical racing drone flight controllers without realising the higher level of support for the corresponding F3 ...
🌐
GitHub
github.com › David-OConnor › stm32-hal
GitHub - David-OConnor/stm32-hal: This library provides access to STM32 peripherals in Rust. · GitHub
This library provides access to STM32 peripherals in Rust. - David-OConnor/stm32-hal
Starred by 236 users
Forked by 70 users
Languages   Rust