VideoLibrary

Intro to Embedded Rust - Part 2: Blink and LED | DigiKey

We explore how to create a simple embedded Rust application for the Raspberry Pi Pico 2. We'll walk through building a blinking LED program from scratch, covering essential embedded systems concepts including bare-metal programming, hardware abstraction layers (HAL), and the no_std environment. This tutorial is perfect for developers who want to understand embedded Rust development beyond high-level frameworks like Arduino or MicroPython. The written guide for this episode can be found here: https://www.digikey.com/en/maker/tutorials/2026/intro-to-embedded-rust-part-2-blinking-an-led The GitHub repository containing the Docker image and example code for this series can be found here: https://github.com/ShawnHymel/introduction-to-embedded-rust In this tutorial, you'll learn how to set up an embedded Rust project using Cargo, configure cross-compilation for the ARM Cortex-M33 processor (thumbv8m architecture), and work with the rp235x-hal crate for RP2350 hardware control. We cover the essential project files including Cargo.toml for dependency management, .cargo/config.toml for build configuration, memory.x for defining the linker memory map, and main.rs where we write the actual embedded application. You'll understand how the cortex-m-rt crate handles startup code and memory layout, how the RP2350's Boot ROM initializes your program, and how Rust's type system provides compile-time safety for GPIO operations. This hands-on embedded systems programming tutorial demonstrates key Rust concepts in action, including ownership, type safety, and zero-cost abstractions applied to microcontroller development. We explain why embedded Rust uses #![no_std] and #![no_main] attributes, how to create custom panic handlers for bare-metal environments, and how to control hardware peripherals safely through Rust's ownership system. You'll see how the Pin struct uses generic type parameters to enforce correct GPIO usage at compile time, preventing common embedded programming errors before your code ever runs on the hardware. By the end of this tutorial, you'll have a working blinky LED program running on your Raspberry Pi Pico 2 and a solid foundation for more advanced embedded Rust projects. This example serves as a template for future projects where we'll add USB serial communication, interrupts, and more complex peripheral interactions. Whether you're coming from C/C++ embedded development or from higher-level Rust programming, this tutorial bridges the gap and shows you how to leverage Rust's powerful features in resource-constrained embedded systems.

1/26/2026 7:14:15 PM

Part List

ImageManufacturer Part NumberDescriptionAvailable QuantityPriceView Details
RASPBERRY PI PICO 2 RP2350SC1631RASPBERRY PI PICO 2 RP235025969 - Immediate$19.70View Details
RASPBERRY PI PICO 2 W RP2350SC1633RASPBERRY PI PICO 2 W RP23505961 - Immediate$27.58View Details
RASPBERRY PI PICO 2 WH RP2350SC1634RASPBERRY PI PICO 2 WH RP23502195 - Immediate$31.52View Details
RASPBERRY PI PICO 2 H RP2350SC1632RASPBERRY PI PICO 2 H RP23502614 - Immediate$23.64View Details
LED RED CLEAR T-1 3/4 T/HLTL-4224LED RED CLEAR T-1 3/4 T/H72310 - Immediate$0.55View Details
TMP102 DIGITAL TEMP SENSOR BOARD13314TMP102 DIGITAL TEMP SENSOR BOARD248 - Immediate$23.44View Details
RES 220 OHM 5% 1/4W AXIALCF14JT220RRES 220 OHM 5% 1/4W AXIAL109124 - Immediate
30000 - Factory Stock
$0.39View Details
SWITCH TACTILE SPST-NO 0.05A 24V1825910-6SWITCH TACTILE SPST-NO 0.05A 24V42542 - Immediate$0.51View Details
JUMPER WIRE M TO M 6" 28AWG1957JUMPER WIRE M TO M 6" 28AWG3609 - Immediate$7.68View Details
BREADBRD TERM STRIP 3.20X2.00"FIT0096BREADBRD TERM STRIP 3.20X2.00"3452 - Immediate$11.43View Details
USB AM TO USB MICRO, USB 2.0 - 1DH-20M50055USB AM TO USB MICRO, USB 2.0 - 110945 - Immediate$6.11View Details