Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Toggle an LED on pin 13 every 500 ms using Embedded Rust.
#![no_std]
#![no_main]
use panic_halt as _;
use cortex_m_rt::entry;
use stm32f4xx_hal::{prelude::*, stm32};
#[entry]
fn main() -> ! {
let dp = stm32::Peripherals::take().unwrap();
let gpiod = dp.GPIOD.split();
let mut led = gpiod.pd12.into_push_pull_output();
loop {
led.toggle().unwrap();
cortex_m::asm::delay(8_000_000);
}
}Embedded Rust refers to using the Rust programming language to develop software for embedded systems, microcontrollers, and resource-constrained devices. It focuses on safety, performance, and concurrency without relying on runtime environments or garbage collection.
Origin & Creator
Rust was created by Mozilla in 2010 to offer a safe, fast, and concurrent systems programming language. Embedded Rust emerged through the community’s adaptation of Rust for microcontroller and bare-metal programming.
Industrial Note
Embedded Rust is increasingly adopted in safety-critical industries such as automotive, aerospace, and industrial IoT for reliable, memory-safe firmware development.